Skip to content

Commit

Permalink
feat: add uyghur (ug-CN) locale (#6670)
Browse files Browse the repository at this point in the history
  • Loading branch information
alphapc authored Jan 4, 2025
1 parent 32f893f commit 1e116fc
Show file tree
Hide file tree
Showing 7 changed files with 294 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/pages/docs/i18n/enUS/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The following list is sorted by 'Config' column.
| Vietnamese (Vietnam) | viVN | dateViVN | 2.30.7 |
| Chinese (Simplified) | zhCN | dateZhCN | |
| Chinese (Traditional) | zhTW | dateZhTW | |
| Uyghur(China) | ugCN | dateUgCN | |

## Customize the existing locale

Expand Down
1 change: 1 addition & 0 deletions demo/pages/docs/i18n/zhCN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Naive-ui 通过使用 `n-config-provider` 调整语言,默认情况下所有
| 越南语(越南) | viVN | dateViVN | 2.30.7 |
| 简体中文 | zhCN | dateZhCN | |
| 繁体中文 | zhTW | dateZhTW | |
| 维吾尔语 | ugCN | dateUgCN | |

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

Expand Down
144 changes: 144 additions & 0 deletions src/locales/__snapshots__/index.spec.tsx.snap

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions src/locales/common/ugCN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import type { NLocale } from './enUS'

const ugCN: NLocale = {
name: 'ug-CN',
global: {
undo: 'قالدۇرۇش',
redo: 'قايتا',
confirm: 'جەزملەش',
clear: 'تازلاش'
},
Popconfirm: {
positiveText: 'جەزملەش',
negativeText: 'بىكار قىلىش'
},
Cascader: {
placeholder: 'تاللاڭ',
loading: 'يۈكلەۋاتىدۇ',
loadingRequiredMessage: (label: string): string =>
`جەمئى ${label} تۈگۈننى يۈكلەپ بولغاندىن كېيىن تاللىغىلى بولىدۇ`
},
Time: {
dateFormat: 'yyyy-MM-dd',
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss'
},
DatePicker: {
yearFormat: 'yyyy-يىل',
monthFormat: 'MMM',
dayFormat: 'eeeeee',
yearTypeFormat: 'yyyy',
monthTypeFormat: 'yyyy-MM',
dateFormat: 'yyyy-MM-dd',
dateTimeFormat: 'yyyy-MM-dd HH:mm:ss',
quarterFormat: 'yyyy-qqq',
weekFormat: 'YYYY-wھەپتە',
clear: 'تازلاش',
now: 'مۇشۇ ۋاقىت',
confirm: 'جەزملەش',
selectTime: 'ۋاقىت تاللاڭ',
selectDate: 'چىسلا تاللاڭ',
datePlaceholder: 'چىسلا تاللاڭ',
datetimePlaceholder: 'چىسلا ۋاقىت تاللاڭ',
monthPlaceholder: 'ئاي تاللاڭ',
yearPlaceholder: 'يىل تاللاڭ',
quarterPlaceholder: 'پەسىل تاللاڭ',
weekPlaceholder: 'ھەپتە تاللاڭ',
startDatePlaceholder: 'باشلىنىش ۋاقتى',
endDatePlaceholder: 'ئاخىرلىشىش ۋاقتى',
startDatetimePlaceholder: 'باشلىندىغان چىسلا ۋاقىت',
endDatetimePlaceholder: 'ئاخىرلىشىدىغان چىسلا ۋاقىت',
startMonthPlaceholder: 'باشلىندىغان ئاي',
endMonthPlaceholder: 'ئاخىرلىشىدىغان ئاي',
monthBeforeYear: false,
firstDayOfWeek: 0,
today: 'بۈگۈن'
},
DataTable: {
checkTableAll: 'ھەممە ئۇچۇرنى تاللاش',
uncheckTableAll: 'تاللاشنى بىكار قىلىش',
confirm: 'جەزملەش',
clear: 'تازلاش'
},
LegacyTransfer: {
sourceTitle: 'ئەسلى تۈر',
targetTitle: 'نىشان تۈر'
},
Transfer: {
selectAll: 'ھەممىنى تاللاش',
clearAll: 'تازلاش',
unselectAll: 'ھەممىنى بىكار قىلىش',
total: (num: number): string => `جەمئى ${num} تۈر`,
selected: (num: number): string => `${num} تۈر تاللاندى`
},
Empty: {
description: 'ئۇچۇر يوق'
},
Select: {
placeholder: 'تاللاڭ'
},
TimePicker: {
placeholder: 'ۋاقىت تاللاڭ',
positiveText: 'جەزملەش',
negativeText: 'بىكار قىلىش',
now: 'مۇشۇ ۋاقىت',
clear: 'تازلاش'
},
Pagination: {
goto: 'ئاتلاش',
selectionSuffix: 'بەت'
},
DynamicTags: {
add: 'قوشۇش'
},
Log: {
loading: 'يۈكلەۋاتىدۇ'
},
Input: {
placeholder: 'كىرگۈزۈڭ'
},
InputNumber: {
placeholder: 'كىرگۈزۈڭ'
},
DynamicInput: {
create: 'قوشۇش'
},
ThemeEditor: {
title: 'ئۇسلوب تەھرىرلىگۈچ',
clearAllVars: 'ھەممە پارامىتىرنى تازلاش',
clearSearch: 'ئىزدەشنى تازلاش',
filterCompName: 'ۋىجىت ئىسمىنى فىلتىرلاش',
filterVarName: 'پارامىتېرنى فىلتىرلاش',
import: 'ئەكىرىش',
export: 'چىقىرىش',
restore: 'ئەسلىگە قايتۇرۇش'
},
Image: {
tipPrevious: '(←)ئالدىنقىسى',
tipNext: 'كېيىنكىسى(→)',
tipCounterclockwise: 'سولغا چۆرۈش',
tipClockwise: 'ئوڭغا چۆرۈش',
tipZoomOut: 'كىچىكلىتىش',
tipZoomIn: 'چوڭايتىش',
tipDownload: 'چۈشۈرۈش',
tipClose: 'تاقاش(Esc)',
tipOriginalSize: 'ئەسلىگە قايتۇرۇش'
}
}

export default ugCN
9 changes: 9 additions & 0 deletions src/locales/date/ugCN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { NDateLocale } from './enUS'
import { ug } from 'date-fns/locale'

const dateUgCN: NDateLocale = {
name: 'ug-CN',
locale: ug
}

export default dateUgCN
10 changes: 10 additions & 0 deletions src/locales/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
dateSvSE,
dateThTH,
dateTrTR,
dateUgCN,
dateUkUA,
dateUzUZ,
dateZhCN,
Expand Down Expand Up @@ -65,6 +66,7 @@ import {
zhTW
} from '../index'
import { NInput } from '../input/index'
import ugCN from './common/ugCN'
import { createLocale } from './utils/index'

const Wrapper = defineComponent({
Expand Down Expand Up @@ -407,5 +409,13 @@ describe('locale', () => {
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
dateLocale: dateUgCN,
locale: ugCN
}
}).html()
).toMatchSnapshot()
})
})
1 change: 1 addition & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export { default as dateSkSK } from './date/skSK'
export { default as dateSvSE } from './date/svSE'
export { default as dateThTH } from './date/thTH'
export { default as dateTrTR } from './date/trTR'
export { default as dateUgCN } from './date/ugCN'
export { default as dateUkUA } from './date/ukUA'
export { default as dateUzUZ } from './date/uzUZ'
export { default as dateViVN } from './date/viVN'
Expand Down

0 comments on commit 1e116fc

Please sign in to comment.