Skip to content

Commit 727b4f7

Browse files
authored
🎊 feat: update langs i18n (#415)
1 parent 062387b commit 727b4f7

File tree

17 files changed

+116
-81
lines changed

17 files changed

+116
-81
lines changed

.stylelintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ module.exports = {
4040
}
4141
],
4242
'property-no-unknown': null,
43+
'scss/at-rule-no-unknown': null,
4344
'at-rule-empty-line-before': [
4445
'always',
4546
{

.vscode/extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
33
"vue.volar",
4+
"antfu.iconify",
45
"dbaeumer.vscode-eslint",
56
"stylelint.vscode-stylelint"
67
]

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"css.customData": [".vscode/tailwind.json"],
23
"editor.formatOnSave": false,
34

45
// Auto fix

.vscode/tailwind.json

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"version": 1.1,
3+
"atDirectives": [
4+
{
5+
"name": "@tailwind",
6+
"description": "Use the `@tailwind` directive to insert Tailwind's `base`, `components`, `utilities` and `screens` styles into your CSS.",
7+
"references": [
8+
{
9+
"name": "Tailwind Documentation",
10+
"url": "https://tailwindcss.com/docs/functions-and-directives#tailwind"
11+
}
12+
]
13+
},
14+
{
15+
"name": "@apply",
16+
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
17+
"references": [
18+
{
19+
"name": "Tailwind Documentation",
20+
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
21+
}
22+
]
23+
},
24+
{
25+
"name": "@responsive",
26+
"description": "You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive:\n```css\n@responsive {\n .alert {\n background-color: #E53E3E;\n }\n}\n```\n",
27+
"references": [
28+
{
29+
"name": "Tailwind Documentation",
30+
"url": "https://tailwindcss.com/docs/functions-and-directives#responsive"
31+
}
32+
]
33+
},
34+
{
35+
"name": "@screen",
36+
"description": "The `@screen` directive allows you to create media queries that reference your breakpoints by **name** instead of duplicating their values in your own CSS:\n```css\n@screen sm {\n /* ... */\n}\n```\n…gets transformed into this:\n```css\n@media (min-width: 640px) {\n /* ... */\n}\n```\n",
37+
"references": [
38+
{
39+
"name": "Tailwind Documentation",
40+
"url": "https://tailwindcss.com/docs/functions-and-directives#screen"
41+
}
42+
]
43+
},
44+
{
45+
"name": "@variants",
46+
"description": "Generate `hover`, `focus`, `active` and other **variants** of your own utilities by wrapping their definitions in the `@variants` directive:\n```css\n@variants hover, focus {\n .btn-brand {\n background-color: #3182CE;\n }\n}\n```\n",
47+
"references": [
48+
{
49+
"name": "Tailwind Documentation",
50+
"url": "https://tailwindcss.com/docs/functions-and-directives#variants"
51+
}
52+
]
53+
}
54+
]
55+
}

