我开始研究多语言Zend Framework应用程序而且我一直被我讨厌的东西所困扰:
The locale is not working like expected.
有.ini配置:
; Locale
resources.locale.default = "fr"
resources.locale.force = false
resources.locale.cache = "locale"
resources.locale.registry_key = "Zend_Locale"
; Translate
resources.translate.adapter = Ini
resources.translate.content = APPLICATION_PATH "/../data/locales"
resources.translate.scan = Zend_Translate::LOCALE_DIRECTORY
resources.translate.options.tag = "Zend_Translate"
resources.translate.options.logUntranslated = true
resources.translate.options.disableNotices = false
resources.translate.options.logMessage = "Untranslated message within '%locale%': %message%"
resources.translate.options.logPriority = 5
resources.translate.options.registry_key = "Zend_Translate"
resources.translate.cache = "languages"
resources.translate.locale = "auto"
我的文件名是:
/locales/en.ini
/locales/fr.ini
当我做一个简单的$this->translate('COPYRIGHT');
时,它总是返回法语翻译。即使我的电脑是英文的。我尝试将force = true
添加到区域设置并将其更改为en_US
,但没有成功。