docs(Locale): add faq

This commit is contained in:
chenjiahan
2020-10-01 10:01:40 +08:00
parent ab62dc765f
commit e4e7d9d9eb
2 changed files with 31 additions and 8 deletions
+8 -2
View File
@@ -4,18 +4,20 @@
The default language of Vant is Chinese. If you want to use other languages, you can follow the instructions below.
## Usage
### Switch languages
Vant supports multiple languages with the Locale component, and the `Locale.use` method allows you to switch to different languages.
```js
import { Locale } from 'vant';
import enUS from 'vant/lib/locale/lang/en-US';
import enUS from 'vant/es/locale/lang/en-US';
Locale.use('en-US', enUS);
```
### Modify default configs
### Override default configs
Use `Locale.add` method to modify the default configs.
@@ -52,3 +54,7 @@ Current supported languages:
| Turkish | tr-TR |
> View all language configs [Here](https://github.com/youzan/vant/tree/dev/src/locale/lang).
### Add new language
If you cant 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](https://github.com/youzan/vant/pull/7245) PR.