i18next-cli 1.86.0 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ const program = new commander.Command();
|
|
|
39
39
|
program
|
|
40
40
|
.name('i18next-cli')
|
|
41
41
|
.description('A unified, high-performance i18next CLI.')
|
|
42
|
-
.version('1.
|
|
42
|
+
.version('1.87.0') // This string is replaced with the actual version at build time by rollup
|
|
43
43
|
.addHelpText('after', '\nUsing an AI coding agent? Install the i18next-localization skill: npx skills add i18next/i18next-cli\n');
|
|
44
44
|
// new: global config override option
|
|
45
45
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
@@ -1567,7 +1567,7 @@ function buildDynamicImportPath(outputTemplate, initDir) {
|
|
|
1567
1567
|
* The generated file's backend strategy depends on the project context:
|
|
1568
1568
|
* - React app without i18next.t() → `i18next-resources-to-backend` (async dynamic imports)
|
|
1569
1569
|
* - React app with i18next.t() → bundled resources (static imports, synchronous)
|
|
1570
|
-
* - Server-side (no React) → `i18next-fs-backend` (filesystem,
|
|
1570
|
+
* - Server-side (no React) → `i18next-fs-backend` (filesystem, initAsync: false + preload)
|
|
1571
1571
|
*/
|
|
1572
1572
|
async function ensureI18nInitFile(hasReact, hasTypeScript, config, logger, usesI18nextT) {
|
|
1573
1573
|
const cwd = process.cwd();
|
|
@@ -1625,7 +1625,7 @@ async function ensureI18nInitFile(hasReact, hasTypeScript, config, logger, usesI
|
|
|
1625
1625
|
*
|
|
1626
1626
|
* Decision logic:
|
|
1627
1627
|
* 1. Node.js server with filesystem → `fs-backend`
|
|
1628
|
-
* (synchronous with `
|
|
1628
|
+
* (synchronous with `initAsync: false` + `preload`)
|
|
1629
1629
|
* 2. Browser / edge / unknown with `i18next.t()` outside React components →
|
|
1630
1630
|
* `bundled-resources` (static imports so resources are available synchronously)
|
|
1631
1631
|
* 3. Otherwise → `resources-to-backend` (async dynamic imports, lazy-loaded)
|
|
@@ -1732,9 +1732,9 @@ function buildInitFileContent(opts) {
|
|
|
1732
1732
|
// ── .init() options ──
|
|
1733
1733
|
const initOpts = [];
|
|
1734
1734
|
if (strategy === 'fs-backend' && outputTemplate) {
|
|
1735
|
-
initOpts.push('
|
|
1735
|
+
initOpts.push(' initAsync: false,');
|
|
1736
1736
|
}
|
|
1737
|
-
initOpts.push(' returnEmptyString: false, //
|
|
1737
|
+
initOpts.push(' returnEmptyString: false, // an empty translation falls back (the default since i18next 27)');
|
|
1738
1738
|
initOpts.push(` // lng: '${config.locales.at(-1)}', // or add a language detector to detect the preferred language of your user`);
|
|
1739
1739
|
initOpts.push(` fallbackLng: '${primaryLang}',`);
|
|
1740
1740
|
if (defaultNS) {
|
package/dist/esm/cli.js
CHANGED
|
@@ -33,7 +33,7 @@ const program = new Command();
|
|
|
33
33
|
program
|
|
34
34
|
.name('i18next-cli')
|
|
35
35
|
.description('A unified, high-performance i18next CLI.')
|
|
36
|
-
.version('1.
|
|
36
|
+
.version('1.87.0') // This string is replaced with the actual version at build time by rollup
|
|
37
37
|
.addHelpText('after', '\nUsing an AI coding agent? Install the i18next-localization skill: npx skills add i18next/i18next-cli\n');
|
|
38
38
|
// new: global config override option
|
|
39
39
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
@@ -1565,7 +1565,7 @@ function buildDynamicImportPath(outputTemplate, initDir) {
|
|
|
1565
1565
|
* The generated file's backend strategy depends on the project context:
|
|
1566
1566
|
* - React app without i18next.t() → `i18next-resources-to-backend` (async dynamic imports)
|
|
1567
1567
|
* - React app with i18next.t() → bundled resources (static imports, synchronous)
|
|
1568
|
-
* - Server-side (no React) → `i18next-fs-backend` (filesystem,
|
|
1568
|
+
* - Server-side (no React) → `i18next-fs-backend` (filesystem, initAsync: false + preload)
|
|
1569
1569
|
*/
|
|
1570
1570
|
async function ensureI18nInitFile(hasReact, hasTypeScript, config, logger, usesI18nextT) {
|
|
1571
1571
|
const cwd = process.cwd();
|
|
@@ -1623,7 +1623,7 @@ async function ensureI18nInitFile(hasReact, hasTypeScript, config, logger, usesI
|
|
|
1623
1623
|
*
|
|
1624
1624
|
* Decision logic:
|
|
1625
1625
|
* 1. Node.js server with filesystem → `fs-backend`
|
|
1626
|
-
* (synchronous with `
|
|
1626
|
+
* (synchronous with `initAsync: false` + `preload`)
|
|
1627
1627
|
* 2. Browser / edge / unknown with `i18next.t()` outside React components →
|
|
1628
1628
|
* `bundled-resources` (static imports so resources are available synchronously)
|
|
1629
1629
|
* 3. Otherwise → `resources-to-backend` (async dynamic imports, lazy-loaded)
|
|
@@ -1730,9 +1730,9 @@ function buildInitFileContent(opts) {
|
|
|
1730
1730
|
// ── .init() options ──
|
|
1731
1731
|
const initOpts = [];
|
|
1732
1732
|
if (strategy === 'fs-backend' && outputTemplate) {
|
|
1733
|
-
initOpts.push('
|
|
1733
|
+
initOpts.push(' initAsync: false,');
|
|
1734
1734
|
}
|
|
1735
|
-
initOpts.push(' returnEmptyString: false, //
|
|
1735
|
+
initOpts.push(' returnEmptyString: false, // an empty translation falls back (the default since i18next 27)');
|
|
1736
1736
|
initOpts.push(` // lng: '${config.locales.at(-1)}', // or add a language detector to detect the preferred language of your user`);
|
|
1737
1737
|
initOpts.push(` fallbackLng: '${primaryLang}',`);
|
|
1738
1738
|
if (defaultNS) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18next-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.87.0",
|
|
4
4
|
"description": "A unified, high-performance i18next CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"chokidar": "^5.0.0",
|
|
83
83
|
"commander": "^15.0.0",
|
|
84
84
|
"glob": "^14.0.3",
|
|
85
|
-
"i18next": "^
|
|
85
|
+
"i18next": "^27.0.0",
|
|
86
86
|
"i18next-resources-for-ts": "^2.1.2",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
88
|
"jsonc-parser": "^3.3.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"messageformat": "^4.1.0",
|
|
91
91
|
"minimatch": "^11.0.4",
|
|
92
92
|
"nano-spawn": "^2.1.0",
|
|
93
|
-
"react-i18next": "^
|
|
93
|
+
"react-i18next": "^18.0.0",
|
|
94
94
|
"yaml": "^2.9.1",
|
|
95
95
|
"yocto-spinner": "^1.2.2"
|
|
96
96
|
}
|