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 Norwegian Bokmål (nb-NO) locale #27520

Merged
merged 4 commits into from
Dec 22, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/pages/guides/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const theme = createTheme(
| Khmer | kh-KH | `khKH` |
| Kazakh | kz-KZ | `kzKZ` |
| Korean | ko-KR | `koKR` |
| Norwegian (bokmål) | nb-NO | `nbNO` |
| Persian | fa-IR | `faIR` |
| Polish | pl-PL | `plPL` |
| Portuguese | pt-PT | `ptPT` |
Expand Down
83 changes: 77 additions & 6 deletions packages/mui-material/src/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ export const enUS: Localization = {
MuiBreadcrumbs: { defaultProps: {
expandText: 'Show path',
}},
MuiTablePagination: { defaultProps: {
MuiTablePagination: { defaultProps: {
getItemAriaLabel: (type) => {
if (type === 'first') {
return 'Go to first page';
Expand All @@ -782,21 +782,21 @@ export const enUS: Localization = {
labelDisplayedRows: ({ from, to, count }) =>
`${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`,
}},
MuiRating: { defaultProps: {
MuiRating: { defaultProps: {
getLabelText: value => `${value} Star${value !== 1 ? 's' : ''}`,
emptyLabelText: 'Empty',
}},
MuiAutocomplete: { defaultProps: {
MuiAutocomplete: { defaultProps: {
clearText: 'Clear',
closeText: 'Close',
loadingText: 'Loading…',
noOptionsText: 'No options',
openText: 'Open',
}},
MuiAlert: { defaultProps: {
MuiAlert: { defaultProps: {
closeText: 'Close',
}},
MuiPagination: { defaultProps: {
MuiPagination: { defaultProps: {
'aria-label': 'Pagination navigation',
getItemAriaLabel: (type, page, selected) => {
if (type === 'page') {
Expand All @@ -814,7 +814,7 @@ export const enUS: Localization = {
// if (type === 'previous') {
return 'Go to previous page';
},
},
}},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you revert changes to the above lines? I don't know why they've been modified, but let's not introduce any changes beyond what's necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the template I copied and it was missing a closing curly bracket. If others try to add locales copying this they will also get an error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough :)

},
*/
};
Expand Down Expand Up @@ -1963,6 +1963,77 @@ export const kzKZ: Localization = {
},
};

export const nbNO: 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 forrige side';
},
labelRowsPerPage: 'Rader per side:',
labelDisplayedRows: ({ from, to, count }) =>
`${from}–${to} av ${count !== -1 ? count : `mer enn ${to}`}`,
},
},
MuiRating: {
defaultProps: {
getLabelText: (value) => `${value} Stjerne${value !== 1 ? 'r' : ''}`,
emptyLabelText: 'Tom',
},
},
MuiAutocomplete: {
defaultProps: {
clearText: 'Tøm',
closeText: 'Lukk',
loadingText: 'Laster inn…',
noOptionsText: 'Ingen alternativer',
openText: 'Åpne',
},
},
MuiAlert: {
defaultProps: {
closeText: 'Lukk',
},
},
MuiPagination: {
defaultProps: {
'aria-label': 'Paginering navigasjon',
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 forrige side';
},
},
},
},
};

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