浏览文章
文章信息
Magento2 中文语言包翻译|Magento2 How To Change Default Language as Chinese
19397
方法#1 通过命令行安装
通过命令行安装中文语言包。
将语言文件下载到安装根目录。现在运行以下命令:
wget https://github.com/mageplaza/magento-2-chinese-language-pack/raw/master/zh_Hans_CN.csv php bin/magento i18n:pack -m replace zh_Hans_CN.csv zh_Hans_CNphp bin/magento setup:static-content:deploy zh_Hans_CNphp bin/magento cache:flush因此,将创建一个目录语言包,其中包含适合您的安装的语言文件结构。将其复制到Magento安装中,翻译应该是可见的。
注意:附加目录i18n包含在安装中找不到该模块的字符串。可以跳过此文件。
方法#2 通过Composer安装
通过composer安装中文语言包真的很容易。
安装中文包:
composer require mageplaza/magento-2-chinese-language-pack:dev-masterphp bin/magento setup:static-content:deploy zh_Hans_CNphp bin/magento indexer:reindexphp bin/magento cache:cleanphp bin/magento cache:flush
您可能会收到以下消息:
=>转到“ 访问密钥”页面
Create A New Access Key
。或者使用这些键:
Public Key: c7af1bfc9352e9c986637eec85ed53afPrivate Key: 17e1b72ea5f0b23e9dbfb1f68dc12b53更新中文包:
composer update mageplaza/magento-2-chinese-language-pack:dev-masterphp bin/magento setup:static-content:deploy zh_Hans_CNphp bin/magento indexer:reindexphp bin/magento cache:cleanphp bin/magento cache:flush如何激活语言包
是时候激活Magento 2商店的语言包了。从Magento 2管理面板,导航到
Stores > Configuration > General > Locale Options
选择
Chinese (China)
并单击Save Configuration