仔细看文档:http://www.fecshop.com/doc/fecshop-guide/instructions/cn-1.0/guide-fecshop_mutil_lang.html
的 2.配置各个入口的i18n组件(yii2的i18n组件的配置)
部分,解决如下:
打开@app/config/main.php(@app是各个入口的统称,可以以@appfront为例子)
找到下面的配置
'i18n' => [
'translations' => [
'appfront' => [
'basePaths' => [
'@appfront/languages',
],
// base language code
'sourceLanguage' => 'zh_CN',
/**
* @var bool whether to force message translation when the source and target languages are the same.
* Defaults to false, meaning translation is only performed when source and target languages are different.
* see: @yii/i18n/MessageSource.php @property $forceTranslation
*/
'forceTranslation' => true,
],
],
],
设置 'sourceLanguage' => 'zh_CN',
和 'forceTranslation' => true,
你这种方式通过上面的方式可以这样修改,基础语言和当前语言相同的时候,通过设置 'forceTranslation' => true,
强制翻译。