Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): add short lang 'zh' support in i18n, close #209 #210

Merged
merged 3 commits into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
};
};