I18n
important
Setting LanguageYou need to set the lang
option for each language. Even if you are only using a single language, you must set lang
in .vuepress/config.{js,ts}
.
Why setting it?
To provide the correct locale text, the theme needs to know which language every directory is using.
Internationalization
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 title
, description
, lang
, etc.
Info
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.
If the 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.
Supported Languages
- 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)
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-default
, vuepress-theme-hope
also supports you to set a locale
option in theme options, and set different config for each language.