src/components/Layout/LayoutView.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export default defineComponent({
3636
:title="_t('result.title')"
3737
>
3838
<ul>
39-
<li>111</li>
40-
<li>222</li>
41-
<li>333</li>
39+
<li>Test Menu 这里放菜单1</li>
40+
<li>Test Menu 这里放菜单2</li>
41+
<li>Test Menu 这里放菜单3</li>
4242
</ul>
4343
</LayoutSection>
4444
</template>

src/components/Navigation/Side/SideAction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineComponent({
3333
:key="item"
3434
class="action-item"
3535
>
36-
Action {{ item }}
36+
{{ _t('nav.action') }}{{ item }}
3737
</li>
3838
</ul>
3939
</div>

src/locales/lang/en.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ export default {
77
goback: 'Back to the previous page',
88
empty: 'No data available',
99
i18nTest: 'Test internationalization',
10-
pleaseInput: 'Please Input'
10+
pleaseInput: 'Please Input',
11+
btnCancel: 'Cancel',
12+
btnConfirm: 'Confirm'
13+
},
14+
nav: {
15+
action: 'Action'
1116
},
1217
login: {
1318
hydl: 'Hi, Welcome',

src/locales/lang/zh-hans.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ export default {
55
goback: '返回',
66
empty: '无可用数据',
77
i18nTest: '测试国际化',
8-
pleaseInput: '请输入'
8+
pleaseInput: '请输入',
9+
btnCancel: '取消',
10+
btnConfirm: '确定'
11+
},
12+
nav: {
13+
action: '操作'
914
},
1015
login: {
1116
hydl: '欢迎登录',

src/modules/Project/components/ProjectItem.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ async function handlePublish (projectId) {
188188
}
189189
190190
.project-item__name-desc {
191-
flex: 1;
192-
overflow: hidden;
191+
--at-apply: flex-1 overflow-hidden;
193192
194193
.project-item__name-desc__corpname {
195194
display: flex;

src/modules/Project/data/index.ts

+21-38
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,39 @@
1+
const date = new Date()
2+
const [, id] = String(Math.random()).split('.')
3+
const today = `${ date.getFullYear() }-${ date.getMonth() + 1 }-${ date.getDate() }`
4+
15
export const projectDetail = {
2-
id: Math.random(),
3-
name: '测试项目',
4-
corpName: '测试公司',
5-
notes: '备注',
6+
id,
7+
name: 'This is Test Name 测试项目',
8+
corpName: 'This is Test Company 测试公司',
9+
notes: 'This is Test Remarks 备注',
610
isPublished: false,
7-
createTime: '2023.01.29'
11+
createTime: today
812
}
913

1014
export const projectList = [
1115
{
1216
id: '111',
13-
name: '测试项目',
14-
corpName: '测试公司',
15-
notes: '备注备注',
17+
name: 'Test Name 测试项目',
18+
corpName: 'Test Company 测试公司',
19+
notes: 'Test Remarks 备注',
1620
isPublished: false,
17-
createTime: '2023.01.29'
21+
createTime: today
1822
},
1923
{
2024
id: '222',
21-
name: '测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目测试项目',
22-
corpName: '测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司测试公司',
23-
notes: '备注备注',
25+
name: 'This is Test Test Test Test Name',
26+
corpName: 'This is Test Test Test Company',
27+
notes: 'Remarks.... 这是备注😄',
2428
isPublished: true,
25-
createTime: '2023.03.29'
29+
createTime: today
2630
},
2731
{
2832
id: '333',
29-
name: '测试项目',
30-
corpName: '测试公司',
31-
notes: '',
33+
name: 'This is Test Test Test Test Name',
34+
corpName: 'This is Test Test Test 中文名称',
35+
notes: '中文备注',
3236
isPublished: false,
33-
createTime: '2023.02.29'
37+
createTime: today
3438
}
3539
]
36-
37-
export const corporationList = [
38-
'Alabama', 'Alaska', 'Arizona',
39-
'测试', '测试1', '测试2', '测试3',
40-
'Arkansas', 'California', 'Colorado',
41-
'Connecticut', 'Delaware', 'Florida',
42-
'Georgia', 'Hawaii', 'Idaho', 'Illinois',
43-
'Indiana', 'Iowa', 'Kansas', 'Kentucky',
44-
'Louisiana', 'Maine', 'Maryland',
45-
'Massachusetts', 'Michigan', 'Minnesota',
46-
'Mississippi', 'Missouri', 'Montana',
47-
'Nebraska', 'Nevada', 'New Hampshire',
48-
'New Jersey', 'New Mexico', 'New York',
49-
'North Carolina', 'North Dakota', 'Ohio',
50-
'Oklahoma', 'Oregon', 'Pennsylvania',
51-
'Rhode Island', 'South Carolina',
52-
'South Dakota', 'Tennessee', 'Texas',
53-
'Utah', 'Vermont', 'Virginia',
54-
'Washington', 'West Virginia', 'Wisconsin',
55-
'Wyoming'
56-
]

src/modules/Project/pages/list.vue

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default defineComponent({
109109
>
110110
<IconFont
111111
icon="iconestablish"
112+
class="mr-2"
112113
/>
113114
{{ _t('project.create') }}
114115
</el-button>

src/modules/Project/store/index.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11

22
import { sleep } from '@/utils/request'
3-
import {
4-
createProject,
5-
getProjectDetail,
6-
getProjectList,
7-
updateTogglePublishStatus
8-
} from '@/modules/Project/api'
3+
import * as ProjectApi from '@/modules/Project/api'
94
import MUTATION from '@/modules/Project/store/mutations-type'
105
import mixin from '@/store/utils/mixin'
11-
import {
12-
projectDetail,
13-
projectList
14-
} from '@/modules/Project/data'
6+
import * as ProjectData from '@/modules/Project/data'
157
import type { Module } from 'vuex'
168
import type { IGlobalState } from '@/store'
179

@@ -50,7 +42,7 @@ const ProjectModule: Module<IProjectModule, IGlobalState> = {
5042
actions: {
5143
async getSearchProjectByQuery ({ commit }, query) {
5244
await sleep(300)
53-
const res = await getProjectList(query)
45+
const res = await ProjectApi.getProjectList(query)
5446
return this.filterResponse(res, null, () => {})
5547
},
5648
async getProjectList ({ commit }, params) {
@@ -60,7 +52,7 @@ const ProjectModule: Module<IProjectModule, IGlobalState> = {
6052
msg: 'ok',
6153
error: 0,
6254
data: {
63-
projectList
55+
projectList: ProjectData.projectList
6456
}
6557
}
6658
return this.filterResponse(res, () => {
@@ -89,7 +81,7 @@ const ProjectModule: Module<IProjectModule, IGlobalState> = {
8981
})
9082
},
9183
async updateTogglePublishStatus ({ commit }, params) {
92-
const res = await updateTogglePublishStatus(params)
84+
const res = await ProjectApi.updateTogglePublishStatus(params)
9385
return this.filterResponse(res, null)
9486
}
9587
},

src/modules/Result/data/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const overviewMock = {
2-
title: '测试标题总览',
3-
content: '测试内容 overview'
2+
title: 'Async Test title overview 测试异步标题',
3+
content: 'Async Test content overview 测试异步内容'
44
}

src/modules/UserAccount/components/ContainerLayout.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export default defineComponent({
290290
}
291291
}
292292
293-
@media screen and (width <= 600px) {
293+
@screen lt-sm {
294294
295295
.user-account-container-layout {
296296
width: 95%;

src/modules/UserAccount/pages/login.vue

+5-16
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ export default defineComponent({
9090
text: localeInject.t('login.fgtpwd'),
9191
click () {
9292
console.log(proxy, localeInject.t('login.fgtpwd'))
93+
ElMessage.info({
94+
message: `😄 ${ localeInject.t('login.fgtpwd') }`
95+
})
9396
}
9497
},
9598
type: 'password',
@@ -253,24 +256,10 @@ export default defineComponent({
253256
}
254257
255258
.user-account-body {
256-
flex: 1;
257-
display: flex;
258-
align-items: center;
259-
justify-content: flex-end;
259+
--at-apply: flex-1 flex items-center justify-end;
260260
}
261261
}
262262
263-
@media screen and (width <= 600px) {
264263
265-
.user-account-container-layout {
266-
justify-content: center;
267-
268-
.user-account-nav {
269-
left: 0;
270-
right: 0;
271-
margin: auto;
272-
justify-content: center;
273-
}
274-
}
275-
}
276264
</style>
265+

src/widgets/ModalDialog/modal.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@ export default defineComponent({
172172
round
173173
@click="handleCancel()"
174174
>
175-
取消
175+
{{ _t('base.btnCancel') }}
176176
</el-button>
177177
<el-button
178178
type="primary"
179179
round
180180
@click="handleConfirm()"
181181
>
182-
{{ confirmText || '确定' }}
182+
{{ confirmText || _t('base.btnConfirm') }}
183183
</el-button>
184184
</div>
185185
</div>

uno.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export default defineConfig({
1818
transformerAttributifyJsx()
1919
],
2020
theme: {
21+
breakpoints: {
22+
sm: '600px'
23+
},
2124
colors: {
22-
primary: 'rgba(32, 48, 98, %alpha)',
25+
primary: '#3c40c6',
2326
success: 'rgba(82, 196, 26, %alpha)',
2427
warning: 'rgba(250, 173, 20, %alpha)',
2528
danger: 'rgba(250, 85, 85, %alpha)',

0 commit comments

Comments
 (0)