Skip to content

Commit c9ca979

Browse files
[material-ui][locale] Split locales into separate files (#46933)
Signed-off-by: Lukas Tyla <[email protected]> Co-authored-by: Lukas Tyla <[email protected]>
1 parent d06e89c commit c9ca979

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+4386
-4262
lines changed

eslint.config.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ export default defineConfig(
248248
},
249249
// Migrated config from packages/api-docs-builder/.eslintrc.js
250250
{
251-
files: ['packages/api-docs-builder/**/*'],
251+
files: [
252+
'packages/api-docs-builder/**/*',
253+
// Allow named exports for locales: https://github.com/mui/material-ui/pull/46933
254+
'packages/mui-material/src/locale/*',
255+
],
252256
rules: {
253257
'import/prefer-default-export': 'off',
254258
},
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { Localization } from './utils/LocaleTextApi';
2+
3+
export const amET: Localization = {
4+
components: {
5+
MuiBreadcrumbs: {
6+
defaultProps: {
7+
expandText: 'መንገድ አሳይ',
8+
},
9+
},
10+
MuiTablePagination: {
11+
defaultProps: {
12+
getItemAriaLabel: (type) => {
13+
if (type === 'first') {
14+
return 'ወደ መጀመሪያው ገጽ ይሂዱ';
15+
}
16+
if (type === 'last') {
17+
return 'ወደ መጨረሻው ገጽ ይሂዱ';
18+
}
19+
if (type === 'next') {
20+
return 'ወደ ቀጣዩ ገጽ ይሂዱ';
21+
}
22+
// if (type === 'previous') {
23+
return 'ወደ ቀዳሚው ገጽ ይሂዱ';
24+
},
25+
labelRowsPerPage: 'ረድፎች በአንድ ገጽ:',
26+
labelDisplayedRows: ({ from, to, count }) =>
27+
`${from}-${to}${count !== -1 ? count : `${to} በላይ`}`,
28+
},
29+
},
30+
MuiRating: {
31+
defaultProps: {
32+
getLabelText: (value) => `${value} ኮከ${value !== 1 ? 'ቦች' : 'ብ'}`,
33+
emptyLabelText: 'ባዶ',
34+
},
35+
},
36+
MuiAutocomplete: {
37+
defaultProps: {
38+
clearText: 'አጽዳ',
39+
closeText: 'ዝጋ',
40+
loadingText: 'በመጫን ላይ…',
41+
noOptionsText: 'አማራጮች የሉም',
42+
openText: 'ክፈት',
43+
},
44+
},
45+
MuiAlert: {
46+
defaultProps: {
47+
closeText: 'ዝጋ',
48+
},
49+
},
50+
MuiPagination: {
51+
defaultProps: {
52+
'aria-label': 'የገጽ አሰሳ',
53+
getItemAriaLabel: (type, page, selected) => {
54+
if (type === 'page') {
55+
return `${selected ? '' : 'ወደ '}ገጽ ${page}${selected ? '' : ' ሂድ'}`;
56+
}
57+
if (type === 'first') {
58+
return 'ወደ መጀመሪያው ገጽ ይሂዱ';
59+
}
60+
if (type === 'last') {
61+
return 'ወደ መጨረሻው ገጽ ይሂዱ';
62+
}
63+
if (type === 'next') {
64+
return 'ወደ ቀጣዩ ገጽ ይሂዱ';
65+
}
66+
// if (type === 'previous') {
67+
return 'ወደ ቀዳሚው ገጽ ይሂዱ';
68+
},
69+
},
70+
},
71+
},
72+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { Localization } from './utils/LocaleTextApi';
2+
3+
export const arEG: Localization = {
4+
components: {
5+
MuiBreadcrumbs: {
6+
defaultProps: {
7+
expandText: 'إظهار المسار',
8+
},
9+
},
10+
MuiTablePagination: {
11+
defaultProps: {
12+
getItemAriaLabel: (type) => {
13+
if (type === 'first') {
14+
return 'انتقل إلى الصفحة الأولى';
15+
}
16+
if (type === 'last') {
17+
return 'انتقل إلى الصفحة الأخيرة';
18+
}
19+
if (type === 'next') {
20+
return 'انتقل إلى الصفحة التالية';
21+
}
22+
// if (type === 'previous') {
23+
return 'انتقل إلى الصفحة السابقة';
24+
},
25+
labelRowsPerPage: 'عدد الصفوف في الصفحة:',
26+
labelDisplayedRows: ({ from, to, count }) =>
27+
`${from}${to} من ${count !== -1 ? count : ` أكثر من${to}`}`,
28+
},
29+
},
30+
MuiRating: {
31+
defaultProps: {
32+
getLabelText: (value) => `${value} ${value !== 1 ? 'نجوم' : 'نجمة'}`,
33+
emptyLabelText: 'فارغ',
34+
},
35+
},
36+
MuiAutocomplete: {
37+
defaultProps: {
38+
clearText: 'مسح',
39+
closeText: 'إغلاق',
40+
loadingText: 'جار التحميل...',
41+
noOptionsText: 'لا يوجد خيارات',
42+
openText: 'فتح',
43+
},
44+
},
45+
MuiAlert: {
46+
defaultProps: {
47+
closeText: 'إغلاق',
48+
},
49+
},
50+
MuiPagination: {
51+
defaultProps: {
52+
'aria-label': 'التنقل عبر الصفحات',
53+
getItemAriaLabel: (type, page, selected) => {
54+
if (type === 'page') {
55+
return `${selected ? '' : 'انتقل إلى '} صفحة ${page}`;
56+
}
57+
if (type === 'first') {
58+
return 'انتقل إلى الصفحة الأولى';
59+
}
60+
if (type === 'last') {
61+
return 'انتقل إلى الصفحة الأخيرة';
62+
}
63+
if (type === 'next') {
64+
return 'انتقل إلى الصفحة التالية';
65+
}
66+
// if (type === 'previous') {
67+
return 'انتقل إلى الصفحة السابقة';
68+
},
69+
},
70+
},
71+
},
72+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { Localization } from './utils/LocaleTextApi';
2+
3+
export const arSA: Localization = {
4+
components: {
5+
MuiBreadcrumbs: {
6+
defaultProps: {
7+
expandText: 'إظهار المسار',
8+
},
9+
},
10+
MuiTablePagination: {
11+
defaultProps: {
12+
getItemAriaLabel: (type) => {
13+
if (type === 'first') {
14+
return 'الانتقال إلى الصفحة الأولى';
15+
}
16+
if (type === 'last') {
17+
return 'الانتقال إلى الصفحة الأخيرة';
18+
}
19+
if (type === 'next') {
20+
return 'الانتقال إلى الصفحة التالية';
21+
}
22+
// if (type === 'previous') {
23+
return 'الانتقال إلى الصفحة السابقة';
24+
},
25+
labelRowsPerPage: 'عدد الصفوف في الصفحة:',
26+
labelDisplayedRows: ({ from, to, count }) =>
27+
`${from}${to} من ${count !== -1 ? count : ` أكثر من${to}`}`,
28+
},
29+
},
30+
MuiRating: {
31+
defaultProps: {
32+
getLabelText: (value) => `${value} ${value !== 1 ? 'نجوم' : 'نجمة'}`,
33+
emptyLabelText: 'فارغ',
34+
},
35+
},
36+
MuiAutocomplete: {
37+
defaultProps: {
38+
clearText: 'مسح',
39+
closeText: 'إغلاق',
40+
loadingText: 'جار التحميل...',
41+
noOptionsText: 'لا توجد خيارات',
42+
openText: 'فتح',
43+
},
44+
},
45+
MuiAlert: {
46+
defaultProps: {
47+
closeText: 'إغلاق',
48+
},
49+
},
50+
MuiPagination: {
51+
defaultProps: {
52+
'aria-label': 'التنقل عبر الصفحات',
53+
getItemAriaLabel: (type, page, selected) => {
54+
if (type === 'page') {
55+
return `${selected ? '' : 'الانتقال إلى '} صفحة ${page}`;
56+
}
57+
if (type === 'first') {
58+
return 'الانتقال إلى الصفحة الأولى';
59+
}
60+
if (type === 'last') {
61+
return 'الانتقال الي الصفحة الأخيرة';
62+
}
63+
if (type === 'next') {
64+
return 'الانتقال إلى الصفحة التالية';
65+
}
66+
// if (type === 'previous') {
67+
return 'الانتقال إلى الصفحة السابقة';
68+
},
69+
},
70+
},
71+
},
72+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import type { Localization } from './utils/LocaleTextApi';
2+
3+
export const arSD: Localization = {
4+
components: {
5+
MuiBreadcrumbs: {
6+
defaultProps: {
7+
expandText: 'إظهار المسار',
8+
},
9+
},
10+
MuiTablePagination: {
11+
defaultProps: {
12+
getItemAriaLabel: (type) => {
13+
if (type === 'first') {
14+
return 'انتقل إلى الصفحة الأولى';
15+
}
16+
if (type === 'last') {
17+
return 'انتقل إلى الصفحة الأخيرة';
18+
}
19+
if (type === 'next') {
20+
return 'انتقل إلى الصفحة التالية';
21+
}
22+
// if (type === 'previous') {
23+
return 'انتقل إلى الصفحة السابقة';
24+
},
25+
labelRowsPerPage: 'عدد الصفوف في الصفحة:',
26+
labelDisplayedRows: ({ from, to, count }) =>
27+
`${from}${to} من ${count !== -1 ? count : ` أكثر من${to}`}`,
28+
},
29+
},
30+
MuiRating: {
31+
defaultProps: {
32+
getLabelText: (value) => `${value} ${value !== 1 ? 'نجوم' : 'نجمة'}`,
33+
emptyLabelText: 'فارغ',
34+
},
35+
},
36+
MuiAutocomplete: {
37+
defaultProps: {
38+
clearText: 'مسح',
39+
closeText: 'إغلاق',
40+
loadingText: 'جار التحميل...',
41+
noOptionsText: 'لا يوجد خيارات',
42+
openText: 'فتح',
43+
},
44+
},
45+
MuiAlert: {
46+
defaultProps: {
47+
closeText: 'إغلاق',
48+
},
49+
},
50+
MuiPagination: {
51+
defaultProps: {
52+
'aria-label': 'التنقل عبر الصفحات',
53+
getItemAriaLabel: (type, page, selected) => {
54+
if (type === 'page') {
55+
return `${selected ? '' : 'انتقل إلى '} صفحة ${page}`;
56+
}
57+
if (type === 'first') {
58+
return 'انتقل إلى الصفحة الأولى';
59+
}
60+
if (type === 'last') {
61+
return 'انتقل الي الصفحة الأخيرة';
62+
}
63+
if (type === 'next') {
64+
return 'انتقل إلى الصفحة التالية';
65+
}
66+
// if (type === 'previous') {
67+
return 'انتقل إلى الصفحة السابقة';
68+
},
69+
},
70+
},
71+
},
72+
};
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { Localization } from './utils/LocaleTextApi';
2+
3+
export const azAZ: Localization = {
4+
components: {
5+
MuiBreadcrumbs: {
6+
defaultProps: {
7+
expandText: 'Yolu göstər',
8+
},
9+
},
10+
MuiTablePagination: {
11+
defaultProps: {
12+
getItemAriaLabel: (type) => {
13+
if (type === 'first') {
14+
return 'Birinci səhifəyə keç';
15+
}
16+
if (type === 'last') {
17+
return 'Sonuncu səhifəyə keç';
18+
}
19+
if (type === 'next') {
20+
return 'Növbəti səhifəyə keç';
21+
}
22+
// if (type === 'previous') {
23+
return 'Əvvəlki səhifəyə keç';
24+
},
25+
labelRowsPerPage: 'Səhifəyə düşən sətrlər:',
26+
// labelDisplayedRows: ({ from, to, count }) =>
27+
// `${from}–${to} dən ${count !== -1 ? count : `more than ${to}`}`,
28+
},
29+
},
30+
MuiRating: {
31+
defaultProps: {
32+
getLabelText: (value) => {
33+
let pluralForm = 'Ulduz';
34+
const lastDigit = value % 10;
35+
36+
if (lastDigit > 1 && lastDigit < 5) {
37+
pluralForm = 'Ulduzlar';
38+
}
39+
40+
return `${value} ${pluralForm}`;
41+
},
42+
emptyLabelText: 'Boş',
43+
},
44+
},
45+
MuiAutocomplete: {
46+
defaultProps: {
47+
clearText: 'Silmək',
48+
closeText: 'Bağlamaq',
49+
loadingText: 'Yüklənir…',
50+
noOptionsText: 'Seçimlər mövcud deyil',
51+
openText: 'Открыть',
52+
},
53+
},
54+
MuiAlert: {
55+
defaultProps: {
56+
closeText: 'Bağlamaq',
57+
},
58+
},
59+
MuiPagination: {
60+
defaultProps: {
61+
'aria-label': 'Səhifənin naviqasiyası',
62+
getItemAriaLabel: (type, page, selected) => {
63+
if (type === 'page') {
64+
return `${page} ${selected ? 'səhifə' : 'səhifəyə keç'}`;
65+
}
66+
if (type === 'first') {
67+
return 'Birinci səhifəyə keç';
68+
}
69+
if (type === 'last') {
70+
return 'Sonuncu səhifəyə keç';
71+
}
72+
if (type === 'next') {
73+
return 'Növbəti səhifəyə keç';
74+
}
75+
// if (type === 'previous') {
76+
return 'Əvvəlki səhifəyə keç';
77+
},
78+
},
79+
},
80+
},
81+
};

0 commit comments

Comments
 (0)