Created
March 12, 2014 16:36
-
-
Save tournasdim/9510847 to your computer and use it in GitHub Desktop.
Defining Locale from module's configuration file in ZF2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BookList/Module.php (a custom ZF2 module) | |
public function onBootstrap(MvcEvent $e) | |
{ | |
$translator = $e->getApplication()->getServiceManager()->get('translator') ; | |
$translator->setLocale(\Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE'])) | |
->setFallbackLocale('en_US') ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment