feat: add kmKH locale (#6589)

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
软趴趴 2025-01-04 20:30:35 +08:00 committed by GitHub
parent 2992da0217
commit 32f893ff30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 161 additions and 0 deletions

View File

@ -6,6 +6,10 @@
- (**Vue 3.3+ required**) Add slot type for all components.
### i18n
- Add kmKH locale.
### Features
- `n-modal` adds `draggable` prop, closes [#6525](https://github.com/tusen-ai/naive-ui/issues/6525), [#5792](https://github.com/tusen-ai/naive-ui/issues/5792), [#5711](https://github.com/tusen-ai/naive-ui/issues/5711), [#5501](https://github.com/tusen-ai/naive-ui/issues/5501) and [#2152](https://github.com/tusen-ai/naive-ui/issues/2152).

View File

@ -6,6 +6,10 @@
- (需要 Vue 3.3+)为所有的组件增加插槽的类型标注
### i18n
- 添加 kmKH 国际化
### Features
- `n-modal` 新增 `draggable` 属性,关闭 [#6525](https://github.com/tusen-ai/naive-ui/issues/6525)[#5792](https://github.com/tusen-ai/naive-ui/issues/5792)[#5711](https://github.com/tusen-ai/naive-ui/issues/5711)[#5501](https://github.com/tusen-ai/naive-ui/issues/5501)[#2152](https://github.com/tusen-ai/naive-ui/issues/2152)

128
src/locales/common/kmKH.ts Normal file
View File

@ -0,0 +1,128 @@
import type { NLocale } from './enUS'
const kmKH: NLocale = {
name: 'km-KH',
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 kmKH

9
src/locales/date/kmKH.ts Normal file
View File

@ -0,0 +1,9 @@
import type { NDateLocale } from './enUS'
import { km } from 'date-fns/locale'
const dateKmKH: NDateLocale = {
name: 'km-KH',
locale: km
}
export default dateKmKH

View File

@ -22,6 +22,7 @@ import {
dateIdID,
dateItIT,
dateJaJP,
dateKmKH,
dateKoKR,
dateNbNO,
dateNlNL,
@ -47,6 +48,7 @@ import {
idID,
itIT,
jaJP,
kmKH,
koKR,
nbNO,
nlNL,
@ -207,6 +209,18 @@ describe('locale', () => {
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
dateLocale: dateKmKH,
locale: kmKH,
onMounted: (date: string) => {
expect(date).toMatchSnapshot()
}
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {

View File

@ -13,6 +13,7 @@ export { default as frFR } from './common/frFR'
export { default as idID } from './common/idID'
export { default as itIT } from './common/itIT'
export { default as jaJP } from './common/jaJP'
export { default as kmKH } from './common/kmKH'
export { default as koKR } from './common/koKR'
export { default as nbNO } from './common/nbNO'
export { default as nlNL } from './common/nlNL'
@ -43,6 +44,7 @@ export { default as dateFrFR } from './date/frFR'
export { default as dateIdID } from './date/idID'
export { default as dateItIT } from './date/itIT'
export { default as dateJaJP } from './date/jaJP'
export { default as dateKmKH } from './date/kmKH'
export { default as dateKoKR } from './date/koKR'
export { default as dateNbNO } from './date/nbNO'
export { default as dateNlNL } from './date/nlNL'