Skip to content

Commit

Permalink
[pickers] Add Urdu (ur-PK) locale (mui#7007)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored and LukasTy committed Jan 9, 2023
1 parent 754632c commit f2ed21a
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 20 deletions.
8 changes: 8 additions & 0 deletions docs/data/date-pickers/localization/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,13 @@
"missingKeysCount": 0,
"totalKeysCount": 24,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/ukUA.ts/"
},
{
"languageTag": "ur-PK",
"importName": "urPK",
"localeName": "Urdu (Pakistan)",
"missingKeysCount": 0,
"totalKeysCount": 24,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/urPK.ts/"
}
]
6 changes: 0 additions & 6 deletions packages/grid/x-data-grid/src/locales/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ const csCZGrid: Partial<GridLocaleText> = {
toolbarFiltersTooltipShow: 'Zobrazit filtry',
toolbarFiltersTooltipActive: (count) => {
let pluralForm = 'aktivních filtrů';

if (count > 1 && count < 5) {
pluralForm = 'aktivní filtry';
} else if (count === 1) {
pluralForm = 'aktivní filtr';
}

return `${count} ${pluralForm}`;
},

Expand Down Expand Up @@ -100,13 +98,11 @@ const csCZGrid: Partial<GridLocaleText> = {
// Column header text
columnHeaderFiltersTooltipActive: (count) => {
let pluralForm = 'aktivních filtrů';

if (count > 1 && count < 5) {
pluralForm = 'aktivní filtry';
} else if (count === 1) {
pluralForm = 'aktivní filtr';
}

return `${count} ${pluralForm}`;
},
columnHeaderFiltersLabel: 'Zobrazit filtry',
Expand All @@ -115,13 +111,11 @@ const csCZGrid: Partial<GridLocaleText> = {
// Rows selected footer text
footerRowSelected: (count) => {
let pluralForm = 'vybraných záznamů';

if (count > 1 && count < 5) {
pluralForm = 'vybrané záznamy';
} else if (count === 1) {
pluralForm = 'vybraný záznam';
}

return `${count} ${pluralForm}`;
},

Expand Down
6 changes: 0 additions & 6 deletions packages/grid/x-data-grid/src/locales/ruRU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ const ruRUGrid: Partial<GridLocaleText> = {
toolbarFiltersTooltipActive: (count) => {
let pluralForm = 'активных фильтров';
const lastDigit = count % 10;

if (lastDigit > 1 && lastDigit < 5) {
pluralForm = 'активных фильтра';
} else if (lastDigit === 1) {
pluralForm = 'активный фильтр';
}

return `${count} ${pluralForm}`;
},

Expand Down Expand Up @@ -102,13 +100,11 @@ const ruRUGrid: Partial<GridLocaleText> = {
columnHeaderFiltersTooltipActive: (count) => {
let pluralForm = 'активных фильтров';
const lastDigit = count % 10;

if (lastDigit > 1 && lastDigit < 5) {
pluralForm = 'активных фильтра';
} else if (lastDigit === 1) {
pluralForm = 'активный фильтр';
}

return `${count} ${pluralForm}`;
},
columnHeaderFiltersLabel: 'Показать фильтры',
Expand All @@ -118,13 +114,11 @@ const ruRUGrid: Partial<GridLocaleText> = {
footerRowSelected: (count) => {
let pluralForm = 'строк выбрано';
const lastDigit = count % 10;

if (lastDigit > 1 && lastDigit < 5) {
pluralForm = 'строки выбраны';
} else if (lastDigit === 1) {
pluralForm = 'строка выбрана';
}

return `${count} ${pluralForm}`;
},

Expand Down
6 changes: 0 additions & 6 deletions packages/grid/x-data-grid/src/locales/skSK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ const skSKGrid: Partial<GridLocaleText> = {
toolbarFiltersTooltipShow: 'Zobraziť filtre',
toolbarFiltersTooltipActive: (count) => {
let pluralForm = 'aktívnych filtrov';

if (count > 1 && count < 5) {
pluralForm = 'aktívne filtre';
} else if (count === 1) {
pluralForm = 'aktívny filter';
}

return `${count} ${pluralForm}`;
},

Expand Down Expand Up @@ -100,13 +98,11 @@ const skSKGrid: Partial<GridLocaleText> = {
// Column header text
columnHeaderFiltersTooltipActive: (count) => {
let pluralForm = 'aktívnych filtrov';

if (count > 1 && count < 5) {
pluralForm = 'aktívne filtre';
} else if (count === 1) {
pluralForm = 'aktívny filter';
}

return `${count} ${pluralForm}`;
},
columnHeaderFiltersLabel: 'Zobraziť filtre',
Expand All @@ -115,13 +111,11 @@ const skSKGrid: Partial<GridLocaleText> = {
// Rows selected footer text
footerRowSelected: (count) => {
let pluralForm = 'vybraných záznamov';

if (count > 1 && count < 5) {
pluralForm = 'vybrané záznamy';
} else if (count === 1) {
pluralForm = 'vybraný záznam';
}

return `${count} ${pluralForm}`;
},

Expand Down
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export * from './koKR';
export * from './isIS';
export * from './jaJP';
export * from './ukUA';
export * from './urPK';
export * from './utils/pickersLocaleTextApi';
2 changes: 0 additions & 2 deletions packages/x-date-pickers/src/locales/ukUA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';
import { CalendarPickerView } from '../internals/models';

// This object is not Partial<PickersLocaleText> because it is the default values

const ukUAPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'Попередній місяць',
Expand Down
62 changes: 62 additions & 0 deletions packages/x-date-pickers/src/locales/urPK.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';
import { CalendarPickerView } from '../internals/models';

const urPKPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'پچھلا مہینہ',
nextMonth: 'اگلا مہینہ',

// View navigation
openPreviousView: 'پچھلا ویو کھولیں',
openNextView: 'اگلا ویو کھولیں',
calendarViewSwitchingButtonAriaLabel: (view: CalendarPickerView) =>
view === 'year'
? 'سال والا ویو کھلا ہے۔ کیلنڈر والا ویو کھولیں'
: 'کیلنڈر والا ویو کھلا ہے۔ سال والا ویو کھولیں',
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) =>
isKeyboardInputOpen
? `،ٹیکسٹ ویو کھلا ہے ${viewType} ویو کھولیں`
: `${viewType} ویو کھلا ہے، ٹیکسٹ ویو کھولیں`,

// DateRange placeholders
start: 'شروع',
end: 'ختم',

// Action bar
cancelButtonLabel: 'کینسل',
clearButtonLabel: 'کلئیر',
okButtonLabel: 'اوکے',
todayButtonLabel: 'آج',

// Toolbar titles
datePickerDefaultToolbarTitle: 'تاریخ منتخب کریں',
dateTimePickerDefaultToolbarTitle: 'تاریخ اور وقت منتخب کریں',
timePickerDefaultToolbarTitle: 'وقت منتخب کریں',
dateRangePickerDefaultToolbarTitle: 'تاریخوں کی رینج منتخب کریں',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${view} منتخب کریں ${
time === null ? 'کوئی وقت منتخب نہیں' : `منتخب وقت ہے ${adapter.format(time, 'fullTime')}`
}`,
hoursClockNumberText: (hours) => `${hours} گھنٹے`,
minutesClockNumberText: (minutes) => `${minutes} منٹ`,
secondsClockNumberText: (seconds) => `${seconds} سیکنڈ`,

// 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: 'تاریخ منتخب کریں',
};

export const urPK = getPickersLocalization(urPKPickers);
1 change: 1 addition & 0 deletions scripts/x-date-pickers-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
{ "name": "TimePickerToolbarProps", "kind": "Interface" },
{ "name": "trTR", "kind": "Variable" },
{ "name": "ukUA", "kind": "Variable" },
{ "name": "urPK", "kind": "Variable" },
{ "name": "YearPicker", "kind": "Variable" },
{ "name": "yearPickerClasses", "kind": "Variable" },
{ "name": "YearPickerClasses", "kind": "Interface" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
{ "name": "TimePickerToolbarProps", "kind": "Interface" },
{ "name": "trTR", "kind": "Variable" },
{ "name": "ukUA", "kind": "Variable" },
{ "name": "urPK", "kind": "Variable" },
{ "name": "YearPicker", "kind": "Variable" },
{ "name": "yearPickerClasses", "kind": "Variable" },
{ "name": "YearPickerClasses", "kind": "Interface" },
Expand Down

0 comments on commit f2ed21a

Please sign in to comment.