我开始研究一个多语言 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
但没有成功。