magento2 添加語言包

step 1 導出英文字典並放到主題i18n文件夾之下

bin/magento i18n:collect-phrases -m ./ -o app/design/frontend/<Vendor>/<Theme>/i18n/zh_Hant_HK.csv
  • 注意命名是固定的,能夠參考Locale的選項app

  • zh_Hant_HK.csv裏仍然只有英文,須要額外進行翻譯frontend

step 2 添加Store View

進入頁面 Stores > Configuration > Store View(在頁面左上角) > Stores Configuration
添加store view,如 name=繁體中文 , code=hkspa

step 3 設置 Locale

進入 Stores > Configuration > General 並切換當前Store View爲繁體中文翻譯

修改如下設置爲Hong Kong SAR China
Stores > Configuration > General > Locale Options > Localecode

圖片描述

參考:http://www.weicot.com/magento-2-0-%E8%AF%AD%E8%A8%80%E5%8C%85%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95/blog

相關文章
相關標籤/搜索