Skip to content

Commit 3d6fa5f

Browse files
authored
Use i18next-cli instead of i18next-parser (#1003)
Signed-off-by: Mikhail Aheichyk <[email protected]>
1 parent e05f7af commit 3d6fa5f

File tree

8 files changed

+583
-901
lines changed

8 files changed

+583
-901
lines changed

.changeset/warm-weeks-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@matrix-widget-toolkit/mui': patch
3+
---
4+
5+
Use i18next-cli instead of i18next-parser

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
run: yarn tsc
4444

4545
- name: check translations
46-
run: yarn translate --fail-on-update
46+
run: yarn translate --ci --dry-run
4747

4848
- name: test
4949
run: yarn test:all

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export default ts.config(
3636
'**/lib/**',
3737
'**/build/**',
3838
'**/craco.config.js',
39-
'**/i18next-parser.config.js',
4039
'scripts/prepack.js',
4140
'scripts/postpack.js',
4241
'scripts/publishAllPackages.js',
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 Nordeck IT + Consulting GmbH
2+
* Copyright 2025 Nordeck IT + Consulting GmbH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,11 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
const i18NextParserConfig = {
18-
locales: ['en', 'de'],
19-
output: 'src/locales/$LOCALE/$NAMESPACE.json',
20-
sort: true,
21-
resetDefaultValueLocale: 'en',
22-
};
17+
import { defineConfig } from 'i18next-cli';
2318

24-
export default i18NextParserConfig;
19+
export default defineConfig({
20+
locales: ['en', 'de'],
21+
extract: {
22+
input: 'src/**/*.{js,jsx,ts,tsx}',
23+
output: 'public/locales/{{language}}/{{namespace}}.json',
24+
},
25+
});

example-widget-mui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"build": "tsc && vite build",
3737
"test": "echo \"Tests have to run from root project\"",
3838
"depcheck": "depcheck --ignores=@types/node,@vitest/coverage-v8,lodash,lodash-es,@types/lodash-es --ignore-dirs=build",
39-
"translate": "i18next src/**/*.{ts,tsx}",
39+
"translate": "i18next-cli extract --sync-primary",
4040
"check-api-report": "echo \"Nothing to report\"",
4141
"generate-api-report": "echo \"Nothing to report\"",
4242
"clean": "yarn run clean:cache && yarn run clean:build",
@@ -69,7 +69,7 @@
6969
"@vitest/coverage-v8": "3.2.4",
7070
"axe-core": "4.10.3",
7171
"happy-dom": "20.0.2",
72-
"i18next-parser": "9.3.0",
72+
"i18next-cli": "^1.20.1",
7373
"msw": "2.10.4",
7474
"typescript": "5.8.3",
7575
"vite": "6.4.1",
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 Nordeck IT + Consulting GmbH
2+
* Copyright 2025 Nordeck IT + Consulting GmbH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,11 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
const i18NextParserConfig = {
18-
locales: ['en', 'de'],
19-
output: 'public/locales/$LOCALE/$NAMESPACE.json',
20-
sort: true,
21-
resetDefaultValueLocale: 'en',
22-
};
17+
import { defineConfig } from 'i18next-cli';
2318

24-
export default i18NextParserConfig;
19+
export default defineConfig({
20+
locales: ['en', 'de'],
21+
extract: {
22+
input: 'src/**/*.{js,jsx,ts,tsx}',
23+
output: 'src/locales/{{language}}/{{namespace}}.json',
24+
},
25+
});

packages/mui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@vitest/coverage-v8": "3.2.4",
2121
"axe-core": "4.10.3",
2222
"copyfiles": "2.4.1",
23-
"i18next-parser": "9.3.0",
23+
"i18next-cli": "^1.20.1",
2424
"typescript": "5.8.3",
2525
"vite": "6.4.1",
2626
"vitest": "3.2.4"
@@ -37,7 +37,7 @@
3737
"depcheck": "depcheck --ignores=@types/node,@vitest/coverage-v8,lodash,lodash-es,@types/lodash-es --ignore-dirs=lib,build",
3838
"prepack": "node ../../scripts/prepack.js",
3939
"postpack": "node ../../scripts/postpack.js",
40-
"translate": "i18next src/**/*.{ts,tsx}",
40+
"translate": "i18next-cli extract --sync-primary",
4141
"check-api-report": "api-extractor run --verbose",
4242
"generate-api-report": "tsc && api-extractor run --verbose --local",
4343
"clean": "yarn run clean:build",

0 commit comments

Comments
 (0)