Skip to content
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 Croatian (hr-HR) and Serbian (sr-RS) translation #30906

Merged
merged 3 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/data/material/guides/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const theme = createTheme(
| Chinese (Hong Kong) | zh-HK | `zhHK` |
| Chinese (Simplified) | zh-CN | `zhCN` |
| Chinese (Taiwan) | zh-TW | `zhTW` |
| Croatian | hr-HR | `hrHR` |
| Czech | cs-CZ | `csCZ` |
| Danish | da-DK | `daDK` |
| Dutch | nl-NL | `nlNL` |
Expand All @@ -73,6 +74,7 @@ const theme = createTheme(
| Portuguese (Brazil) | pt-BR | `ptBR` |
| Romanian | ro-RO | `roRO` |
| Russian | ru-RU | `ruRU` |
| Serbian | sr-RS | `srRS` |
| Sinhalese | si-LK | `siLK` |
| Slovak | sk-SK | `skSK` |
| Spanish | es-ES | `esES` |
Expand Down
158 changes: 158 additions & 0 deletions packages/mui-material/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,85 @@ export const hiIN: Localization = {
},
};

// Croatian - Hrvatski
export const hrHR: Localization = {
components: {
MuiBreadcrumbs: {
defaultProps: {
expandText: 'Pokaži putanju',
},
},
MuiTablePagination: {
defaultProps: {
getItemAriaLabel: (type) => {
if (type === 'first') {
return 'Idi na prvu stranicu';
}
if (type === 'last') {
return 'Idi na posljednju stranicu';
}
if (type === 'next') {
return 'Idi na sljedeću stranicu';
}
// if (type === 'previous') {
return 'Idi na prethodnu stranicu';
},
labelRowsPerPage: 'Redova po stranici:',
labelDisplayedRows: ({ from, to, count }) =>
`${from}–${to} od ${count !== -1 ? count : `više nego ${to}`}`,
},
},
MuiRating: {
defaultProps: {
getLabelText: (value) => {
const lastDigit = value % 10;
const lastTwoDigits = value % 100;
if ([2, 3, 4].includes(lastDigit) && ![12, 13, 14].includes(lastTwoDigits)) {
return 'Zvijezde';
}
return 'Zvijezda';
},
emptyLabelText: 'Prazno',
},
},
MuiAutocomplete: {
defaultProps: {
clearText: 'Briši',
closeText: 'Zatvori',
loadingText: 'Učitavanje…',
noOptionsText: 'Nema opcija',
openText: 'Otvori',
},
},
MuiAlert: {
defaultProps: {
closeText: 'Zatvori',
},
},
MuiPagination: {
defaultProps: {
'aria-label': 'Navigacija po stranicama',
getItemAriaLabel: (type, page, selected) => {
if (type === 'page') {
return `${selected ? '' : 'Idi na '}stranicu ${page}`;
}
if (type === 'first') {
return 'Idi na prvu stranicu';
}
if (type === 'last') {
return 'Idi na zadnju stranicu';
}
if (type === 'next') {
return 'Idi na sljedeću stranicu';
}
// if (type === 'previous') {
return 'Idi na prethodnu stranicu';
},
},
},
},
};

export const huHU: Localization = {
components: {
MuiBreadcrumbs: {
Expand Down Expand Up @@ -2471,6 +2550,85 @@ export const roRO: Localization = {
},
};

// Serbian - Srpski
export const srRS: Localization = {
components: {
MuiBreadcrumbs: {
defaultProps: {
expandText: 'Pokaži putanju',
},
},
MuiTablePagination: {
defaultProps: {
getItemAriaLabel: (type) => {
if (type === 'first') {
return 'Idi na prvu stranicu';
}
if (type === 'last') {
return 'Idi na poslednju stranicu';
}
if (type === 'next') {
return 'Idi na sledeću stranicu';
}
// if (type === 'previous') {
return 'Idi na prethodnu stranicu';
},
labelRowsPerPage: 'Redova po stranici:',
labelDisplayedRows: ({ from, to, count }) =>
`${from}–${to} od ${count !== -1 ? count : `više nego ${to}`}`,
},
},
MuiRating: {
defaultProps: {
getLabelText: (value) => {
const lastDigit = value % 10;
const lastTwoDigits = value % 100;
if ([2, 3, 4].includes(lastDigit) && ![12, 13, 14].includes(lastTwoDigits)) {
return 'Zvezde';
}
return 'Zvezda';
},
emptyLabelText: 'Prazno',
},
},
MuiAutocomplete: {
defaultProps: {
clearText: 'Briši',
closeText: 'Zatvori',
loadingText: 'Učitavanje…',
noOptionsText: 'Nema opcija',
openText: 'Otvori',
},
},
MuiAlert: {
defaultProps: {
closeText: 'Zatvori',
},
},
MuiPagination: {
defaultProps: {
'aria-label': 'Navigacija po stranicama',
getItemAriaLabel: (type, page, selected) => {
if (type === 'page') {
return `${selected ? '' : 'Idi na '}stranicu ${page}`;
}
if (type === 'first') {
return 'Idi na prvu stranicu';
}
if (type === 'last') {
return 'Idi na zadnju stranicu';
}
if (type === 'next') {
return 'Idi na sledeću stranicu';
}
// if (type === 'previous') {
return 'Idi na prethodnu stranicu';
},
},
},
},
};

export const ruRU: Localization = {
components: {
MuiBreadcrumbs: {
Expand Down