Skip to content

Commit

Permalink
[I10n] Add Norwegian (nynorsk) (nn-NO) locale (#39481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjalti H. Gíslason committed Oct 19, 2023
1 parent 6b9ea31 commit bad8c82
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data/material/guides/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The [Data Grid and Data Grid Pro](/x/react-data-grid/) components have their own
| Malay | ms-MS | `msMS` |
| Nepali | ne-NP | `neNP` |
| Norwegian (bokmål) | nb-NO | `nbNO` |
| Norwegian (nynorsk) | nn-NO | `nnNO` |
| Persian | fa-IR | `faIR` |
| Polish | pl-PL | `plPL` |
| Portuguese | pt-PT | `ptPT` |
Expand Down
71 changes: 71 additions & 0 deletions packages/mui-material/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,77 @@ export const nbNO: Localization = {
},
};

export const nnNO: Localization = {
components: {
MuiBreadcrumbs: {
defaultProps: {
expandText: 'Vis sti',
},
},
MuiTablePagination: {
defaultProps: {
getItemAriaLabel: (type) => {
if (type === 'first') {
return 'Gå til første side';
}
if (type === 'last') {
return 'Gå til siste side';
}
if (type === 'next') {
return 'Gå til neste side';
}
// if (type === 'previous') {
return 'Gå til førre side';
},
labelRowsPerPage: 'Rader per side:',
labelDisplayedRows: ({ from, to, count }) =>
`${from}${to} av ${count !== -1 ? count : `fleire enn ${to}`}`,
},
},
MuiRating: {
defaultProps: {
getLabelText: (value) => `${value} stjerne${value !== 1 ? 'r' : ''}`,
emptyLabelText: 'Tom',
},
},
MuiAutocomplete: {
defaultProps: {
clearText: 'Tøm',
closeText: 'Lukk',
loadingText: 'Lastar inn…',
noOptionsText: 'Ingen alternativ',
openText: 'Opna',
},
},
MuiAlert: {
defaultProps: {
closeText: 'Lukk',
},
},
MuiPagination: {
defaultProps: {
'aria-label': 'Navigasjon for paginering',
getItemAriaLabel: (type, page, selected) => {
if (type === 'page') {
return `${selected ? '' : 'Gå til '}side ${page}`;
}
if (type === 'first') {
return 'Gå til første side';
}
if (type === 'last') {
return 'Gå til siste side';
}
if (type === 'next') {
return 'Gå til neste side';
}
// if (type === 'previous') {
return 'Gå til førre side';
},
},
},
},
};

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

0 comments on commit bad8c82

Please sign in to comment.