From 91a216bb235a4d42d38134646659e58e5730520d Mon Sep 17 00:00:00 2001 From: Bradley Wogsland Date: Fri, 17 Dec 2021 11:05:24 +0100 Subject: [PATCH 1/4] add Norwegian localization --- .../pages/guides/localization/localization.md | 1 + packages/mui-material/src/locale/index.ts | 71 +++++++++++++++++-- 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/docs/src/pages/guides/localization/localization.md b/docs/src/pages/guides/localization/localization.md index 6c9ca42b569859..4c49f26ea328c5 100644 --- a/docs/src/pages/guides/localization/localization.md +++ b/docs/src/pages/guides/localization/localization.md @@ -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` | diff --git a/packages/mui-material/src/locale/index.ts b/packages/mui-material/src/locale/index.ts index d71dc34e9b92eb..c4b8056f34bf3d 100644 --- a/packages/mui-material/src/locale/index.ts +++ b/packages/mui-material/src/locale/index.ts @@ -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'; @@ -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') { @@ -814,7 +814,7 @@ export const enUS: Localization = { // if (type === 'previous') { return 'Go to previous page'; }, - }, + }}, }, */ }; @@ -1963,6 +1963,65 @@ 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} Star${value !== 1 ? 's' : ''}`, + 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: { From a23823122b92e40a6ab72aee4a06c8d2b34a528d Mon Sep 17 00:00:00 2001 From: Bradley Wogsland Date: Fri, 17 Dec 2021 11:08:18 +0100 Subject: [PATCH 2/4] stars --- packages/mui-material/src/locale/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-material/src/locale/index.ts b/packages/mui-material/src/locale/index.ts index c4b8056f34bf3d..5202c4c6838f80 100644 --- a/packages/mui-material/src/locale/index.ts +++ b/packages/mui-material/src/locale/index.ts @@ -1987,7 +1987,7 @@ export const nbNO: Localization = { `${from}–${to} av ${count !== -1 ? count : `mer enn ${to}`}`, }}, MuiRating: { defaultProps: { - getLabelText: value => `${value} Star${value !== 1 ? 's' : ''}`, + getLabelText: value => `${value} Stjerne${value !== 1 ? 'r' : ''}`, emptyLabelText: 'Tom', }}, MuiAutocomplete: { defaultProps: { From cd0182cceef36c395ab8f3750ea5ba622bfe18e9 Mon Sep 17 00:00:00 2001 From: Bradley Wogsland Date: Fri, 17 Dec 2021 14:14:58 +0100 Subject: [PATCH 3/4] prettier --- packages/mui-material/src/locale/index.ts | 116 ++++++++++++---------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/packages/mui-material/src/locale/index.ts b/packages/mui-material/src/locale/index.ts index 5202c4c6838f80..a2a049747a50e9 100644 --- a/packages/mui-material/src/locale/index.ts +++ b/packages/mui-material/src/locale/index.ts @@ -1965,60 +1965,72 @@ 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'; + MuiBreadcrumbs: { + defaultProps: { + expandText: 'Vis sti', }, - 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'; + }, + 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'; + }, + }, + }, }, }; From 63fb926e0347a29635209e0aafb485ad7d6861e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudak?= Date: Wed, 22 Dec 2021 13:34:05 +0100 Subject: [PATCH 4/4] Restart CI