Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add kmKH locale #6589

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### i18n

- Add kmKH locale.

## 2.40.3

`2024-12-02`
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### i18n

- 添加 kmKH 国际化

## 2.40.3

`2024-12-02`
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
Loading