You need to set the
lang option for each language. Even if you are only using a single language, you must set
Why setting it?
To provide the correct locale text, the theme needs to know which language every directory is using.
locales is an object whose key is the path prefix of each language, and value is the configuration of this language. The value object can include
For details of multiple languages, please see Official Document
You should set the
lang option for each language so that themes and plugins can handle them correctly.
locales objects only contain the
"/" key, the theme will not display the language dropdown menu. When you set multiple keys through
locales (when there are multiple languages), we will display a language dropdown menu in navbar.
- Simplified Chinese (zh-CN)
- Traditional Chinese (zh-TW)
- English (United States) (en-US)
- German (de-AT)
- Russian (ru-RU)
- Ukrainian (uk-UA)
- Vietnamese (vi-VN)
- Portuguese (Brazil) (pt-BR)
- Polish (pl-PL)
- French (fr-FR)
- Spanish (es-ES)
- Slovak (sk-SK)
- Japanese (ja-JP)
- Turkish (tr-TR)
- Korean (ko-KR)
If you need multi-language support for other languages, welcome to submit a PR to all files named
locale.ts in this repo.
Setting Options for Each Language
Like the Site Config and Theme Config of
vuepress-theme-hope also supports you to set a
locale option in theme options, and set different config for each language.