-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[l10n] Add Arabic (ar) locale #15693
base: master
Are you sure you want to change the base?
Changes from 3 commits
f214c6e
23343dd
37ada8e
7415f73
f2bf8b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,100 @@ | ||||||
import { PickersLocaleText } from './utils/pickersLocaleTextApi'; | ||||||
import { getPickersLocalization } from './utils/getPickersLocalization'; | ||||||
import { TimeViewWithMeridiem } from '../internals/models'; | ||||||
|
||||||
//maps TimeView to its translation | ||||||
const views: Record<TimeViewWithMeridiem, string> = { | ||||||
hours: 'ساعات', | ||||||
minutes: 'دقائق', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
seconds: 'ثواني', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
meridiem: 'ميريديم', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}; | ||||||
|
||||||
const arPickers: Partial<PickersLocaleText> = { | ||||||
//Calender navigation | ||||||
previousMonth: 'الشهر السابق', | ||||||
nextMonth: 'الشهر المقبل', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's more common to the ear to hear السابق/التالي.
Suggested change
|
||||||
|
||||||
//View navigation | ||||||
openPreviousView: 'افتح العرض السابق', | ||||||
openNextView: 'افتح العرض التالي', | ||||||
calendarViewSwitchingButtonAriaLabel: (view) => | ||||||
view === 'year' | ||||||
? 'عرض السنة مفتوح، قم بالتبديل إلى عرض التقويم' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "year view" actually shows years, not a year, so it's better to name it in the plural form: عرض السنوات
Suggested change
|
||||||
: 'عرض التقويم مفتوح، قم بالتبديل إلى عرض السنة', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
//DateRange labels | ||||||
start: 'يبدأ', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as this is very generic, we can use the more generic from...to form instead
Suggested change
|
||||||
end: 'نهاية', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
startDate: 'تاريخ البدء', | ||||||
startTime: 'وقت البدء', | ||||||
endDate: 'تاريخ الانتهاء', | ||||||
endTime: 'وقت الانتهاء', | ||||||
|
||||||
//Action bar | ||||||
cancelButtonLabel: 'يلغي', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is in imperative form
Suggested change
|
||||||
clearButtonLabel: 'واضح', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not "clear" as "I hear your voice clearly", but clear as in "remove the current selected thing"
Suggested change
|
||||||
okButtonLabel: 'نعم', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot say "Yes" for "ok", because it's usually used in Yes/No confirmations.
Suggested change
|
||||||
todayButtonLabel: 'اليوم', | ||||||
|
||||||
//Toolbar titles | ||||||
datePickerToolbarTitle: 'اختر التاريخ', | ||||||
dateTimePickerToolbarTitle: 'حدد التاريخ والوقت', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we better stay consistent
Suggested change
|
||||||
timePickerToolbarTitle: 'حدد الوقت', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
dateRangePickerToolbarTitle: 'حدد النطاق الزمني', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't need the "range" naming here, we can pluralize "date"
Suggested change
|
||||||
|
||||||
//Clock labels | ||||||
clockLabelText: (view, formattedTime) => | ||||||
`يختار ${views[view]}. ${ | ||||||
!formattedTime ? 'لم يتم تحديد الوقت' : `الوقت المختار هو ${formattedTime}` | ||||||
}`, | ||||||
hoursClockNumberText: (hours) => `${hours} ساعات`, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the aria-labels of the selections in the date selection dropdown.
Suggested change
|
||||||
minutesClockNumberText: (minutes) => `${minutes} دقائق`, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
secondsClockNumberText: (seconds) => `${seconds} ثواني`, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// Digital clock labels | ||||||
selectViewText: (view) => `يختار ${views[view]}`, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is as above, we better use imperative form
Suggested change
|
||||||
|
||||||
// Calendar labels | ||||||
calendarWeekNumberHeaderLabel: 'رقم الاسبوع', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo
Suggested change
|
||||||
calendarWeekNumberHeaderText: '#', | ||||||
calendarWeekNumberAriaLabelText: (weekNumber) => `أسبوع ${weekNumber}`, | ||||||
calendarWeekNumberText: (weekNumber) => `${weekNumber}`, | ||||||
|
||||||
// Open picker labels | ||||||
openDatePickerDialogue: (formattedDate) => | ||||||
formattedDate ? `اختر التاريخ، التاريخ المحدد هو ${formattedDate}` : 'اختر التاريخ', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above
Suggested change
|
||||||
openTimePickerDialogue: (formattedTime) => | ||||||
formattedTime ? `اختر الوقت، الوقت المحدد هو ${formattedTime}` : 'اختر الوقت', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above
Suggested change
|
||||||
|
||||||
fieldClearLabel: 'واضح', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above
Suggested change
|
||||||
|
||||||
// Table labels | ||||||
timeTableLabel: 'اختيار الوقت', | ||||||
dateTableLabel: 'تاريخ الاختيار', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not "the date of selection", it's "please choose a date"
Suggested change
|
||||||
|
||||||
// Field section placeholders | ||||||
fieldYearPlaceholder: (params) => 'س'.repeat(params.digitAmount), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we don't need to use repetition here, as it's much less common in Arabic.
Suggested change
|
||||||
fieldMonthPlaceholder: (params) => (params.contentType === 'letter' ? 'MMMM' : 'MM'), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldDayPlaceholder: () => 'اليوم', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldWeekDayPlaceholder: (params) => (params.contentType === 'letter' ? 'EEEE' : 'EE'), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldHoursPlaceholder: () => 'hh', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldMinutesPlaceholder: () => 'mm', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldSecondsPlaceholder: () => 'ss', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fieldMeridiemPlaceholder: () => 'aa', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// View names | ||||||
year: 'سنة', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above, it's better to use the plural form
Suggested change
|
||||||
month: 'شهر', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
day: 'يوم', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
weekDay: 'أيام الأسبوع', | ||||||
hours: 'ساعات', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
minutes: 'دقائق', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
seconds: 'ثواني', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
meridiem: 'ميريديم', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this makes no sense in Arabic, we better use something like "pm/am"
Suggested change
|
||||||
|
||||||
// Common | ||||||
empty: 'فارغ', | ||||||
}; | ||||||
|
||||||
export const ar = getPickersLocalization(arPickers); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,5 @@ export * from './urPK'; | |
export * from './viVN'; | ||
export * from './zhCN'; | ||
export * from './zhHK'; | ||
export * from './ar'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on other languages, it is recommended to specify the country of the language, such as arMR or arEG There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ET-TOUNANI As arabic is spoken in many countries they have many dialects just like eu. So i have taken that consideration and named it. Kindly suggest! |
||
export * from './utils/pickersLocaleTextApi'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are used below, and instruct the user to choose the unit.
it's better to have them singular instead (ex. "اختر الساعة")