Skip to content

Commit

Permalink
feat: add kmKH locale (#6589)
Browse files Browse the repository at this point in the history
Co-authored-by: 07akioni <07akioni2@gmail.com>
  • Loading branch information
firmianaQ and 07akioni authored Jan 4, 2025
1 parent 2992da0 commit 32f893f
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
128 changes: 128 additions & 0 deletions src/locales/common/kmKH.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 9 additions & 0 deletions src/locales/date/kmKH.ts
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions src/locales/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
dateIdID,
dateItIT,
dateJaJP,
dateKmKH,
dateKoKR,
dateNbNO,
dateNlNL,
Expand All @@ -47,6 +48,7 @@ import {
idID,
itIT,
jaJP,
kmKH,
koKR,
nbNO,
nlNL,
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 32f893f

Please sign in to comment.