Skip to content

Instantly share code, notes, and snippets.

@erikaheidi
Last active December 15, 2015 04:19
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 erikaheidi/5200258 to your computer and use it in GitHub Desktop.
Save erikaheidi/5200258 to your computer and use it in GitHub Desktop.
<?php
$lang = "en";
if ($app['session']->get('current_language')) {
$lang = $app['session']->get('current_language');
}
foreach (glob(__DIR__ . '/locale/'. $lang . '/*.yml') as $locale) {
$app['translator']->addResource('yaml', $locale, $lang);
}
/* sets current language */
$app['translator']->setLocale($lang);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment