Skip to content

Commit

Permalink
[l10n] Add Croatian (hr-HR) and Serbian (sr-RS) translation (#30906)
Browse files Browse the repository at this point in the history
  • Loading branch information
m14d3n committed Mar 1, 2022
1 parent 2e4182c commit af42b0a
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 0 deletions.
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

0 comments on commit af42b0a

Please sign in to comment.