Skip to content

Commit

Permalink
[l10n] Add Kazakh (kz-KZ) locale (#8451)
Browse files Browse the repository at this point in the history
Co-authored-by: alexandre <alex.fauquette@gmail.com>
  • Loading branch information
zhunus and alexfauquette committed Mar 31, 2023
1 parent 39d105c commit 6fe709b
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/data/date-pickers/localization/data.json
Expand Up @@ -29,7 +29,7 @@
"localeName": "Danish",
"missingKeysCount": 0,
"totalKeysCount": 35,
"githubLink": "https://github.com/mui/mui-x/blob/-/packages/x-date-pickers/src/locales/daDK.ts/"
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/daDK.ts"
},
{
"languageTag": "nl-NL",
Expand Down Expand Up @@ -103,6 +103,14 @@
"totalKeysCount": 35,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/jaJP.ts"
},
{
"languageTag": "kz-KZ",
"importName": "kzKZ",
"localeName": "Kazakh",
"missingKeysCount": 1,
"totalKeysCount": 35,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/kzKZ.ts"
},
{
"languageTag": "ko-KR",
"importName": "koKR",
Expand Down
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/locales/index.ts
Expand Up @@ -15,6 +15,7 @@ export * from './svSE';
export * from './itIT';
export * from './zhCN';
export * from './koKR';
export * from './kzKZ';
export * from './isIS';
export * from './jaJP';
export * from './ukUA';
Expand Down
80 changes: 80 additions & 0 deletions packages/x-date-pickers/src/locales/kzKZ.ts
@@ -0,0 +1,80 @@
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';

// Translation map for Clock Label
const timeViews = {
hours: 'Сағатты',
minutes: 'Минутты',
seconds: 'Секундты',
};

const kzKZPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'Алдыңғы ай',
nextMonth: 'Келесі ай',

// View navigation
openPreviousView: 'Алдыңғы көріністі ашу',
openNextView: 'Келесі көріністі ашу',
calendarViewSwitchingButtonAriaLabel: (view) =>
view === 'year'
? 'жылдық көріністі ашу, күнтізбе көрінісіне ауысу'
: 'күнтізбе көрінісін ашу, жылдық көрінісіне ауысу',

// DateRange placeholders
start: 'Бастау',
end: 'Cоңы',

// Action bar
cancelButtonLabel: 'Бас тарту',
clearButtonLabel: 'Тазарту',
okButtonLabel: 'Ок',
todayButtonLabel: 'Бүгін',

// Toolbar titles
datePickerToolbarTitle: 'Күнді таңдау',
dateTimePickerToolbarTitle: 'Күн мен уақытты таңдау',
timePickerToolbarTitle: 'Уақытты таңдау',
dateRangePickerToolbarTitle: 'Кезеңді таңдаңыз',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view]} таңдау. ${
time === null ? 'Уақыт таңдалмаған' : `Таңдалған уақыт ${adapter.format(time, 'fullTime')}`
}`,
hoursClockNumberText: (hours) => `${hours} сағат`,
minutesClockNumberText: (minutes) => `${minutes} минут`,
secondsClockNumberText: (seconds) => `${seconds} секунд`,

// Calendar labels
calendarWeekNumberHeaderLabel: 'Апта нөмірі',
calendarWeekNumberHeaderText: '№',
calendarWeekNumberAriaLabelText: (weekNumber) => `Апта ${weekNumber}`,
calendarWeekNumberText: (weekNumber) => `${weekNumber}`,

// Open picker labels
openDatePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Күнді таңдаңыз, таңдалған күн ${utils.format(value, 'fullDate')}`
: 'Күнді таңдаңыз',
openTimePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Уақытты таңдаңыз, таңдалған уақыт ${utils.format(value, 'fullTime')}`
: 'Уақытты таңдаңыз',

// Table labels
timeTableLabel: 'уақытты таңдау',
dateTableLabel: 'күнді таңдау',

// Field section placeholders
fieldYearPlaceholder: (params) => 'Ж'.repeat(params.digitAmount),
fieldMonthPlaceholder: (params) => (params.contentType === 'letter' ? 'AAAA' : 'AA'),
fieldDayPlaceholder: () => 'КК',
// fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
fieldHoursPlaceholder: () => 'сс',
fieldMinutesPlaceholder: () => 'мм',
fieldSecondsPlaceholder: () => 'сс',
fieldMeridiemPlaceholder: () => '(т|к)',
};

export const kzKZ = getPickersLocalization(kzKZPickers);
1 change: 1 addition & 0 deletions scripts/x-date-pickers-pro.exports.json
Expand Up @@ -136,6 +136,7 @@
{ "name": "itIT", "kind": "Variable" },
{ "name": "jaJP", "kind": "Variable" },
{ "name": "koKR", "kind": "Variable" },
{ "name": "kzKZ", "kind": "Variable" },
{ "name": "LicenseInfo", "kind": "Class" },
{ "name": "LocalizationProvider", "kind": "Function" },
{ "name": "LocalizationProviderProps", "kind": "Interface" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers.exports.json
Expand Up @@ -102,6 +102,7 @@
{ "name": "itIT", "kind": "Variable" },
{ "name": "jaJP", "kind": "Variable" },
{ "name": "koKR", "kind": "Variable" },
{ "name": "kzKZ", "kind": "Variable" },
{ "name": "LocalizationProvider", "kind": "Function" },
{ "name": "LocalizationProviderProps", "kind": "Interface" },
{ "name": "LocalizedComponent", "kind": "TypeAlias" },
Expand Down

0 comments on commit 6fe709b

Please sign in to comment.