diff --git a/docs/data/material/guides/localization/localization.md b/docs/data/material/guides/localization/localization.md index 319a25d0557dee..eaeca0f2b9c4f2 100644 --- a/docs/data/material/guides/localization/localization.md +++ b/docs/data/material/guides/localization/localization.md @@ -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` | @@ -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` | diff --git a/packages/mui-material/src/locale/index.ts b/packages/mui-material/src/locale/index.ts index 6e1c2fb653741e..2a8197434ca41f 100644 --- a/packages/mui-material/src/locale/index.ts +++ b/packages/mui-material/src/locale/index.ts @@ -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: { @@ -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: {