diff --git a/demo/pages/docs/i18n/enUS/index.md b/demo/pages/docs/i18n/enUS/index.md index c3a7407eb56..a299f2a466d 100644 --- a/demo/pages/docs/i18n/enUS/index.md +++ b/demo/pages/docs/i18n/enUS/index.md @@ -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 diff --git a/demo/pages/docs/i18n/zhCN/index.md b/demo/pages/docs/i18n/zhCN/index.md index 23caf4bb83b..da60c6fdc63 100644 --- a/demo/pages/docs/i18n/zhCN/index.md +++ b/demo/pages/docs/i18n/zhCN/index.md @@ -75,6 +75,7 @@ Naive-ui 通过使用 `n-config-provider` 调整语言,默认情况下所有 | 越南语(越南) | viVN | dateViVN | 2.30.7 | | 简体中文 | zhCN | dateZhCN | | | 繁体中文 | zhTW | dateZhTW | | +| 维吾尔语 | ugCN | dateUgCN | | ## 在现有国际化基础上调整 diff --git a/src/locales/__snapshots__/index.spec.tsx.snap b/src/locales/__snapshots__/index.spec.tsx.snap index caf69c9aa97..647673899f0 100644 --- a/src/locales/__snapshots__/index.spec.tsx.snap +++ b/src/locales/__snapshots__/index.spec.tsx.snap @@ -4031,3 +4031,147 @@ exports[`locale works 28`] = ` " `; + +exports[`locale works 29`] = ` +"
+
+
+
+ +
+
كىرگۈزۈڭ
+ +
+ +
+ + +
+
+ +
+
+
+
+
+ +
+ + +
+
+ + + + + + + + + + + +
+
+ + +
+
+ +
+ +
+
+
+
+ +
+ + +
+
+ + + + + + + + + + + +
+
+ + +
+
+ +
+ +
+
+
+
+ +
+ + +
+
+ + + + + + + + + + + +
+
+ + +
+
+ +
+ +
+
+
+
+ +
+ + +
+
+ + + + + + + + + + + +
+
+ + +
+
+ +
+ +
+
+
+
" +`; diff --git a/src/locales/common/ugCN.ts b/src/locales/common/ugCN.ts new file mode 100644 index 00000000000..d8b36d9386e --- /dev/null +++ b/src/locales/common/ugCN.ts @@ -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 diff --git a/src/locales/date/ugCN.ts b/src/locales/date/ugCN.ts new file mode 100644 index 00000000000..513b810cc85 --- /dev/null +++ b/src/locales/date/ugCN.ts @@ -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 diff --git a/src/locales/index.spec.tsx b/src/locales/index.spec.tsx index b95cc044cf0..09aadf48656 100644 --- a/src/locales/index.spec.tsx +++ b/src/locales/index.spec.tsx @@ -33,6 +33,7 @@ import { dateSvSE, dateThTH, dateTrTR, + dateUgCN, dateUkUA, dateUzUZ, dateZhCN, @@ -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({ @@ -407,5 +409,13 @@ describe('locale', () => { } }).html() ).toMatchSnapshot() + expect( + mount(Wrapper, { + props: { + dateLocale: dateUgCN, + locale: ugCN + } + }).html() + ).toMatchSnapshot() }) }) diff --git a/src/locales/index.ts b/src/locales/index.ts index e98af393e15..77947448e63 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -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'