hexojs / hexo-i18n

i18n module for Hexo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how does hexo-i18n detect the correct language?

zekeair opened this issue · comments

After hexo generate operation, all __() and _p() have been exchanged to text. What is the foundation when hexo-i18n working? Although the _config.yml has multiple language order list, all __() and _p() are always converted to the language according to the first item of multiple language order list.

commented

hexo-i18n loads all the language files according to the language setting in _config.yml. During hexo generate it replace all __() and _p() to the first available translation in the language list. For example, the user specify two languages in _config.yml:

language:
  - zh-CN
  - en

If the translation of some string in zh-CN is not available, then it will fallback to use the string in en