Skip to content

Instantly share code, notes, and snippets.

@AleksMeshkov
Created April 4, 2014 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AleksMeshkov/9974304 to your computer and use it in GitHub Desktop.
Save AleksMeshkov/9974304 to your computer and use it in GitHub Desktop.
<?php
/*
* Locale checker
*/
\App::setLocale('ru');
$languages = array('ru', 'en', 'ua', 'by', 'kz', 'md');
$locale = Request::segment(1);
if (in_array($locale, $languages))
{
\App::setLocale($locale);
}
else
{
return Redirect::to('/ru/' . implode('/', Request::segments()))->send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment