当我在Symfony2应用程序中调用'Locale::getDefault()
时,在服务器上总是得到'en'
。
开发中的服务器总是可以的。
在任何情况下,$request->getLocale()
和$request->getDefaultLocale()
根据路由返回预期内容,即'fr'
、'en'
、'es'
。
如何根据我的Request
影响应用程序的'Locale
?
您必须在php.ini中启用intl:intl.default_locale = fr
。
并为php:sudo apt-get install php7.0-intl