Skip to content

Commit d826fc7

Browse files
authored
[core] Add script to sync translation files (#3201)
1 parent 53a387a commit d826fc7

24 files changed

+571
-36
lines changed

.circleci/config.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ jobs:
114114
- save_cache:
115115
key: v6-yarn-sha-{{ checksum "yarn.lock" }}
116116
paths:
117-
# Keep path in sync with "Set yarn cache folder"
118-
# 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)
117+
# Keep path in sync with "Set yarn cache folder"
118+
# 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)
119119
- ~/.cache/yarn
120120
test_unit:
121121
<<: *defaults
@@ -161,6 +161,12 @@ jobs:
161161
- run:
162162
name: '`yarn docs:api` changes committed?'
163163
command: git diff --exit-code
164+
- run:
165+
name: Sync locale files
166+
command: yarn l10n
167+
- run:
168+
name: '`yarn l10n` changes committed?'
169+
command: git diff --exit-code
164170
test_browser:
165171
<<: *defaults
166172
docker:

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"storybook:build": "yarn workspace storybook build",
1818
"storybook:export": "yarn workspace storybook export",
1919
"deduplicate": "node scripts/deduplicate.js",
20+
"l10n": "babel-node -x .ts ./scripts/l10n.ts",
2021
"stylelint": "stylelint '**/*.js' '**/*.ts' '**/*.tsx'",
2122
"prettier": "node ./scripts/prettier.js --branch next",
2223
"prettier:all": "node ./scripts/prettier.js write",
@@ -58,6 +59,8 @@
5859
"@babel/plugin-transform-runtime": "^7.16.4",
5960
"@babel/register": "^7.16.0",
6061
"@babel/runtime": "^7.16.3",
62+
"@babel/traverse": "^7.16.3",
63+
"@babel/types": "^7.16.0",
6164
"@emotion/cache": "^11.6.0",
6265
"@emotion/react": "^11.6.0",
6366
"@emotion/styled": "^11.6.0",
@@ -71,6 +74,7 @@
7174
"@rollup/plugin-node-resolve": "^13.0.6",
7275
"@rollup/plugin-replace": "^3.0.0",
7376
"@testing-library/react": "^12.1.2",
77+
"@types/babel__core": "^7.1.16",
7478
"@types/chai": "^4.2.22",
7579
"@types/chai-dom": "^0.0.11",
7680
"@types/enzyme": "^3.10.10",

packages/grid/_modules_/grid/locales/arSD.ts

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const arSDGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'تصدير',
3232
toolbarExportLabel: 'تصدير',
3333
toolbarExportCSV: 'تنزيل كملف CSV',
34+
// toolbarExportPrint: 'Print',
3435

3536
// Columns panel text
3637
columnsPanelTextFieldLabel: 'ايجاد عمود',

packages/grid/_modules_/grid/locales/bgBG.ts

+26-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const bgBGGrid: Partial<GridLocaleText> = {
1515
toolbarDensityStandard: 'Стандартна',
1616
toolbarDensityComfortable: 'Комфортна',
1717

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

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

29-
// GridColumns panel text
29+
// Export selector toolbar button text
30+
// toolbarExport: 'Export',
31+
// toolbarExportLabel: 'Export',
32+
// toolbarExportCSV: 'Download as CSV',
33+
// toolbarExportPrint: 'Print',
34+
35+
// Columns panel text
3036
columnsPanelTextFieldLabel: 'Намери колона',
3137
columnsPanelTextFieldPlaceholder: 'Заглавие на колона',
3238
columnsPanelDragIconLabel: 'Пренареди на колона',
@@ -40,6 +46,8 @@ const bgBGGrid: Partial<GridLocaleText> = {
4046
filterPanelOperatorAnd: 'И',
4147
filterPanelOperatorOr: 'Или',
4248
filterPanelColumns: 'Колони',
49+
filterPanelInputLabel: 'Стойност',
50+
filterPanelInputPlaceholder: 'Стойност на филтъра',
4351

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

66+
// Filter values text
67+
// filterValueAny: 'any',
68+
// filterValueTrue: 'true',
69+
// filterValueFalse: 'false',
70+
6071
// Column menu text
6172
columnMenuLabel: 'Меню',
6273
columnMenuShowColumns: 'Покажи колоните',
@@ -81,8 +92,17 @@ const bgBGGrid: Partial<GridLocaleText> = {
8192
footerTotalRows: 'Общо Rедове:',
8293

8394
// Total visible rows footer text
84-
// footerTotalVisibleRows: (visibleCount, totalCount) =>
85-
// `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`,
95+
// footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`,
96+
97+
// Checkbox selection text
98+
// checkboxSelectionHeaderName: 'Checkbox selection',
99+
100+
// Boolean cell text
101+
// booleanCellTrueLabel: 'true',
102+
// booleanCellFalseLabel: 'false',
103+
104+
// Actions cell more text
105+
// actionsCellMore: 'more',
86106
};
87107

88108
export const bgBG: Localization = getGridLocalization(bgBGGrid, bgBGCore);

packages/grid/_modules_/grid/locales/deDE.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const deDEGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'Exportieren',
3232
toolbarExportLabel: 'Exportieren',
3333
toolbarExportCSV: 'Download als CSV',
34+
// toolbarExportPrint: 'Print',
3435

3536
// Columns panel text
3637
columnsPanelTextFieldLabel: 'Finde Spalte',
@@ -56,13 +57,18 @@ const deDEGrid: Partial<GridLocaleText> = {
5657
filterOperatorEndsWith: 'endet mit',
5758
filterOperatorIs: 'ist',
5859
filterOperatorNot: 'ist nicht',
60+
filterOperatorAfter: 'ist nach',
5961
filterOperatorOnOrAfter: 'ist am oder nach',
6062
filterOperatorBefore: 'ist vor',
6163
filterOperatorOnOrBefore: 'ist am oder vor',
62-
filterOperatorAfter: 'ist nach',
6364
filterOperatorIsEmpty: 'ist leer',
6465
filterOperatorIsNotEmpty: 'ist nicht leer',
6566

67+
// Filter values text
68+
// filterValueAny: 'any',
69+
// filterValueTrue: 'true',
70+
// filterValueFalse: 'false',
71+
6672
// Column menu text
6773
columnMenuLabel: 'Menü',
6874
columnMenuShowColumns: 'Zeige alle Spalten',
@@ -91,6 +97,13 @@ const deDEGrid: Partial<GridLocaleText> = {
9197
footerTotalVisibleRows: (visibleCount, totalCount) =>
9298
`${visibleCount.toLocaleString()} von ${totalCount.toLocaleString()}`,
9399

100+
// Checkbox selection text
101+
// checkboxSelectionHeaderName: 'Checkbox selection',
102+
103+
// Boolean cell text
104+
// booleanCellTrueLabel: 'true',
105+
// booleanCellFalseLabel: 'false',
106+
94107
// Actions cell more text
95108
actionsCellMore: 'Mehr',
96109
};

packages/grid/_modules_/grid/locales/elGR.ts

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const elGRGrid: Partial<GridLocaleText> = {
3030
toolbarExport: 'Εξαγωγή',
3131
toolbarExportLabel: 'Εξαγωγή',
3232
toolbarExportCSV: 'Λήψη ως CSV',
33+
// toolbarExportPrint: 'Print',
3334

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

66+
// Filter values text
67+
// filterValueAny: 'any',
68+
// filterValueTrue: 'true',
69+
// filterValueFalse: 'false',
70+
6571
// Column menu text
6672
columnMenuLabel: 'Μενού',
6773
columnMenuShowColumns: 'Εμφάνιση στηλών',
@@ -90,6 +96,13 @@ const elGRGrid: Partial<GridLocaleText> = {
9096
footerTotalVisibleRows: (visibleCount, totalCount) =>
9197
`${visibleCount.toLocaleString()} από ${totalCount.toLocaleString()}`,
9298

99+
// Checkbox selection text
100+
// checkboxSelectionHeaderName: 'Checkbox selection',
101+
102+
// Boolean cell text
103+
// booleanCellTrueLabel: 'true',
104+
// booleanCellFalseLabel: 'false',
105+
93106
// Actions cell more text
94107
actionsCellMore: 'περισσότερα',
95108
};

packages/grid/_modules_/grid/locales/esES.ts

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const esESGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'Exportar',
3232
toolbarExportLabel: 'Exportar',
3333
toolbarExportCSV: 'Descargar como CSV',
34+
// toolbarExportPrint: 'Print',
3435

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

67+
// Filter values text
68+
// filterValueAny: 'any',
69+
// filterValueTrue: 'true',
70+
// filterValueFalse: 'false',
71+
6672
// Column menu text
6773
columnMenuLabel: 'Menú',
6874
columnMenuShowColumns: 'Mostrar columnas',
@@ -91,6 +97,13 @@ const esESGrid: Partial<GridLocaleText> = {
9197
footerTotalVisibleRows: (visibleCount, totalCount) =>
9298
`${visibleCount.toLocaleString()} de ${totalCount.toLocaleString()}`,
9399

100+
// Checkbox selection text
101+
// checkboxSelectionHeaderName: 'Checkbox selection',
102+
103+
// Boolean cell text
104+
// booleanCellTrueLabel: 'true',
105+
// booleanCellFalseLabel: 'false',
106+
94107
// Actions cell more text
95108
actionsCellMore: 'más',
96109
};

packages/grid/_modules_/grid/locales/faIR.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const faIRGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'خروجی',
3232
toolbarExportLabel: 'خروجی',
3333
toolbarExportCSV: 'دانلود به‌صورت CSV',
34+
// toolbarExportPrint: 'Print',
3435

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

106107
// Actions cell more text
107108
actionsCellMore: 'بیشتر',
108-
109-
// Used core components translation keys
110-
MuiTablePagination: {},
111109
};
112110

113111
export const faIR: Localization = getGridLocalization(faIRGrid, faIRCore);

packages/grid/_modules_/grid/locales/frFR.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const frFRGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'Exporter',
3232
toolbarExportLabel: 'Exporter',
3333
toolbarExportCSV: 'Télécharger en CSV',
34+
// toolbarExportPrint: 'Print',
3435

3536
// Columns panel text
3637
columnsPanelTextFieldLabel: 'Chercher colonne',
@@ -56,13 +57,18 @@ const frFRGrid: Partial<GridLocaleText> = {
5657
filterOperatorEndsWith: 'se termine par',
5758
filterOperatorIs: 'est',
5859
filterOperatorNot: "n'est pas",
59-
filterOperatorOnOrAfter: 'égal ou postérieur',
6060
filterOperatorAfter: 'postérieur',
61-
filterOperatorOnOrBefore: 'égal ou antérieur',
61+
filterOperatorOnOrAfter: 'égal ou postérieur',
6262
filterOperatorBefore: 'antérieur',
63+
filterOperatorOnOrBefore: 'égal ou antérieur',
6364
filterOperatorIsEmpty: 'est vide',
6465
filterOperatorIsNotEmpty: "n'est pas vide",
6566

67+
// Filter values text
68+
// filterValueAny: 'any',
69+
// filterValueTrue: 'true',
70+
// filterValueFalse: 'false',
71+
6672
// Column menu text
6773
columnMenuLabel: 'Menu',
6874
columnMenuShowColumns: 'Afficher les colonnes',
@@ -94,6 +100,10 @@ const frFRGrid: Partial<GridLocaleText> = {
94100
// Checkbox selection text
95101
checkboxSelectionHeaderName: 'Sélection',
96102

103+
// Boolean cell text
104+
// booleanCellTrueLabel: 'true',
105+
// booleanCellFalseLabel: 'false',
106+
97107
// Actions cell more text
98108
actionsCellMore: 'Plus',
99109
};

packages/grid/_modules_/grid/locales/heIL.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@ const heILGrid: Partial<GridLocaleText> = {
4949
filterPanelInputLabel: 'ערך',
5050
filterPanelInputPlaceholder: 'ערך מסנן',
5151

52-
// Filter values text
53-
filterValueAny: 'כל ערך',
54-
filterValueTrue: 'כן',
55-
filterValueFalse: 'לא',
56-
5752
// Filter operators text
5853
filterOperatorContains: 'מכיל',
5954
filterOperatorEquals: 'שווה ל-',
6055
filterOperatorStartsWith: 'מתחיל ב-',
6156
filterOperatorEndsWith: 'נגמר ב-',
6257
filterOperatorIs: 'הינו',
6358
filterOperatorNot: 'אינו',
64-
filterOperatorOnOrAfter: 'אחרי',
6559
filterOperatorAfter: 'ב- או אחרי',
60+
filterOperatorOnOrAfter: 'אחרי',
6661
filterOperatorBefore: 'לפני',
6762
filterOperatorOnOrBefore: 'ב- או לפני',
6863
filterOperatorIsEmpty: 'ריק',
6964
filterOperatorIsNotEmpty: 'אינו ריק',
7065

66+
// Filter values text
67+
filterValueAny: 'כל ערך',
68+
filterValueTrue: 'כן',
69+
filterValueFalse: 'לא',
70+
7171
// Column menu text
7272
columnMenuLabel: 'תפריט',
7373
columnMenuShowColumns: 'הצג עמודות',

packages/grid/_modules_/grid/locales/itIT.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const itITGrid: Partial<GridLocaleText> = {
3131
toolbarExport: 'Esporta',
3232
toolbarExportLabel: 'Esporta',
3333
toolbarExportCSV: 'Esporta in CSV',
34+
// toolbarExportPrint: 'Print',
3435

3536
// Columns panel text
3637
columnsPanelTextFieldLabel: 'Cerca colonna',
@@ -56,13 +57,18 @@ const itITGrid: Partial<GridLocaleText> = {
5657
filterOperatorEndsWith: 'termina per',
5758
filterOperatorIs: 'uguale a',
5859
filterOperatorNot: 'diversa da',
59-
filterOperatorOnOrAfter: 'a partire dal',
6060
filterOperatorAfter: 'dopo il',
61-
filterOperatorOnOrBefore: 'fino al',
61+
filterOperatorOnOrAfter: 'a partire dal',
6262
filterOperatorBefore: 'prima del',
63+
filterOperatorOnOrBefore: 'fino al',
6364
filterOperatorIsEmpty: 'è vuoto',
6465
filterOperatorIsNotEmpty: 'non è vuoto',
6566

67+
// Filter values text
68+
// filterValueAny: 'any',
69+
// filterValueTrue: 'true',
70+
// filterValueFalse: 'false',
71+
6672
// Column menu text
6773
columnMenuLabel: 'Menu',
6874
columnMenuShowColumns: 'Mostra le colonne',
@@ -94,6 +100,10 @@ const itITGrid: Partial<GridLocaleText> = {
94100
// Checkbox selection text
95101
checkboxSelectionHeaderName: 'Seleziona',
96102

103+
// Boolean cell text
104+
// booleanCellTrueLabel: 'true',
105+
// booleanCellFalseLabel: 'false',
106+
97107
// Actions cell more text
98108
actionsCellMore: 'più',
99109
};

packages/grid/_modules_/grid/locales/jaJP.ts

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const jaJPGrid: Partial<GridLocaleText> = {
3030
toolbarExport: 'エクスポート',
3131
toolbarExportLabel: 'エクスポート',
3232
toolbarExportCSV: 'CSVダウンロード',
33+
// toolbarExportPrint: 'Print',
3334

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

66+
// Filter values text
67+
// filterValueAny: 'any',
68+
// filterValueTrue: 'true',
69+
// filterValueFalse: 'false',
70+
6571
// Column menu text
6672
columnMenuLabel: 'メニュー',
6773
columnMenuShowColumns: '列表示',
@@ -92,6 +98,9 @@ const jaJPGrid: Partial<GridLocaleText> = {
9298
// Boolean cell text
9399
booleanCellTrueLabel: '真',
94100
booleanCellFalseLabel: '偽',
101+
102+
// Actions cell more text
103+
// actionsCellMore: 'more',
95104
};
96105

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

0 commit comments

Comments
 (0)