Skip to content

Commit

Permalink
feat: add i18n supports for console (#3506)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

为 Console 端添加多语言的支持,并默认提供简体中文和英文的语言包。

todolist:

- [x] 完善 Console 的文字语言包翻译。
- [ ] ~~为后端提供的部分数据支持翻译,比如系统设置的表单定义。(实现方式待讨论,这个 PR 先不支持)~~
- [x] 提供语言设置。

#### Which issue(s) this PR fixes:

Fixes #3346 

#### Special notes for your reviewer:

测试方式:

1. 检查各个页面的文字显示是否正常。
2. 测试中英文环境中是否使用了对应的语言包。

#### Does this PR introduce a user-facing change?

```release-note
Console 端支持多语言界面
```
  • Loading branch information
ruibaby authored Mar 23, 2023
1 parent c400c85 commit b63d2b8
Show file tree
Hide file tree
Showing 124 changed files with 4,997 additions and 1,411 deletions.
1 change: 0 additions & 1 deletion console/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# 排除 pnpm-lock.yaml,防止被 prettier 影响导致不必要的 diff
pnpm-lock.yaml
5 changes: 3 additions & 2 deletions console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"fastq": "^1.15.0",
"floating-vue": "2.0.0-beta.20",
"fuse.js": "^6.6.2",
"jsencrypt": "^3.3.2",
"lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
Expand All @@ -83,13 +84,13 @@
"vue-grid-layout": "3.0.0-beta1",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.6",
"vuedraggable": "^4.1.0",
"jsencrypt": "^3.3.2"
"vuedraggable": "^4.1.0"
},
"devDependencies": {
"@changesets/cli": "^2.25.2",
"@iconify-json/mdi": "^1.1.36",
"@iconify-json/vscode-icons": "^1.1.16",
"@intlify/unplugin-vue-i18n": "^0.9.1",
"@rushstack/eslint-patch": "^1.2.0",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/container-queries": "^0.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ const props = withDefaults(
size?: number;
total?: number;
sizeOptions?: number[];
pageLabel?: string;
sizeLabel?: string;
}>(),
{
page: 1,
size: 10,
total: 0,
sizeOptions: () => [10],
pageLabel: "",
sizeLabel: "条 / 页",
}
);
Expand Down Expand Up @@ -115,7 +119,7 @@ const {
{{ i }} / {{ pageCount }}
</option>
</select>
<span class="text-sm text-gray-500"></span>
<span class="text-sm text-gray-500">{{ pageLabel }}</span>
</div>
<div class="inline-flex items-center gap-2">
<select
Expand All @@ -130,7 +134,7 @@ const {
{{ sizeOption }}
</option>
</select>
<span class="text-sm text-gray-500">条 / 页</span>
<span class="text-sm text-gray-500">{{ sizeLabel }}</span>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit b63d2b8

Please sign in to comment.