diff --git a/docs/data/date-pickers/localization/localization.md b/docs/data/date-pickers/localization/localization.md index eba03a7f0b1d..b539afc4ed05 100644 --- a/docs/data/date-pickers/localization/localization.md +++ b/docs/data/date-pickers/localization/localization.md @@ -148,6 +148,7 @@ If you want to customize some translations on specific component, you can use th | Turkish | tr-TR | `trTr` | | Dutch | nl-NL | `nlNL` | | Ukrainian | uk-UA | `ukUA` | +| Urdu (Pakistan) | ur-PK | `urPK` | You can [find the source](https://github.com/mui/mui-x/tree/HEAD/packages/x-date-pickers/src/locales) in the GitHub repository. diff --git a/packages/x-date-pickers/src/locales/index.ts b/packages/x-date-pickers/src/locales/index.ts index 3654eb80fc17..c02e7f7f3ec7 100644 --- a/packages/x-date-pickers/src/locales/index.ts +++ b/packages/x-date-pickers/src/locales/index.ts @@ -16,4 +16,5 @@ export * from './koKR'; export * from './isIS'; export * from './jaJP'; export * from './ukUA'; +export * from './urPK'; export * from './utils/pickersLocaleTextApi'; diff --git a/packages/x-date-pickers/src/locales/ukUA.ts b/packages/x-date-pickers/src/locales/ukUA.ts index 93de432ccac2..ec5eda209b35 100644 --- a/packages/x-date-pickers/src/locales/ukUA.ts +++ b/packages/x-date-pickers/src/locales/ukUA.ts @@ -2,8 +2,6 @@ import { PickersLocaleText } from './utils/pickersLocaleTextApi'; import { getPickersLocalization } from './utils/getPickersLocalization'; import { DateView } from '../internals/models'; -// This object is not Partial because it is the default values - const ukUAPickers: Partial> = { // Calendar navigation previousMonth: 'Попередній місяць', diff --git a/packages/x-date-pickers/src/locales/urPK.ts b/packages/x-date-pickers/src/locales/urPK.ts new file mode 100644 index 000000000000..ba1a95353d2b --- /dev/null +++ b/packages/x-date-pickers/src/locales/urPK.ts @@ -0,0 +1,77 @@ +import { PickersLocaleText } from './utils/pickersLocaleTextApi'; +import { getPickersLocalization } from './utils/getPickersLocalization'; +import { DateView } from '../internals/models'; + +const urPKPickers: Partial> = { + // Calendar navigation + previousMonth: 'پچھلا مہینہ', + nextMonth: 'اگلا مہینہ', + + // View navigation + openPreviousView: 'پچھلا ویو کھولیں', + openNextView: 'اگلا ویو کھولیں', + calendarViewSwitchingButtonAriaLabel: (view: DateView) => + view === 'year' + ? 'سال والا ویو کھلا ہے۔ کیلنڈر والا ویو کھولیں' + : 'کیلنڈر والا ویو کھلا ہے۔ سال والا ویو کھولیں', + inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) => + isKeyboardInputOpen + ? `،ٹیکسٹ ویو کھلا ہے ${viewType} ویو کھولیں` + : `${viewType} ویو کھلا ہے، ٹیکسٹ ویو کھولیں`, + + // DateRange placeholders + start: 'شروع', + end: 'ختم', + + // Action bar + cancelButtonLabel: 'کینسل', + clearButtonLabel: 'کلئیر', + okButtonLabel: 'اوکے', + todayButtonLabel: 'آج', + + // Toolbar titles + datePickerToolbarTitle: 'تاریخ منتخب کریں', + dateTimePickerToolbarTitle: 'تاریخ اور وقت منتخب کریں', + timePickerToolbarTitle: 'وقت منتخب کریں', + dateRangePickerToolbarTitle: 'تاریخوں کی رینج منتخب کریں', + + // Clock labels + clockLabelText: (view, time, adapter) => + `${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 => 'Y'.repeat(params.digitAmount), + // fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM', + // fieldDayPlaceholder: () => 'DD', + // fieldHoursPlaceholder: () => 'hh', + // fieldMinutesPlaceholder: () => 'mm', + // fieldSecondsPlaceholder: () => 'ss', + // fieldMeridiemPlaceholder: () => 'aa', +}; + +export const urPK = getPickersLocalization(urPKPickers); diff --git a/scripts/x-date-pickers-pro.exports.json b/scripts/x-date-pickers-pro.exports.json index 9e1630348d58..4bdf9053237f 100644 --- a/scripts/x-date-pickers-pro.exports.json +++ b/scripts/x-date-pickers-pro.exports.json @@ -282,6 +282,7 @@ { "name": "unstable_useMultiInputTimeRangeField", "kind": "Variable" }, { "name": "unstable_useSingleInputDateRangeField", "kind": "Variable" }, { "name": "unstable_useTimeField", "kind": "Variable" }, + { "name": "urPK", "kind": "Variable" }, { "name": "UseDateFieldComponentProps", "kind": "TypeAlias" }, { "name": "UseDateFieldProps", "kind": "Interface" }, { "name": "UseDateTimeFieldComponentProps", "kind": "TypeAlias" }, diff --git a/scripts/x-date-pickers.exports.json b/scripts/x-date-pickers.exports.json index 6320cd9a46ee..e6790b3865de 100644 --- a/scripts/x-date-pickers.exports.json +++ b/scripts/x-date-pickers.exports.json @@ -213,6 +213,7 @@ { "name": "unstable_useDateField", "kind": "Variable" }, { "name": "unstable_useDateTimeField", "kind": "Variable" }, { "name": "unstable_useTimeField", "kind": "Variable" }, + { "name": "urPK", "kind": "Variable" }, { "name": "UseDateFieldComponentProps", "kind": "TypeAlias" }, { "name": "UseDateFieldProps", "kind": "Interface" }, { "name": "UseDateTimeFieldComponentProps", "kind": "TypeAlias" },