Skip to content

Commit

Permalink
feat(client): add short lang 'zh' support in i18n, close #209 (#210)
Browse files Browse the repository at this point in the history
* feat: add short lang `'zh'` support in i18n

* docs: update chinese i18n docs

* docs: update english i18n docs
  • Loading branch information
Mister-Hope committed Apr 29, 2021
1 parent 87b04ca commit 2332f6f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions docs/client/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ Waline 的多语言翻译以及字段都是沿用了 Valine 的配置,在此
## 基本用法
Waline 支持多语言。默认内置:

- `zh`
- `zh-CN`
- `en`
- `zh-TW`
- `en`
- `en-US`
- `jp`
- `jp-JP`

```js
new Waline({
Expand Down Expand Up @@ -68,4 +71,4 @@ new Waline({
serverURL: 'YOUR_SERVER_URL',
langMode: langMode
});
```
```
7 changes: 5 additions & 2 deletions docs/en/client/i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ Waline's multi-language translations and fields all follow Valine's configuratio
Waline Multilingual support has been supported.
Default built-in:

- `zh`
- `zh-CN`
- `en`
- `zh-TW`
- `en`
- `en-US`
- `jp`
- `jp-JP`

```js
new Waline({
Expand Down Expand Up @@ -71,4 +74,4 @@ new Waline({
serverURL: 'YOUR_SERVER_URL',
langMode: langMode
});
```
```
3 changes: 2 additions & 1 deletion packages/client/src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import zhCN from "./zh-CN";
import zhTW from "./zh-TW";

export default {
"zh": zhCN,
"zh-cn": zhCN,
"zh-CN": zhCN,
"zh-TW": zhTW,
"en": en,
"en-US": en,
"jp": jp,
"jp-JP": jp
};
};

0 comments on commit 2332f6f

Please sign in to comment.