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

[core] Add script to sync translation files #3201

Merged
merged 6 commits into from
Nov 23, 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
10 changes: 8 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ jobs:
- save_cache:
key: v6-yarn-sha-{{ checksum "yarn.lock" }}
paths:
# Keep path in sync with "Set yarn cache folder"
# Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui-org/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370)
# Keep path in sync with "Set yarn cache folder"
# Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui-org/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370)
- ~/.cache/yarn
test_unit:
<<: *defaults
Expand Down Expand Up @@ -161,6 +161,12 @@ jobs:
- run:
name: '`yarn docs:api` changes committed?'
command: git diff --exit-code
- run:
name: Sync locale files
command: yarn l10n
- run:
name: '`yarn l10n` changes committed?'
command: git diff --exit-code
test_browser:
<<: *defaults
docker:
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"storybook:build": "yarn workspace storybook build",
"storybook:export": "yarn workspace storybook export",
"deduplicate": "node scripts/deduplicate.js",
"l10n": "babel-node -x .ts ./scripts/l10n.ts",
"stylelint": "stylelint '**/*.js' '**/*.ts' '**/*.tsx'",
"prettier": "node ./scripts/prettier.js --branch next",
"prettier:all": "node ./scripts/prettier.js write",
Expand Down Expand Up @@ -58,6 +59,8 @@
"@babel/plugin-transform-runtime": "^7.16.4",
"@babel/register": "^7.16.0",
"@babel/runtime": "^7.16.3",
"@babel/traverse": "^7.16.3",
"@babel/types": "^7.16.0",
"@emotion/cache": "^11.6.0",
"@emotion/react": "^11.6.0",
"@emotion/styled": "^11.6.0",
Expand All @@ -71,6 +74,7 @@
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-replace": "^3.0.0",
"@testing-library/react": "^12.1.2",
"@types/babel__core": "^7.1.16",
"@types/chai": "^4.2.22",
"@types/chai-dom": "^0.0.11",
"@types/enzyme": "^3.10.10",
Expand Down
1 change: 1 addition & 0 deletions packages/grid/_modules_/grid/locales/arSD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const arSDGrid: Partial<GridLocaleText> = {
toolbarExport: 'تصدير',
toolbarExportLabel: 'تصدير',
toolbarExportCSV: 'تنزيل كملف CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'ايجاد عمود',
Expand Down
32 changes: 26 additions & 6 deletions packages/grid/_modules_/grid/locales/bgBG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const bgBGGrid: Partial<GridLocaleText> = {
toolbarDensityStandard: 'Стандартна',
toolbarDensityComfortable: 'Комфортна',

// GridColumns selector toolbar button text
// Columns selector toolbar button text
toolbarColumns: 'Колони',
toolbarColumnsLabel: 'Покажи селектора на колони',

Expand All @@ -26,7 +26,13 @@ const bgBGGrid: Partial<GridLocaleText> = {
toolbarFiltersTooltipShow: 'Покажи Филтрите',
toolbarFiltersTooltipActive: (count) => `${count} активни филтри`,

// GridColumns panel text
// Export selector toolbar button text
// toolbarExport: 'Export',
// toolbarExportLabel: 'Export',
// toolbarExportCSV: 'Download as CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Намери колона',
columnsPanelTextFieldPlaceholder: 'Заглавие на колона',
columnsPanelDragIconLabel: 'Пренареди на колона',
Expand All @@ -40,6 +46,8 @@ const bgBGGrid: Partial<GridLocaleText> = {
filterPanelOperatorAnd: 'И',
filterPanelOperatorOr: 'Или',
filterPanelColumns: 'Колони',
filterPanelInputLabel: 'Стойност',
filterPanelInputPlaceholder: 'Стойност на филтъра',

// Filter operators text
filterOperatorContains: 'съдържа',
Expand All @@ -52,11 +60,14 @@ const bgBGGrid: Partial<GridLocaleText> = {
filterOperatorOnOrAfter: 'е на или след',
filterOperatorBefore: 'е преди',
filterOperatorOnOrBefore: 'е на или преди',
filterPanelInputLabel: 'Стойност',
filterPanelInputPlaceholder: 'Стойност на филтъра',
// filterOperatorIsEmpty: 'is empty',
// filterOperatorIsNotEmpty: 'is not empty',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Меню',
columnMenuShowColumns: 'Покажи колоните',
Expand All @@ -81,8 +92,17 @@ const bgBGGrid: Partial<GridLocaleText> = {
footerTotalRows: 'Общо Rедове:',

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

// Checkbox selection text
// checkboxSelectionHeaderName: 'Checkbox selection',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
// actionsCellMore: 'more',
};

export const bgBG: Localization = getGridLocalization(bgBGGrid, bgBGCore);
15 changes: 14 additions & 1 deletion packages/grid/_modules_/grid/locales/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const deDEGrid: Partial<GridLocaleText> = {
toolbarExport: 'Exportieren',
toolbarExportLabel: 'Exportieren',
toolbarExportCSV: 'Download als CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Finde Spalte',
Expand All @@ -56,13 +57,18 @@ const deDEGrid: Partial<GridLocaleText> = {
filterOperatorEndsWith: 'endet mit',
filterOperatorIs: 'ist',
filterOperatorNot: 'ist nicht',
filterOperatorAfter: 'ist nach',
filterOperatorOnOrAfter: 'ist am oder nach',
filterOperatorBefore: 'ist vor',
filterOperatorOnOrBefore: 'ist am oder vor',
filterOperatorAfter: 'ist nach',
filterOperatorIsEmpty: 'ist leer',
filterOperatorIsNotEmpty: 'ist nicht leer',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Menü',
columnMenuShowColumns: 'Zeige alle Spalten',
Expand Down Expand Up @@ -91,6 +97,13 @@ const deDEGrid: Partial<GridLocaleText> = {
footerTotalVisibleRows: (visibleCount, totalCount) =>
`${visibleCount.toLocaleString()} von ${totalCount.toLocaleString()}`,

// Checkbox selection text
// checkboxSelectionHeaderName: 'Checkbox selection',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
actionsCellMore: 'Mehr',
};
Expand Down
13 changes: 13 additions & 0 deletions packages/grid/_modules_/grid/locales/elGR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const elGRGrid: Partial<GridLocaleText> = {
toolbarExport: 'Εξαγωγή',
toolbarExportLabel: 'Εξαγωγή',
toolbarExportCSV: 'Λήψη ως CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Εύρεση στήλης',
Expand Down Expand Up @@ -62,6 +63,11 @@ const elGRGrid: Partial<GridLocaleText> = {
filterOperatorIsEmpty: 'είναι κενό',
filterOperatorIsNotEmpty: 'δεν είναι κενό',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Μενού',
columnMenuShowColumns: 'Εμφάνιση στηλών',
Expand Down Expand Up @@ -90,6 +96,13 @@ const elGRGrid: Partial<GridLocaleText> = {
footerTotalVisibleRows: (visibleCount, totalCount) =>
`${visibleCount.toLocaleString()} από ${totalCount.toLocaleString()}`,

// Checkbox selection text
// checkboxSelectionHeaderName: 'Checkbox selection',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
actionsCellMore: 'περισσότερα',
};
Expand Down
13 changes: 13 additions & 0 deletions packages/grid/_modules_/grid/locales/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const esESGrid: Partial<GridLocaleText> = {
toolbarExport: 'Exportar',
toolbarExportLabel: 'Exportar',
toolbarExportCSV: 'Descargar como CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Columna de búsqueda',
Expand Down Expand Up @@ -63,6 +64,11 @@ const esESGrid: Partial<GridLocaleText> = {
filterOperatorIsEmpty: 'está vacío',
filterOperatorIsNotEmpty: 'no esta vacío',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Menú',
columnMenuShowColumns: 'Mostrar columnas',
Expand Down Expand Up @@ -91,6 +97,13 @@ const esESGrid: Partial<GridLocaleText> = {
footerTotalVisibleRows: (visibleCount, totalCount) =>
`${visibleCount.toLocaleString()} de ${totalCount.toLocaleString()}`,

// Checkbox selection text
// checkboxSelectionHeaderName: 'Checkbox selection',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
actionsCellMore: 'más',
};
Expand Down
4 changes: 1 addition & 3 deletions packages/grid/_modules_/grid/locales/faIR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const faIRGrid: Partial<GridLocaleText> = {
toolbarExport: 'خروجی',
toolbarExportLabel: 'خروجی',
toolbarExportCSV: 'دانلود به‌صورت CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'پیداکردن ستون',
Expand Down Expand Up @@ -105,9 +106,6 @@ const faIRGrid: Partial<GridLocaleText> = {

// Actions cell more text
actionsCellMore: 'بیشتر',

// Used core components translation keys
MuiTablePagination: {},
};

export const faIR: Localization = getGridLocalization(faIRGrid, faIRCore);
14 changes: 12 additions & 2 deletions packages/grid/_modules_/grid/locales/frFR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const frFRGrid: Partial<GridLocaleText> = {
toolbarExport: 'Exporter',
toolbarExportLabel: 'Exporter',
toolbarExportCSV: 'Télécharger en CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Chercher colonne',
Expand All @@ -56,13 +57,18 @@ const frFRGrid: Partial<GridLocaleText> = {
filterOperatorEndsWith: 'se termine par',
filterOperatorIs: 'est',
filterOperatorNot: "n'est pas",
filterOperatorOnOrAfter: 'égal ou postérieur',
filterOperatorAfter: 'postérieur',
filterOperatorOnOrBefore: 'égal ou antérieur',
filterOperatorOnOrAfter: 'égal ou postérieur',
filterOperatorBefore: 'antérieur',
filterOperatorOnOrBefore: 'égal ou antérieur',
filterOperatorIsEmpty: 'est vide',
filterOperatorIsNotEmpty: "n'est pas vide",

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Menu',
columnMenuShowColumns: 'Afficher les colonnes',
Expand Down Expand Up @@ -94,6 +100,10 @@ const frFRGrid: Partial<GridLocaleText> = {
// Checkbox selection text
checkboxSelectionHeaderName: 'Sélection',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
actionsCellMore: 'Plus',
};
Expand Down
12 changes: 6 additions & 6 deletions packages/grid/_modules_/grid/locales/heIL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ const heILGrid: Partial<GridLocaleText> = {
filterPanelInputLabel: 'ערך',
filterPanelInputPlaceholder: 'ערך מסנן',

// Filter values text
filterValueAny: 'כל ערך',
filterValueTrue: 'כן',
filterValueFalse: 'לא',

// Filter operators text
filterOperatorContains: 'מכיל',
filterOperatorEquals: 'שווה ל-',
filterOperatorStartsWith: 'מתחיל ב-',
filterOperatorEndsWith: 'נגמר ב-',
filterOperatorIs: 'הינו',
filterOperatorNot: 'אינו',
filterOperatorOnOrAfter: 'אחרי',
filterOperatorAfter: 'ב- או אחרי',
filterOperatorOnOrAfter: 'אחרי',
filterOperatorBefore: 'לפני',
filterOperatorOnOrBefore: 'ב- או לפני',
filterOperatorIsEmpty: 'ריק',
filterOperatorIsNotEmpty: 'אינו ריק',

// Filter values text
filterValueAny: 'כל ערך',
filterValueTrue: 'כן',
filterValueFalse: 'לא',

// Column menu text
columnMenuLabel: 'תפריט',
columnMenuShowColumns: 'הצג עמודות',
Expand Down
14 changes: 12 additions & 2 deletions packages/grid/_modules_/grid/locales/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const itITGrid: Partial<GridLocaleText> = {
toolbarExport: 'Esporta',
toolbarExportLabel: 'Esporta',
toolbarExportCSV: 'Esporta in CSV',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: 'Cerca colonna',
Expand All @@ -56,13 +57,18 @@ const itITGrid: Partial<GridLocaleText> = {
filterOperatorEndsWith: 'termina per',
filterOperatorIs: 'uguale a',
filterOperatorNot: 'diversa da',
filterOperatorOnOrAfter: 'a partire dal',
filterOperatorAfter: 'dopo il',
filterOperatorOnOrBefore: 'fino al',
filterOperatorOnOrAfter: 'a partire dal',
filterOperatorBefore: 'prima del',
filterOperatorOnOrBefore: 'fino al',
filterOperatorIsEmpty: 'è vuoto',
filterOperatorIsNotEmpty: 'non è vuoto',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'Menu',
columnMenuShowColumns: 'Mostra le colonne',
Expand Down Expand Up @@ -94,6 +100,10 @@ const itITGrid: Partial<GridLocaleText> = {
// Checkbox selection text
checkboxSelectionHeaderName: 'Seleziona',

// Boolean cell text
// booleanCellTrueLabel: 'true',
// booleanCellFalseLabel: 'false',

// Actions cell more text
actionsCellMore: 'più',
};
Expand Down
9 changes: 9 additions & 0 deletions packages/grid/_modules_/grid/locales/jaJP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const jaJPGrid: Partial<GridLocaleText> = {
toolbarExport: 'エクスポート',
toolbarExportLabel: 'エクスポート',
toolbarExportCSV: 'CSVダウンロード',
// toolbarExportPrint: 'Print',

// Columns panel text
columnsPanelTextFieldLabel: '列検索',
Expand Down Expand Up @@ -62,6 +63,11 @@ const jaJPGrid: Partial<GridLocaleText> = {
filterOperatorIsEmpty: '...空である',
filterOperatorIsNotEmpty: '...空でない',

// Filter values text
// filterValueAny: 'any',
// filterValueTrue: 'true',
// filterValueFalse: 'false',

// Column menu text
columnMenuLabel: 'メニュー',
columnMenuShowColumns: '列表示',
Expand Down Expand Up @@ -92,6 +98,9 @@ const jaJPGrid: Partial<GridLocaleText> = {
// Boolean cell text
booleanCellTrueLabel: '真',
booleanCellFalseLabel: '偽',

// Actions cell more text
// actionsCellMore: 'more',
};

export const jaJP: Localization = getGridLocalization(jaJPGrid, jaJPCore);
Loading