Skip to content

Commit 1e116fc

Browse files
authored
feat: add uyghur (ug-CN) locale (#6670)
1 parent 32f893f commit 1e116fc

File tree

7 files changed

+294
-0
lines changed

7 files changed

+294
-0
lines changed

demo/pages/docs/i18n/enUS/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ The following list is sorted by 'Config' column.
7575
| Vietnamese (Vietnam) | viVN | dateViVN | 2.30.7 |
7676
| Chinese (Simplified) | zhCN | dateZhCN | |
7777
| Chinese (Traditional) | zhTW | dateZhTW | |
78+
| Uyghur(China) | ugCN | dateUgCN | |
7879

7980
## Customize the existing locale
8081

demo/pages/docs/i18n/zhCN/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Naive-ui 通过使用 `n-config-provider` 调整语言,默认情况下所有
7575
| 越南语(越南) | viVN | dateViVN | 2.30.7 |
7676
| 简体中文 | zhCN | dateZhCN | |
7777
| 繁体中文 | zhTW | dateZhTW | |
78+
| 维吾尔语 | ugCN | dateUgCN | |
7879

7980
## 在现有国际化基础上调整
8081

src/locales/__snapshots__/index.spec.tsx.snap

+144
Large diffs are not rendered by default.

src/locales/common/ugCN.ts

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import type { NLocale } from './enUS'
2+
3+
const ugCN: NLocale = {
4+
name: 'ug-CN',
5+
global: {
6+
undo: 'قالدۇرۇش',
7+
redo: 'قايتا',
8+
confirm: 'جەزملەش',
9+
clear: 'تازلاش'
10+
},
11+
Popconfirm: {
12+
positiveText: 'جەزملەش',
13+
negativeText: 'بىكار قىلىش'
14+
},
15+
Cascader: {
16+
placeholder: 'تاللاڭ',
17+
loading: 'يۈكلەۋاتىدۇ',
18+
loadingRequiredMessage: (label: string): string =>
19+
`جەمئى ${label} تۈگۈننى يۈكلەپ بولغاندىن كېيىن تاللىغىلى بولىدۇ`
20+
},
21+
Time: {
22+
dateFormat: 'yyyy-MM-dd',
23+
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss'
24+
},
25+
DatePicker: {
26+
yearFormat: 'yyyy-يىل',
27+
monthFormat: 'MMM',
28+
dayFormat: 'eeeeee',
29+
yearTypeFormat: 'yyyy',
30+
monthTypeFormat: 'yyyy-MM',
31+
dateFormat: 'yyyy-MM-dd',
32+
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
33+
quarterFormat: 'yyyy-qqq',
34+
weekFormat: 'YYYY-wھەپتە',
35+
clear: 'تازلاش',
36+
now: 'مۇشۇ ۋاقىت',
37+
confirm: 'جەزملەش',
38+
selectTime: 'ۋاقىت تاللاڭ',
39+
selectDate: 'چىسلا تاللاڭ',
40+
datePlaceholder: 'چىسلا تاللاڭ',
41+
datetimePlaceholder: 'چىسلا ۋاقىت تاللاڭ',
42+
monthPlaceholder: 'ئاي تاللاڭ',
43+
yearPlaceholder: 'يىل تاللاڭ',
44+
quarterPlaceholder: 'پەسىل تاللاڭ',
45+
weekPlaceholder: 'ھەپتە تاللاڭ',
46+
startDatePlaceholder: 'باشلىنىش ۋاقتى',
47+
endDatePlaceholder: 'ئاخىرلىشىش ۋاقتى',
48+
startDatetimePlaceholder: 'باشلىندىغان چىسلا ۋاقىت',
49+
endDatetimePlaceholder: 'ئاخىرلىشىدىغان چىسلا ۋاقىت',
50+
startMonthPlaceholder: 'باشلىندىغان ئاي',
51+
endMonthPlaceholder: 'ئاخىرلىشىدىغان ئاي',
52+
monthBeforeYear: false,
53+
firstDayOfWeek: 0,
54+
today: 'بۈگۈن'
55+
},
56+
DataTable: {
57+
checkTableAll: 'ھەممە ئۇچۇرنى تاللاش',
58+
uncheckTableAll: 'تاللاشنى بىكار قىلىش',
59+
confirm: 'جەزملەش',
60+
clear: 'تازلاش'
61+
},
62+
LegacyTransfer: {
63+
sourceTitle: 'ئەسلى تۈر',
64+
targetTitle: 'نىشان تۈر'
65+
},
66+
Transfer: {
67+
selectAll: 'ھەممىنى تاللاش',
68+
clearAll: 'تازلاش',
69+
unselectAll: 'ھەممىنى بىكار قىلىش',
70+
total: (num: number): string => `جەمئى ${num} تۈر`,
71+
selected: (num: number): string => `${num} تۈر تاللاندى`
72+
},
73+
Empty: {
74+
description: 'ئۇچۇر يوق'
75+
},
76+
Select: {
77+
placeholder: 'تاللاڭ'
78+
},
79+
TimePicker: {
80+
placeholder: 'ۋاقىت تاللاڭ',
81+
positiveText: 'جەزملەش',
82+
negativeText: 'بىكار قىلىش',
83+
now: 'مۇشۇ ۋاقىت',
84+
clear: 'تازلاش'
85+
},
86+
Pagination: {
87+
goto: 'ئاتلاش',
88+
selectionSuffix: 'بەت'
89+
},
90+
DynamicTags: {
91+
add: 'قوشۇش'
92+
},
93+
Log: {
94+
loading: 'يۈكلەۋاتىدۇ'
95+
},
96+
Input: {
97+
placeholder: 'كىرگۈزۈڭ'
98+
},
99+
InputNumber: {
100+
placeholder: 'كىرگۈزۈڭ'
101+
},
102+
DynamicInput: {
103+
create: 'قوشۇش'
104+
},
105+
ThemeEditor: {
106+
title: 'ئۇسلوب تەھرىرلىگۈچ',
107+
clearAllVars: 'ھەممە پارامىتىرنى تازلاش',
108+
clearSearch: 'ئىزدەشنى تازلاش',
109+
filterCompName: 'ۋىجىت ئىسمىنى فىلتىرلاش',
110+
filterVarName: 'پارامىتېرنى فىلتىرلاش',
111+
import: 'ئەكىرىش',
112+
export: 'چىقىرىش',
113+
restore: 'ئەسلىگە قايتۇرۇش'
114+
},
115+
Image: {
116+
tipPrevious: '(←)ئالدىنقىسى',
117+
tipNext: 'كېيىنكىسى(→)',
118+
tipCounterclockwise: 'سولغا چۆرۈش',
119+
tipClockwise: 'ئوڭغا چۆرۈش',
120+
tipZoomOut: 'كىچىكلىتىش',
121+
tipZoomIn: 'چوڭايتىش',
122+
tipDownload: 'چۈشۈرۈش',
123+
tipClose: 'تاقاش(Esc)',
124+
tipOriginalSize: 'ئەسلىگە قايتۇرۇش'
125+
}
126+
}
127+
128+
export default ugCN

src/locales/date/ugCN.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { NDateLocale } from './enUS'
2+
import { ug } from 'date-fns/locale'
3+
4+
const dateUgCN: NDateLocale = {
5+
name: 'ug-CN',
6+
locale: ug
7+
}
8+
9+
export default dateUgCN

src/locales/index.spec.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
dateSvSE,
3434
dateThTH,
3535
dateTrTR,
36+
dateUgCN,
3637
dateUkUA,
3738
dateUzUZ,
3839
dateZhCN,
@@ -65,6 +66,7 @@ import {
6566
zhTW
6667
} from '../index'
6768
import { NInput } from '../input/index'
69+
import ugCN from './common/ugCN'
6870
import { createLocale } from './utils/index'
6971

7072
const Wrapper = defineComponent({
@@ -407,5 +409,13 @@ describe('locale', () => {
407409
}
408410
}).html()
409411
).toMatchSnapshot()
412+
expect(
413+
mount(Wrapper, {
414+
props: {
415+
dateLocale: dateUgCN,
416+
locale: ugCN
417+
}
418+
}).html()
419+
).toMatchSnapshot()
410420
})
411421
})

src/locales/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export { default as dateSkSK } from './date/skSK'
5555
export { default as dateSvSE } from './date/svSE'
5656
export { default as dateThTH } from './date/thTH'
5757
export { default as dateTrTR } from './date/trTR'
58+
export { default as dateUgCN } from './date/ugCN'
5859
export { default as dateUkUA } from './date/ukUA'
5960
export { default as dateUzUZ } from './date/uzUZ'
6061
export { default as dateViVN } from './date/viVN'

0 commit comments

Comments
 (0)