Skip to content

Commit

Permalink
[l10n] Add Swedish (sv-SE) locale (#5210)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrxdst authored Jun 17, 2022
1 parent bb47073 commit 38ba9ca
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data/data-grid/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import { DataGrid, nlNL } from '@mui/x-data-grid';
| Russian | ru-RU | `ruRU` |
| Slovak | sk-SK | `skSK` |
| Spanish (Spain) | es-ES | `esES` |
| Swedish | sv-SE | `svSE` |
| Turkish | tr-TR | `trTR` |
| Ukraine | uk-UA | `ukUA` |
| Simplified Chinese | zh-CN | `zhCN` |
Expand Down
1 change: 1 addition & 0 deletions docs/data/date-pickers/localization/localization.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import bgLocale from 'date-fns/locale/bg';
| English (United States) | en-US | `enUS` |
| French | fr-FR | `frFR` |
| German | de-DE | `deDE` |
| Swedish | sv-SE | `svSE` |
| Turkish | tr-TR | `trTr` |
| Dutch | nl-NL | `nlNL` |

Expand Down
1 change: 1 addition & 0 deletions packages/grid/x-data-grid/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from './plPL';
export * from './ptBR';
export * from './ruRU';
export * from './skSK';
export * from './svSE';
export * from './trTR';
export * from './ukUA';
export * from './viVN';
Expand Down
148 changes: 148 additions & 0 deletions packages/grid/x-data-grid/src/locales/svSE.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
import { svSE as svSECore } from '@mui/material/locale';
import { GridLocaleText } from '../models/api/gridLocaleTextApi';
import { getGridLocalization, Localization } from '../utils/getGridLocalization';

const svSEGrid: Partial<GridLocaleText> = {
// Root
noRowsLabel: 'Inga rader',
noResultsOverlayLabel: 'Inga resultat funna.',
errorOverlayDefaultLabel: 'Ett fel uppstod.',

// Density selector toolbar button text
toolbarDensity: 'Densitet',
toolbarDensityLabel: 'Densitet',
toolbarDensityCompact: 'Kompakt',
toolbarDensityStandard: 'Standard',
toolbarDensityComfortable: 'Bekväm',

// Columns selector toolbar button text
toolbarColumns: 'Kolumner',
toolbarColumnsLabel: 'Välj kolumner',

// Filters toolbar button text
toolbarFilters: 'Filter',
toolbarFiltersLabel: 'Visa filter',
toolbarFiltersTooltipHide: 'Dölj filter',
toolbarFiltersTooltipShow: 'Visa filter',
toolbarFiltersTooltipActive: (count) =>
count !== 1 ? `${count} aktiva filter` : `${count} aktivt filter`,

// Quick filter toolbar field
toolbarQuickFilterPlaceholder: 'Sök...',
toolbarQuickFilterLabel: 'Sök',
toolbarQuickFilterDeleteIconLabel: 'Rensa',

// Export selector toolbar button text
toolbarExport: 'Exportera',
toolbarExportLabel: 'Exportera',
toolbarExportCSV: 'Ladda ner som CSV',
toolbarExportPrint: 'Skriv ut',
toolbarExportExcel: 'Ladda ner som Excel',

// Columns panel text
columnsPanelTextFieldLabel: 'Hitta kolumn',
columnsPanelTextFieldPlaceholder: 'Kolumntitel',
columnsPanelDragIconLabel: 'Ordna om kolumnen',
columnsPanelShowAllButton: 'Visa alla',
columnsPanelHideAllButton: 'Dölj alla',

// Filter panel text
filterPanelAddFilter: 'Lägg till filter',
filterPanelDeleteIconLabel: 'Ta bort',
filterPanelLinkOperator: 'Logisk operatör',
filterPanelOperators: 'Operatör',

// TODO v6: rename to filterPanelOperator
filterPanelOperatorAnd: 'Och',
filterPanelOperatorOr: 'Eller',
filterPanelColumns: 'Kolumner',
filterPanelInputLabel: 'Värde',
filterPanelInputPlaceholder: 'Filtervärde',

// Filter operators text
filterOperatorContains: 'innehåller',
filterOperatorEquals: 'är lika med',
filterOperatorStartsWith: 'börjar med',
filterOperatorEndsWith: 'slutar med',
filterOperatorIs: 'är',
filterOperatorNot: 'är inte',
filterOperatorAfter: 'är efter',
filterOperatorOnOrAfter: 'är på eller efter',
filterOperatorBefore: 'är innan',
filterOperatorOnOrBefore: 'är på eller innan',
filterOperatorIsEmpty: 'är tom',
filterOperatorIsNotEmpty: 'är inte tom',
filterOperatorIsAnyOf: 'är någon av',

// Filter values text
filterValueAny: 'något',
filterValueTrue: 'sant',
filterValueFalse: 'falskt',

// Column menu text
columnMenuLabel: 'Meny',
columnMenuShowColumns: 'Visa kolumner',
columnMenuFilter: 'Filtrera',
columnMenuHideColumn: 'Dölj',
columnMenuUnsort: 'Osortera',
columnMenuSortAsc: 'Sortera stigande',
columnMenuSortDesc: 'Sortera fallande',

// Column header text
columnHeaderFiltersTooltipActive: (count) =>
count !== 1 ? `${count} aktiva filter` : `${count} aktivt filter`,
columnHeaderFiltersLabel: 'Visa filter',
columnHeaderSortIconLabel: 'Sortera',

// Rows selected footer text
footerRowSelected: (count) =>
count !== 1
? `${count.toLocaleString()} rader markerade`
: `${count.toLocaleString()} rad markerad`,

// Total row amount footer text
footerTotalRows: 'Totalt antal rader:',

// Total visible row amount footer text
footerTotalVisibleRows: (visibleCount, totalCount) =>
`${visibleCount.toLocaleString()} av ${totalCount.toLocaleString()}`,

// Checkbox selection text
checkboxSelectionHeaderName: 'Markering med kryssruta',
checkboxSelectionSelectAllRows: 'Markera alla rader',
checkboxSelectionUnselectAllRows: 'Avmarkera alla rader',
checkboxSelectionSelectRow: 'Markera rad',
checkboxSelectionUnselectRow: 'Avmarkera rad',

// Boolean cell text
booleanCellTrueLabel: 'ja',
booleanCellFalseLabel: 'nej',

// Actions cell more text
actionsCellMore: 'mer',

// Column pinning text
pinToLeft: 'Fäst till vänster',
pinToRight: 'Fäst till höger',
unpin: 'Ta bort fäste',

// Tree Data
treeDataGroupingHeaderName: 'Grupp',
treeDataExpand: 'visa underordnade',
treeDataCollapse: 'dölj underordnade',

// Grouping columns
groupingColumnHeaderName: 'Grupp',
groupColumn: (name) => `Gruppera efter ${name}`,
unGroupColumn: (name) => `Sluta gruppera efter ${name}`,

// Master/detail
// detailPanelToggle: 'Detail panel toggle',
expandDetailPanel: 'Expandera',
collapseDetailPanel: 'Kollapsa',

// Row reordering text
rowReorderingHeaderName: 'Ordna om rader',
};

export const svSE: Localization = getGridLocalization(svSEGrid, svSECore);
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export * from './trTR';
export * from './deDE';
export * from './frFR';
export * from './enUS';
export * from './svSE';
export * from './utils/pickersLocaleTextApi';
52 changes: 52 additions & 0 deletions packages/x-date-pickers/src/locales/svSE.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';
import { CalendarPickerView } from '../internals/models';

const svSEPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'Föregående månad',
nextMonth: 'Nästa månad',

// View navigation
openPreviousView: 'öppna föregående vy',
openNextView: 'öppna nästa vy',
calendarViewSwitchingButtonAriaLabel: (view: CalendarPickerView) =>
view === 'year'
? 'årsvyn är öppen, byt till kalendervy'
: 'kalendervyn är öppen, byt till årsvy',

// DateRange placeholders
start: 'Start',
end: 'Slut',

// Action bar
cancelButtonLabel: 'Avbryt',
clearButtonLabel: 'Rensa',
okButtonLabel: 'OK',
todayButtonLabel: 'Idag',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Select ${view}. ${
time === null ? 'Ingen tid vald' : `Vald tid är ${adapter.format(time, 'fullTime')}`
}`,
hoursClockNumberText: (hours) => `${hours} timmar`,
minutesClockNumberText: (minutes) => `${minutes} minuter`,
secondsClockNumberText: (seconds) => `${seconds} sekunder`,

// Open picker labels
openDatePickerDialogue: (rawValue, utils) =>
rawValue && utils.isValid(utils.date(rawValue))
? `Välj datum, valt datum är ${utils.format(utils.date(rawValue)!, 'fullDate')}`
: 'Välj datum',
openTimePickerDialogue: (rawValue, utils) =>
rawValue && utils.isValid(utils.date(rawValue))
? `Välj tid, vald tid är ${utils.format(utils.date(rawValue)!, 'fullTime')}`
: 'Välj tid',

// Table labels
timeTableLabel: 'välj tid',
dateTableLabel: 'välj datum',
};

export const svSE = getPickersLocalization(svSEPickers);
1 change: 1 addition & 0 deletions scripts/x-data-grid-premium.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@
{ "name": "SortGridMenuItems", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
{ "name": "trTR", "kind": "Variable" },
{ "name": "ukUA", "kind": "Variable" },
{ "name": "unstable_resetCleanupTracking", "kind": "Variable" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-data-grid-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@
{ "name": "SortGridMenuItems", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
{ "name": "trTR", "kind": "Variable" },
{ "name": "ukUA", "kind": "Variable" },
{ "name": "unstable_resetCleanupTracking", "kind": "Variable" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-data-grid.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
{ "name": "SortGridMenuItems", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
{ "name": "trTR", "kind": "Variable" },
{ "name": "ukUA", "kind": "Variable" },
{ "name": "unstable_resetCleanupTracking", "kind": "Variable" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
{ "name": "StaticDateTimePickerProps", "kind": "TypeAlias" },
{ "name": "StaticTimePicker", "kind": "Variable" },
{ "name": "StaticTimePickerProps", "kind": "TypeAlias" },
{ "name": "svSE", "kind": "Variable" },
{ "name": "TimePicker", "kind": "Variable" },
{ "name": "TimePickerProps", "kind": "Interface" },
{ "name": "trTR", "kind": "Variable" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
{ "name": "StaticDateTimePickerProps", "kind": "TypeAlias" },
{ "name": "StaticTimePicker", "kind": "Variable" },
{ "name": "StaticTimePickerProps", "kind": "TypeAlias" },
{ "name": "svSE", "kind": "Variable" },
{ "name": "TimePicker", "kind": "Variable" },
{ "name": "TimePickerProps", "kind": "Interface" },
{ "name": "trTR", "kind": "Variable" },
Expand Down

0 comments on commit 38ba9ca

Please sign in to comment.