Closed laozhou0731 closed 11 months ago
对比2.4.3,语言目录 /var/lib/docker/volumes/magento_magento_data/_data/vendor/magento/language-zh_hans_cn 缺少文件 zh_Hans_CN.csv
上传该文件,执行如下命令,能解决后台设置中文的问题:
## 下载语言包
cd /var/lib/docker/volumes/magento_magento_data/_data/vendor/magento/language-zh_hans_cn
wget -N https://raw.githubusercontent.com/magento-l10n/language-zh_CN/master/zh_CN.csv
## 进入容器,安装语言
docker exec -it magento bash
cd /bitnami/magento/
bin/magento setup:static-content:deploy zh_Hans_CN
bin/magento indexer:reindex
bin/magento cache:clean
bin/magento cache:flush
Docker image env: MAGENTO_MODE: Magento mode. Valid values: default, production, developer. Default: default
refer to:
develop can show language list, but can't tranlate the menu and other contents
Resource for reference:
When installing Magento, the official default is to only install the US version and not install other language packs. The other language packs need to be installed by oneself。How to Install Chinese Language Pack:
Get Language Pack:Magento officially released a translation of Chinese language writing on Crowdin Magento 2 Project, but the version and translation progress are incomplete 。For this reason,some third-party authors create some zh_CN language package based on translations provided at Crowdin Magento 2 Project。Such as:
However,any third-party zh_CN language package may miss some translations. We can use third-party language packs or create our own language packs based on crowdin。 The third-party language pack as a complete CSV file can be directly downloaded and used. If you need to create your own language pack based on crowdin,。we need to merge the translations of all modules separately before using it.
Import Language Pack: A complete language pack that includes the following content:
A translated CSV file
During the installation of magento, the Chinese language pack was automatically installed, but the translation files were missing。The directory is located at:
/var/lib/docker/volumes/magento_magento_data/_data/vendor/magento/language-zh_hans_cn && wget -N https://raw.githubusercontent.com/magento-l10n/language-zh_CN/master/zh_CN.csv
Like this:
We need to upload the CSV translation file obtained in the previous step to this directory。We need to upload the CSV translation file obtained in the previous step to this directory and rename it to: zh_Hans_CN.csv。Because the official command for the Chinese language pack is: zh_Hans_CN
Entering the interior of the magento main container:docker exec -it magento bash
Execute the following command:
magento setup:static-content:deploy zh_Hans_CN (Deploy static content for specified language and region to Magento 2)
magento indexer:reindex (Force rebuild of all indexes)
magento cache:clean (Clear Cache)
magento cache:flush (Flush Cache )
switch language: From Magento 2 admin panel, navigate to admin(Your Account)> Account Setting (Your Account) >Interface Locale Enter Account Setting Choose Chinese: Save Account ,You will see the Chinese page:
Describe the bug
设置前台
设置后台