/*! For license information please see 8384.53877c3d.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["8384"],{84689:function(n,t,d){"use strict";d.r(t);var a=d("80681");let s=["innerHTML"];t.default={setup:()=>({html:""}),render:()=>((0,a.wg)(),(0,a.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

Internationalization

\n

Intro

\n

Vant uses Chinese as the default language. If you want to use other languages, please follow the instructions below.

\n

Usage

\n

Switch languages

\n

Vant supports multiple languages with the Locale component, and the Locale.use method allows you to switch to different languages.

\n
import { Locale } from 'vant';\nimport enUS from 'vant/es/locale/lang/en-US';\n\nLocale.use('en-US', enUS);\n
\n

Override default configs

\n

Use Locale.add method to modify the default configs.

\n
import { Locale } from 'vant';\n\nconst messages = {\n  'en-US': {\n    vanPicker: {\n      confirm: 'Close',\n    },\n  },\n};\n\nLocale.add(messages);\n
\n

Config files

\n

Current supported languages:

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
LanguageFilenameVersion
Arabicar-SAv3.5.0
Bulgarianbg-BGv3.5.0
Bangla (Bangladesh)bn-BDv3.4.5
Danishda-DKv3.4.8
Germande-DE-
German (formal)de-DE-formal-
Greekel-GRv3.5.0
Englishen-US-
Esperantoeo-EOv4.0.9
Spanish (Spain)es-ES-
Farsifa-IRv3.5.0
Frenchfr-FR-
Hebrewhe-ILv3.5.0
Hindihi-INv3.4.3
Indonesianid-IDv3.4.5
Icelandicis-ISv3.4.7
Italianit-ITv3.4.5
Japaneseja-JP-
Khmerkm-KHv4.1.2
Koreanko-KRv3.4.3
Laola-LAv3.4.7
Mongolianmm-MNv4.0.5
Norwegiannb-NO-
Dutchnl-NLv4.0.5
Portuguese (Brazil)pt-BRv3.3.3
Romanianro-RO-
Russianru-RUv3.1.5
Serbiansr-RSv4.6.4
Swedishsv-SEv3.4.7
Thaith-TH-
Turkishtr-TR-
Ukrainianuk-UAv3.4.5
Vietnamesevi-VNv3.4.5
Chinesezh-CN-
Traditional Chinese (HK)zh-HK-
Traditional Chinese (TW)zh-TW-
\n
\n

View all language configs Here.

\n
\n

Add new language

\n

If you can\u2019t find the language you need, please send us a Pull Request to add the new language pack, you can refer to Add German language pack PR.

\n

Get Current Lang

\n

You can get the current language using useCurrentLang method.

\n\n
function useCurrentLang(): Ref<string>;\n
\n\n
import { useCurrentLang } from 'vant';\n\nconst currentLang = useCurrentLang();\n\nconsole.log(currentLang.value); // --> 'en-US'\n
\n
'},null,8,s))}}}]);