From 9300269eac86e44b59a0cc3a860a9cba79b91c24 Mon Sep 17 00:00:00 2001 From: Robin Luley Date: Thu, 30 Jun 2022 11:06:58 +0200 Subject: [PATCH 1/2] [l10n] Add Arabic Saudi Arabia (ar-SA) locale --- .../guides/localization/localization-pt.md | 1 + .../guides/localization/localization-zh.md | 1 + .../guides/localization/localization.md | 1 + packages/mui-material/src/locale/index.ts | 71 +++++++++++++++++++ 4 files changed, 74 insertions(+) diff --git a/docs/data/material/guides/localization/localization-pt.md b/docs/data/material/guides/localization/localization-pt.md index c214748aeb61a8..b08bbe29e21ff5 100644 --- a/docs/data/material/guides/localization/localization-pt.md +++ b/docs/data/material/guides/localization/localization-pt.md @@ -38,6 +38,7 @@ const theme = createTheme( |:----------------------- |:------------------------- |:------------------ | | Amharic | am-ET | `amET` | | Arabic (Egypt) | ar-EG | `arEG` | +| Arabic (Saudi Arabia) | ar-SA | `arSA` | | Arabic (Sudan) | ar-SD | `arSD` | | Armênio | hy-AM | `hyAM` | | Azerbaijano | az-AZ | `azAZ` | diff --git a/docs/data/material/guides/localization/localization-zh.md b/docs/data/material/guides/localization/localization-zh.md index f025893ec40193..e529be881fab1f 100644 --- a/docs/data/material/guides/localization/localization-zh.md +++ b/docs/data/material/guides/localization/localization-zh.md @@ -38,6 +38,7 @@ const theme = createTheme( |:----------------------- |:----------- |:------ | | Amharic | am-ET | `amET` | | Arabic (Egypt) | ar-EG | `arEG` | +| Arabic (Saudi Arabia) | ar-SA | `arSA` | | Arabic (Sudan) | ar-SD | `arSD` | | 亚美尼亚语 | hy-AM | `hyAM` | | 阿塞拜疆语 | az-AZ | `azAZ` | diff --git a/docs/data/material/guides/localization/localization.md b/docs/data/material/guides/localization/localization.md index e7377f7527b690..8dfca3ee5e3cd5 100644 --- a/docs/data/material/guides/localization/localization.md +++ b/docs/data/material/guides/localization/localization.md @@ -40,6 +40,7 @@ const theme = createTheme( | :---------------------- | :------------------ | :---------- | | Amharic | am-ET | `amET` | | Arabic (Egypt) | ar-EG | `arEG` | +| Arabic (Saudi Arabia) | ar-SA | `arSA` | | Arabic (Sudan) | ar-SD | `arSD` | | Armenian | hy-AM | `hyAM` | | Azerbaijani | az-AZ | `azAZ` | diff --git a/packages/mui-material/src/locale/index.ts b/packages/mui-material/src/locale/index.ts index 055c37ec1ae01b..e84a9e27b41b7a 100644 --- a/packages/mui-material/src/locale/index.ts +++ b/packages/mui-material/src/locale/index.ts @@ -170,6 +170,77 @@ export const arEG: Localization = { }, }; +export const arSA: Localization = { + components: { + MuiBreadcrumbs: { + defaultProps: { + expandText: 'إظهار المسار', + }, + }, + MuiTablePagination: { + defaultProps: { + getItemAriaLabel: (type) => { + if (type === 'first') { + return 'الانتقال إلى الصفحة الأولى'; + } + if (type === 'last') { + return 'الانتقال إلى الصفحة الأخيرة'; + } + if (type === 'next') { + return 'الانتقال إلى الصفحة التالية'; + } + // if (type === 'previous') { + return 'الانتقال إلى الصفحة السابقة'; + }, + labelRowsPerPage: 'عدد الصفوف في الصفحة:', + labelDisplayedRows: ({ from, to, count }) => + `${from}–${to} من ${count !== -1 ? count : ` أكثر من${to}`}`, + }, + }, + MuiRating: { + defaultProps: { + getLabelText: (value) => `${value} ${value !== 1 ? 'نجوم' : 'نجمة'}`, + emptyLabelText: 'فارغ', + }, + }, + MuiAutocomplete: { + defaultProps: { + clearText: 'مسح', + closeText: 'إغلاق', + loadingText: 'جار التحميل...', + noOptionsText: 'لا توجد خيارات', + openText: 'فتح', + }, + }, + MuiAlert: { + defaultProps: { + closeText: 'إغلاق', + }, + }, + MuiPagination: { + defaultProps: { + 'aria-label': 'التنقل عبر الصفحات', + getItemAriaLabel: (type, page, selected) => { + if (type === 'page') { + return `${selected ? '' : 'الانتقال إلى '} صفحة ${page}`; + } + if (type === 'first') { + return 'الانتقال إلى الصفحة الأولى'; + } + if (type === 'last') { + return 'الانتقال الي الصفحة الأخيرة'; + } + if (type === 'next') { + return 'الانتقال إلى الصفحة التالية'; + } + // if (type === 'previous') { + return 'الانتقال إلى الصفحة السابقة'; + }, + }, + }, + }, +}; + export const arSD: Localization = { components: { MuiBreadcrumbs: { From 12ba0655a70338c0526732b5d658db9df3fc727e Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Mon, 3 Oct 2022 11:51:25 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Signed-off-by: Marija Najdova --- docs/data/material/guides/localization/localization-pt.md | 1 - docs/data/material/guides/localization/localization-zh.md | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/data/material/guides/localization/localization-pt.md b/docs/data/material/guides/localization/localization-pt.md index b08bbe29e21ff5..c214748aeb61a8 100644 --- a/docs/data/material/guides/localization/localization-pt.md +++ b/docs/data/material/guides/localization/localization-pt.md @@ -38,7 +38,6 @@ const theme = createTheme( |:----------------------- |:------------------------- |:------------------ | | Amharic | am-ET | `amET` | | Arabic (Egypt) | ar-EG | `arEG` | -| Arabic (Saudi Arabia) | ar-SA | `arSA` | | Arabic (Sudan) | ar-SD | `arSD` | | Armênio | hy-AM | `hyAM` | | Azerbaijano | az-AZ | `azAZ` | diff --git a/docs/data/material/guides/localization/localization-zh.md b/docs/data/material/guides/localization/localization-zh.md index e529be881fab1f..f025893ec40193 100644 --- a/docs/data/material/guides/localization/localization-zh.md +++ b/docs/data/material/guides/localization/localization-zh.md @@ -38,7 +38,6 @@ const theme = createTheme( |:----------------------- |:----------- |:------ | | Amharic | am-ET | `amET` | | Arabic (Egypt) | ar-EG | `arEG` | -| Arabic (Saudi Arabia) | ar-SA | `arSA` | | Arabic (Sudan) | ar-SD | `arSD` | | 亚美尼亚语 | hy-AM | `hyAM` | | 阿塞拜疆语 | az-AZ | `azAZ` |