From 54ec4020cd39e28d1becd596059236b24dedd53e Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette Date: Mon, 31 Jan 2022 13:29:55 +0100 Subject: [PATCH 1/2] [l10n] Add Danish (daDK) locale thanks to @kasperfilstrup --- .../data-grid/localization/localization.md | 1 + packages/grid/_modules_/grid/locales/daDK.ts | 127 ++++++++++++++++++ packages/grid/_modules_/grid/locales/index.ts | 1 + 3 files changed, 129 insertions(+) create mode 100644 packages/grid/_modules_/grid/locales/daDK.ts diff --git a/docs/src/pages/components/data-grid/localization/localization.md b/docs/src/pages/components/data-grid/localization/localization.md index 6321c70f9cff..c4613db6cdaf 100644 --- a/docs/src/pages/components/data-grid/localization/localization.md +++ b/docs/src/pages/components/data-grid/localization/localization.md @@ -79,6 +79,7 @@ import { DataGrid, nlNL } from '@mui/x-data-grid'; | Arabic (Sudan) | ar-SD | `arSD` | | Bulgarian | bg-BG | `bgBG` | | Czech | cs-CZ | `csCZ` | +| Danish | da-DK | `daDK` | | Dutch | nl-NL | `nlNL` | | English (United States) | en-US | `enUS` | | Finnish | fi-FI | `fiFI` | diff --git a/packages/grid/_modules_/grid/locales/daDK.ts b/packages/grid/_modules_/grid/locales/daDK.ts new file mode 100644 index 000000000000..67846b178c0a --- /dev/null +++ b/packages/grid/_modules_/grid/locales/daDK.ts @@ -0,0 +1,127 @@ +import { daDK as daDKCore } from '@mui/material/locale'; +import { GridLocaleText } from '../models/api/gridLocaleTextApi'; +import { getGridLocalization, Localization } from '../utils/getGridLocalization'; + +const daDKGrid: Partial = { + // Root + noRowsLabel: 'Ingen rækker', + noResultsOverlayLabel: 'Ingen resultater', + errorOverlayDefaultLabel: 'Der skete en fejl.', + + // Density selector toolbar button text + toolbarDensity: 'Density', + toolbarDensityLabel: 'Tæthed', + toolbarDensityCompact: 'Kompakt', + toolbarDensityStandard: 'Standard', + toolbarDensityComfortable: 'Luftig', + + // Columns selector toolbar button text + toolbarColumns: 'Kolonne', + toolbarColumnsLabel: 'Vælg kolonne', + + // Filters toolbar button text + toolbarFilters: 'Filtre', + toolbarFiltersLabel: 'Vis filtre', + toolbarFiltersTooltipHide: 'Skjul filtre', + toolbarFiltersTooltipShow: 'Vis filtre', + toolbarFiltersTooltipActive: (count) => + count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`, + + // Export selector toolbar button text + toolbarExport: 'Export', + toolbarExportLabel: 'Eksporter', + toolbarExportCSV: 'Download som CSV', + // toolbarExportPrint: 'Print', + + // Columns panel text + columnsPanelTextFieldLabel: 'Find kolonne', + columnsPanelTextFieldPlaceholder: 'Kolonne titel', + columnsPanelDragIconLabel: 'Reorder kolonne', + columnsPanelShowAllButton: 'Vis alle', + columnsPanelHideAllButton: 'Skjul alle', + + // Filter panel text + filterPanelAddFilter: 'Tilføj filter', + filterPanelDeleteIconLabel: 'Slet', + filterPanelOperators: 'Operatorer', + filterPanelOperatorAnd: 'And', + filterPanelOperatorOr: 'Or', + filterPanelColumns: 'Kolonne', + filterPanelInputLabel: 'Værdi', + filterPanelInputPlaceholder: 'Filter værdi', + + // Filter operators text + filterOperatorContains: 'Indeholder', + filterOperatorEquals: 'Lig med', + filterOperatorStartsWith: 'Begynder med', + filterOperatorEndsWith: 'Ender med', + filterOperatorIs: 'På', + filterOperatorNot: 'Ikke på', + filterOperatorAfter: 'Efter', + filterOperatorOnOrAfter: 'På eller efter', + filterOperatorBefore: 'Før', + filterOperatorOnOrBefore: 'På eller før', + filterOperatorIsEmpty: 'Indeholder data', + filterOperatorIsNotEmpty: 'Indeholder ikke data', + // filterOperatorIsAnyOf: 'is any of', + + // Filter values text + filterValueAny: 'any', + filterValueTrue: 'true', + filterValueFalse: 'false', + + // Column menu text + columnMenuLabel: 'Menu', + columnMenuShowColumns: 'Vis Kolonner', + columnMenuFilter: 'Filter', + columnMenuHideColumn: 'Skjul', + columnMenuUnsort: 'Fjern sortering', + columnMenuSortAsc: 'Sorter stigende', + columnMenuSortDesc: 'Sorter faldende', + + // Column header text + columnHeaderFiltersTooltipActive: (count) => + count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`, + columnHeaderFiltersLabel: 'Vis filtre', + columnHeaderSortIconLabel: 'Sorter', + + // Rows selected footer text + footerRowSelected: (count) => + count !== 1 + ? `${count.toLocaleString()} rækker valgt` + : `${count.toLocaleString()} række valgt`, + + // Total rows footer text + footerTotalRows: 'Totale rækker:', + + // Total visible rows footer text + footerTotalVisibleRows: (visibleCount, totalCount) => + `${visibleCount.toLocaleString()} af ${totalCount.toLocaleString()}`, + + // Checkbox selection text + checkboxSelectionHeaderName: 'Afkrydsningsvalg', + + // Boolean cell text + booleanCellTrueLabel: 'true', + booleanCellFalseLabel: 'false', + + // Actions cell more text + actionsCellMore: 'mere', + + // Column pinning text + pinToLeft: 'Fastgør til venstre', + pinToRight: 'Fastgør til højre', + unpin: 'Frigiv', + + // Tree Data + treeDataGroupingHeaderName: 'Gruppering', + treeDataExpand: 'Vis underelementer', + treeDataCollapse: 'Skjul underelementer', + + // Grouping columns + // groupingColumnHeaderName: 'Group', + // groupColumn: name => `Group by ${name}`, + // unGroupColumn: name => `Stop grouping by ${name}`, +}; + +export const daDK: Localization = getGridLocalization(daDKGrid, daDKCore); diff --git a/packages/grid/_modules_/grid/locales/index.ts b/packages/grid/_modules_/grid/locales/index.ts index 3fb5375f2abe..405e398169ff 100644 --- a/packages/grid/_modules_/grid/locales/index.ts +++ b/packages/grid/_modules_/grid/locales/index.ts @@ -2,6 +2,7 @@ export * from './arSD'; export * from './bgBG'; export * from './csCZ'; +export * from './daDK'; export * from './deDE'; export * from './elGR'; export * from './enUS'; From 9ca975e336e023a53a83743d933ee01343b41955 Mon Sep 17 00:00:00 2001 From: Alexandre Fauquette Date: Mon, 31 Jan 2022 14:07:01 +0100 Subject: [PATCH 2/2] comment english --- packages/grid/_modules_/grid/locales/daDK.ts | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/grid/_modules_/grid/locales/daDK.ts b/packages/grid/_modules_/grid/locales/daDK.ts index 67846b178c0a..f3ca5c12ed40 100644 --- a/packages/grid/_modules_/grid/locales/daDK.ts +++ b/packages/grid/_modules_/grid/locales/daDK.ts @@ -9,7 +9,7 @@ const daDKGrid: Partial = { errorOverlayDefaultLabel: 'Der skete en fejl.', // Density selector toolbar button text - toolbarDensity: 'Density', + // toolbarDensity: 'Density', toolbarDensityLabel: 'Tæthed', toolbarDensityCompact: 'Kompakt', toolbarDensityStandard: 'Standard', @@ -20,7 +20,7 @@ const daDKGrid: Partial = { toolbarColumnsLabel: 'Vælg kolonne', // Filters toolbar button text - toolbarFilters: 'Filtre', + // toolbarFilters: 'Filters', toolbarFiltersLabel: 'Vis filtre', toolbarFiltersTooltipHide: 'Skjul filtre', toolbarFiltersTooltipShow: 'Vis filtre', @@ -28,7 +28,7 @@ const daDKGrid: Partial = { count !== 1 ? `${count} aktive filtre` : `${count} aktivt filter`, // Export selector toolbar button text - toolbarExport: 'Export', + // toolbarExport: 'Export', toolbarExportLabel: 'Eksporter', toolbarExportCSV: 'Download som CSV', // toolbarExportPrint: 'Print', @@ -44,8 +44,8 @@ const daDKGrid: Partial = { filterPanelAddFilter: 'Tilføj filter', filterPanelDeleteIconLabel: 'Slet', filterPanelOperators: 'Operatorer', - filterPanelOperatorAnd: 'And', - filterPanelOperatorOr: 'Or', + // filterPanelOperatorAnd: 'And', + // filterPanelOperatorOr: 'Or', filterPanelColumns: 'Kolonne', filterPanelInputLabel: 'Værdi', filterPanelInputPlaceholder: 'Filter værdi', @@ -66,14 +66,14 @@ const daDKGrid: Partial = { // filterOperatorIsAnyOf: 'is any of', // Filter values text - filterValueAny: 'any', - filterValueTrue: 'true', - filterValueFalse: 'false', + // filterValueAny: 'any', + // filterValueTrue: 'true', + // filterValueFalse: 'false', // Column menu text - columnMenuLabel: 'Menu', + // columnMenuLabel: 'Menu', columnMenuShowColumns: 'Vis Kolonner', - columnMenuFilter: 'Filter', + // columnMenuFilter: 'Filter', columnMenuHideColumn: 'Skjul', columnMenuUnsort: 'Fjern sortering', columnMenuSortAsc: 'Sorter stigende', @@ -102,8 +102,8 @@ const daDKGrid: Partial = { checkboxSelectionHeaderName: 'Afkrydsningsvalg', // Boolean cell text - booleanCellTrueLabel: 'true', - booleanCellFalseLabel: 'false', + // booleanCellTrueLabel: 'true', + // booleanCellFalseLabel: 'false', // Actions cell more text actionsCellMore: 'mere',