You can use internationalization to present your site in different languages. Please edit
language setting in
_config.yml. This is your default language. You can also set multiple languages to modify the order of default languages.
Language files can be a YAML or JSON file. They should be put into the
languages folder in the theme. You can use printf format in language files.
_p helpers in templates to get the translated strings. The former is for normal usage and the letter is for plural strings. For example:
<%= __('index.title') %>
You can set the language of pages in front-matter, or modify
i18n_dir setting in
_config.yml to enable Hexo detect automatically.
The default value of
i18n_dir setting is
:lang, which means Hexo will detect the language with the first segment of URL. For example:
/index.html => en
The string will only be served as a language when the language file exists. So
/archives/index.html (example 2) is not served as a language.