Internationalization

Mr.Hope ... 2021-4-7 Config
  • Config
  • I18n
Less than 1 minute

# Root lang config

You should add locales key in .vuepress/config.js, and set locales["/"].lang. Then the theme can understand which language is the root docs written in:

Tips

# 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 (opens new window)

If the locales and themeConfig.locales objects only contain the "/" key, the theme will not display the multilingual dropdown menu. When you set multiple keys through locales, that is, when there are multiple languages, we will display a multilingual dropdown menu in the upper right corner of navbar.

# Internationalization Support

Available language:

  • 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)

If you need multi-language support for other languages, welcome to submit a PR to this file (opens new window) and other files named i18n.ts in this repo.

Last update: June 2, 2022 05:43
Contributors: Mr.Hope , Mr.Hope