i18next-cli 1.82.0 → 1.82.2
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/README.md +1 -1
- package/dist/cjs/cli.js +45 -10
- package/dist/cjs/extractor/core/translation-manager.js +7 -3
- package/dist/cjs/init.js +1 -1
- package/dist/cjs/linter.js +1 -1
- package/dist/cjs/rename-key.js +4 -3
- package/dist/cjs/utils/locize-funnel.js +1 -1
- package/dist/esm/cli.js +45 -10
- package/dist/esm/extractor/core/translation-manager.js +7 -3
- package/dist/esm/init.js +1 -1
- package/dist/esm/linter.js +1 -1
- package/dist/esm/rename-key.js +4 -3
- package/dist/esm/utils/locize-funnel.js +1 -1
- package/package.json +14 -14
- package/types/cli.d.ts.map +1 -1
- package/types/extractor/core/translation-manager.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ path, **"Translation backend?"** with three options, and last whether to
|
|
|
152
152
|
write a note for AI coding agents:
|
|
153
153
|
|
|
154
154
|
- **Local files only** (default) — keeps the current local-JSON workflow.
|
|
155
|
-
- **Locize** (
|
|
155
|
+
- **Locize** (by the i18next maintainers, for team / production workflows) — opens the
|
|
156
156
|
[Locize](https://www.locize.app) signup page in your browser and then
|
|
157
157
|
prompts for your Project ID and API key. The wizard writes a `locize`
|
|
158
158
|
block into the generated config so [`locize-sync`](#locize-integration)
|
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.82.
|
|
42
|
+
.version('1.82.2') // 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)');
|
|
@@ -93,21 +93,46 @@ program
|
|
|
93
93
|
// If in watch mode, set up the chokidar watcher
|
|
94
94
|
if (options.watch) {
|
|
95
95
|
console.log('\nWatching for changes...');
|
|
96
|
-
// expand configured input globs (keep original behavior for detection)
|
|
97
|
-
const expanded = await expandGlobs(config$1.extract.input);
|
|
98
96
|
// build ignore list (configured + derived from output template)
|
|
99
97
|
const configuredIgnore = toArray(config$1.extract.ignore);
|
|
100
98
|
const derivedIgnore = deriveOutputIgnore(config$1.extract.output);
|
|
101
99
|
const ignoreGlobs = [...configuredIgnore, ...derivedIgnore].filter(Boolean);
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
const
|
|
105
|
-
|
|
100
|
+
// Watch the static base folder of each input glob, not the files that exist at
|
|
101
|
+
// startup, so files created later are extracted and deleted ones drop their keys.
|
|
102
|
+
const inputGlobs = toArray(config$1.extract.input).map((g) => g.replace(/^\.\//, ''));
|
|
103
|
+
const isInput = (file) => {
|
|
104
|
+
const f = file.replace(/\\/g, '/');
|
|
105
|
+
return inputGlobs.some(g => minimatch.minimatch(f, g, { dot: true })) &&
|
|
106
|
+
!ignoreGlobs.some(g => minimatch.minimatch(f, g, { dot: true }));
|
|
107
|
+
};
|
|
108
|
+
const watcher = chokidar__default.default.watch(Array.from(new Set(inputGlobs.map(globBase))), {
|
|
109
|
+
ignored: (path, stats) => /node_modules/.test(path) || (!!stats?.isFile() && !isInput(path)),
|
|
110
|
+
ignoreInitial: true,
|
|
106
111
|
persistent: true,
|
|
107
112
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
// One extraction at a time: each run parses every input file, so overlapping runs
|
|
114
|
+
// (a branch switch touches hundreds of files) multiply memory and race on the
|
|
115
|
+
// output writes. Changes during a run trigger exactly one more run.
|
|
116
|
+
let running = false;
|
|
117
|
+
let rerun = false;
|
|
118
|
+
const scheduleExtract = async () => {
|
|
119
|
+
if (running) {
|
|
120
|
+
rerun = true;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
running = true;
|
|
124
|
+
do {
|
|
125
|
+
rerun = false;
|
|
126
|
+
await runExtract().catch(error => console.error('Error running extractor:', error));
|
|
127
|
+
} while (rerun);
|
|
128
|
+
running = false;
|
|
129
|
+
};
|
|
130
|
+
const labels = { add: 'added', change: 'changed', unlink: 'removed' };
|
|
131
|
+
watcher.on('all', (event, path) => {
|
|
132
|
+
if (!labels[event] || !isInput(path))
|
|
133
|
+
return;
|
|
134
|
+
console.log(`\nFile ${labels[event]}: ${path}`);
|
|
135
|
+
scheduleExtract();
|
|
111
136
|
});
|
|
112
137
|
}
|
|
113
138
|
}
|
|
@@ -424,6 +449,16 @@ const deriveOutputIgnore = (output) => {
|
|
|
424
449
|
return [];
|
|
425
450
|
return [output.replace(/\{\{[^}]+\}\}/g, '*')];
|
|
426
451
|
};
|
|
452
|
+
// static leading folder of a glob: 'src/**/*.ts' -> 'src'
|
|
453
|
+
const globBase = (pattern) => {
|
|
454
|
+
const parts = [];
|
|
455
|
+
for (const segment of pattern.split('/')) {
|
|
456
|
+
if (/[*?[\]{}()!]/.test(segment))
|
|
457
|
+
break;
|
|
458
|
+
parts.push(segment);
|
|
459
|
+
}
|
|
460
|
+
return parts.join('/') || '.';
|
|
461
|
+
};
|
|
427
462
|
// helper to expand one or many glob patterns
|
|
428
463
|
const expandGlobs = async (patterns = []) => {
|
|
429
464
|
const arr = toArray(patterns);
|
|
@@ -186,6 +186,10 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
186
186
|
// (e.g. "Loading..." would become { "Loading": { "": { "": "…" } } }) are stored flat.
|
|
187
187
|
// Every write goes through this, so plural and context variants land next to their base key.
|
|
188
188
|
const separatorFor = (key) => nestedObject.storedKeySeparator(key, keySeparator ?? '.', naturalLanguageRegex);
|
|
189
|
+
// A preserved key keeps the shape it has on disk: flat only when it is stored as a flat
|
|
190
|
+
// top-level key. Otherwise `{ "gearTypes": { "": "Unknown" } }` would be rewritten as a flat
|
|
191
|
+
// "gearTypes." key, because separatorFor stores every key with an empty segment flat.
|
|
192
|
+
const preservedSeparatorFor = (key) => Object.prototype.hasOwnProperty.call(existingTranslations, key) ? false : (keySeparator ?? '.');
|
|
189
193
|
// Build a set of base keys that accept context (only if preserveContextVariants is enabled)
|
|
190
194
|
// These are keys that were called with a context parameter in the source code
|
|
191
195
|
const keysAcceptingContext = new Set();
|
|
@@ -484,7 +488,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
484
488
|
const isContextVariant = !shouldPreserve && contextVariants.isContextVariantOfAcceptingKey(existingKey, keysAcceptingContext, pluralSeparator, contextSeparator);
|
|
485
489
|
if (shouldPreserve || (preserveContextVariants && isContextVariant)) {
|
|
486
490
|
const value = nestedObject.getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
487
|
-
nestedObject.setNestedValue(newTranslations, existingKey, value,
|
|
491
|
+
nestedObject.setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
488
492
|
}
|
|
489
493
|
}
|
|
490
494
|
// PROPAGATE CONTEXT VARIANTS FROM PRIMARY TO SECONDARY (issue #242):
|
|
@@ -553,7 +557,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
553
557
|
if (!isAlreadySet) {
|
|
554
558
|
// This plural form is NOT being generated by our code, so preserve it
|
|
555
559
|
const value = nestedObject.getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
556
|
-
nestedObject.setNestedValue(newTranslations, existingKey, value,
|
|
560
|
+
nestedObject.setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
557
561
|
}
|
|
558
562
|
}
|
|
559
563
|
}
|
|
@@ -578,7 +582,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
578
582
|
if (hasBaseInExtracted) {
|
|
579
583
|
// Preserve the existing _zero form
|
|
580
584
|
const value = nestedObject.getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
581
|
-
nestedObject.setNestedValue(newTranslations, existingKey, value,
|
|
585
|
+
nestedObject.setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
582
586
|
}
|
|
583
587
|
}
|
|
584
588
|
}
|
package/dist/cjs/init.js
CHANGED
|
@@ -126,7 +126,7 @@ async function runInit(options = {}) {
|
|
|
126
126
|
message: 'Translation backend?',
|
|
127
127
|
choices: [
|
|
128
128
|
{ name: 'Local files only', value: 'local' },
|
|
129
|
-
{ name: 'Locize (
|
|
129
|
+
{ name: 'Locize (by the i18next maintainers) — managed backend, CDN delivery, optional AI auto-translate', value: 'locize' },
|
|
130
130
|
{ name: 'Other / skip', value: 'other' },
|
|
131
131
|
],
|
|
132
132
|
default: 'local',
|
package/dist/cjs/linter.js
CHANGED
|
@@ -877,7 +877,7 @@ async function runLinterCli(config, options = {}) {
|
|
|
877
877
|
// translator or a tool: Locize runs the same check in its editor while they type.
|
|
878
878
|
// Gated like the other funnel messages (never in CI/non-TTY, 24h cooldown).
|
|
879
879
|
if (allIssues.some(i => i.type === 'placeholder') && await funnelMsgTracker.shouldShowFunnel('lint-placeholders')) {
|
|
880
|
-
log(`\n💡 Locize runs this placeholder check while translators type and can fix a mismatch with AI (sign up: ${LOCIZE_SIGNUP_URL})`);
|
|
880
|
+
log(`\n💡 Locize, built by the i18next maintainers, runs this placeholder check while translators type and can fix a mismatch with AI (sign up: ${LOCIZE_SIGNUP_URL})`);
|
|
881
881
|
await funnelMsgTracker.recordFunnelShown('lint-placeholders');
|
|
882
882
|
}
|
|
883
883
|
// Only errors fail the process; warning-only runs exit 0.
|
package/dist/cjs/rename-key.js
CHANGED
|
@@ -107,9 +107,10 @@ async function printLocizeFunnel() {
|
|
|
107
107
|
if (!(await funnelMsgTracker.shouldShowFunnel('rename-key')))
|
|
108
108
|
return;
|
|
109
109
|
console.log(node_util.styleText(['yellow', 'bold'], '\n💡 Tip: Managing translations across multiple projects?'));
|
|
110
|
-
console.log(' With Locize, you can rename, move,
|
|
111
|
-
console.log(' in the web interface—no CLI needed.
|
|
112
|
-
console.log(' translators and managing complex
|
|
110
|
+
console.log(' With Locize, built by the i18next maintainers, you can rename, move,');
|
|
111
|
+
console.log(' and copy translation keys directly in the web interface—no CLI needed.');
|
|
112
|
+
console.log(' Perfect for collaboration with translators and managing complex');
|
|
113
|
+
console.log(' refactoring across namespaces.');
|
|
113
114
|
console.log(` Learn more: ${node_util.styleText('cyan', 'https://www.locize.com/docs/how-can-a-segment-key-be-copied-moved-or-renamed')}`);
|
|
114
115
|
return funnelMsgTracker.recordFunnelShown('rename-key');
|
|
115
116
|
}
|
|
@@ -24,7 +24,7 @@ async function printUntranslatedFunnel(funnelKey, gaps, signupUrl, log = console
|
|
|
24
24
|
: `(${open.map(g => `${g.locale} ${g.untranslated}`).join(', ')})`;
|
|
25
25
|
const identical = open.reduce((sum, g) => sum + (g.identical ?? 0), 0);
|
|
26
26
|
const copied = identical ? `, ${identical} of them still identical to the primary language` : '';
|
|
27
|
-
log(`\n💡 ${total} untranslated key${total === 1 ? '' : 's'} ${where}${copied}.
|
|
27
|
+
log(`\n💡 ${total} untranslated key${total === 1 ? '' : 's'} ${where}${copied}. Locize, built by the i18next maintainers, translates them with AI in one command: ${node_util.styleText('cyan', 'npx i18next-cli localize')} (sign up: ${signupUrl})`);
|
|
28
28
|
return funnelMsgTracker.recordFunnelShown(funnelKey);
|
|
29
29
|
}
|
|
30
30
|
|
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.82.
|
|
36
|
+
.version('1.82.2') // 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)');
|
|
@@ -87,21 +87,46 @@ program
|
|
|
87
87
|
// If in watch mode, set up the chokidar watcher
|
|
88
88
|
if (options.watch) {
|
|
89
89
|
console.log('\nWatching for changes...');
|
|
90
|
-
// expand configured input globs (keep original behavior for detection)
|
|
91
|
-
const expanded = await expandGlobs(config.extract.input);
|
|
92
90
|
// build ignore list (configured + derived from output template)
|
|
93
91
|
const configuredIgnore = toArray(config.extract.ignore);
|
|
94
92
|
const derivedIgnore = deriveOutputIgnore(config.extract.output);
|
|
95
93
|
const ignoreGlobs = [...configuredIgnore, ...derivedIgnore].filter(Boolean);
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
94
|
+
// Watch the static base folder of each input glob, not the files that exist at
|
|
95
|
+
// startup, so files created later are extracted and deleted ones drop their keys.
|
|
96
|
+
const inputGlobs = toArray(config.extract.input).map((g) => g.replace(/^\.\//, ''));
|
|
97
|
+
const isInput = (file) => {
|
|
98
|
+
const f = file.replace(/\\/g, '/');
|
|
99
|
+
return inputGlobs.some(g => minimatch(f, g, { dot: true })) &&
|
|
100
|
+
!ignoreGlobs.some(g => minimatch(f, g, { dot: true }));
|
|
101
|
+
};
|
|
102
|
+
const watcher = chokidar.watch(Array.from(new Set(inputGlobs.map(globBase))), {
|
|
103
|
+
ignored: (path, stats) => /node_modules/.test(path) || (!!stats?.isFile() && !isInput(path)),
|
|
104
|
+
ignoreInitial: true,
|
|
100
105
|
persistent: true,
|
|
101
106
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
// One extraction at a time: each run parses every input file, so overlapping runs
|
|
108
|
+
// (a branch switch touches hundreds of files) multiply memory and race on the
|
|
109
|
+
// output writes. Changes during a run trigger exactly one more run.
|
|
110
|
+
let running = false;
|
|
111
|
+
let rerun = false;
|
|
112
|
+
const scheduleExtract = async () => {
|
|
113
|
+
if (running) {
|
|
114
|
+
rerun = true;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
running = true;
|
|
118
|
+
do {
|
|
119
|
+
rerun = false;
|
|
120
|
+
await runExtract().catch(error => console.error('Error running extractor:', error));
|
|
121
|
+
} while (rerun);
|
|
122
|
+
running = false;
|
|
123
|
+
};
|
|
124
|
+
const labels = { add: 'added', change: 'changed', unlink: 'removed' };
|
|
125
|
+
watcher.on('all', (event, path) => {
|
|
126
|
+
if (!labels[event] || !isInput(path))
|
|
127
|
+
return;
|
|
128
|
+
console.log(`\nFile ${labels[event]}: ${path}`);
|
|
129
|
+
scheduleExtract();
|
|
105
130
|
});
|
|
106
131
|
}
|
|
107
132
|
}
|
|
@@ -418,6 +443,16 @@ const deriveOutputIgnore = (output) => {
|
|
|
418
443
|
return [];
|
|
419
444
|
return [output.replace(/\{\{[^}]+\}\}/g, '*')];
|
|
420
445
|
};
|
|
446
|
+
// static leading folder of a glob: 'src/**/*.ts' -> 'src'
|
|
447
|
+
const globBase = (pattern) => {
|
|
448
|
+
const parts = [];
|
|
449
|
+
for (const segment of pattern.split('/')) {
|
|
450
|
+
if (/[*?[\]{}()!]/.test(segment))
|
|
451
|
+
break;
|
|
452
|
+
parts.push(segment);
|
|
453
|
+
}
|
|
454
|
+
return parts.join('/') || '.';
|
|
455
|
+
};
|
|
421
456
|
// helper to expand one or many glob patterns
|
|
422
457
|
const expandGlobs = async (patterns = []) => {
|
|
423
458
|
const arr = toArray(patterns);
|
|
@@ -184,6 +184,10 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
184
184
|
// (e.g. "Loading..." would become { "Loading": { "": { "": "…" } } }) are stored flat.
|
|
185
185
|
// Every write goes through this, so plural and context variants land next to their base key.
|
|
186
186
|
const separatorFor = (key) => storedKeySeparator(key, keySeparator ?? '.', naturalLanguageRegex);
|
|
187
|
+
// A preserved key keeps the shape it has on disk: flat only when it is stored as a flat
|
|
188
|
+
// top-level key. Otherwise `{ "gearTypes": { "": "Unknown" } }` would be rewritten as a flat
|
|
189
|
+
// "gearTypes." key, because separatorFor stores every key with an empty segment flat.
|
|
190
|
+
const preservedSeparatorFor = (key) => Object.prototype.hasOwnProperty.call(existingTranslations, key) ? false : (keySeparator ?? '.');
|
|
187
191
|
// Build a set of base keys that accept context (only if preserveContextVariants is enabled)
|
|
188
192
|
// These are keys that were called with a context parameter in the source code
|
|
189
193
|
const keysAcceptingContext = new Set();
|
|
@@ -482,7 +486,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
482
486
|
const isContextVariant = !shouldPreserve && isContextVariantOfAcceptingKey(existingKey, keysAcceptingContext, pluralSeparator, contextSeparator);
|
|
483
487
|
if (shouldPreserve || (preserveContextVariants && isContextVariant)) {
|
|
484
488
|
const value = getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
485
|
-
setNestedValue(newTranslations, existingKey, value,
|
|
489
|
+
setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
486
490
|
}
|
|
487
491
|
}
|
|
488
492
|
// PROPAGATE CONTEXT VARIANTS FROM PRIMARY TO SECONDARY (issue #242):
|
|
@@ -551,7 +555,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
551
555
|
if (!isAlreadySet) {
|
|
552
556
|
// This plural form is NOT being generated by our code, so preserve it
|
|
553
557
|
const value = getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
554
|
-
setNestedValue(newTranslations, existingKey, value,
|
|
558
|
+
setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
555
559
|
}
|
|
556
560
|
}
|
|
557
561
|
}
|
|
@@ -576,7 +580,7 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
576
580
|
if (hasBaseInExtracted) {
|
|
577
581
|
// Preserve the existing _zero form
|
|
578
582
|
const value = getNestedValue(existingTranslations, existingKey, keySeparator ?? '.');
|
|
579
|
-
setNestedValue(newTranslations, existingKey, value,
|
|
583
|
+
setNestedValue(newTranslations, existingKey, value, preservedSeparatorFor(existingKey));
|
|
580
584
|
}
|
|
581
585
|
}
|
|
582
586
|
}
|
package/dist/esm/init.js
CHANGED
|
@@ -124,7 +124,7 @@ async function runInit(options = {}) {
|
|
|
124
124
|
message: 'Translation backend?',
|
|
125
125
|
choices: [
|
|
126
126
|
{ name: 'Local files only', value: 'local' },
|
|
127
|
-
{ name: 'Locize (
|
|
127
|
+
{ name: 'Locize (by the i18next maintainers) — managed backend, CDN delivery, optional AI auto-translate', value: 'locize' },
|
|
128
128
|
{ name: 'Other / skip', value: 'other' },
|
|
129
129
|
],
|
|
130
130
|
default: 'local',
|
package/dist/esm/linter.js
CHANGED
|
@@ -875,7 +875,7 @@ async function runLinterCli(config, options = {}) {
|
|
|
875
875
|
// translator or a tool: Locize runs the same check in its editor while they type.
|
|
876
876
|
// Gated like the other funnel messages (never in CI/non-TTY, 24h cooldown).
|
|
877
877
|
if (allIssues.some(i => i.type === 'placeholder') && await shouldShowFunnel('lint-placeholders')) {
|
|
878
|
-
log(`\n💡 Locize runs this placeholder check while translators type and can fix a mismatch with AI (sign up: ${LOCIZE_SIGNUP_URL})`);
|
|
878
|
+
log(`\n💡 Locize, built by the i18next maintainers, runs this placeholder check while translators type and can fix a mismatch with AI (sign up: ${LOCIZE_SIGNUP_URL})`);
|
|
879
879
|
await recordFunnelShown('lint-placeholders');
|
|
880
880
|
}
|
|
881
881
|
// Only errors fail the process; warning-only runs exit 0.
|
package/dist/esm/rename-key.js
CHANGED
|
@@ -105,9 +105,10 @@ async function printLocizeFunnel() {
|
|
|
105
105
|
if (!(await shouldShowFunnel('rename-key')))
|
|
106
106
|
return;
|
|
107
107
|
console.log(styleText(['yellow', 'bold'], '\n💡 Tip: Managing translations across multiple projects?'));
|
|
108
|
-
console.log(' With Locize, you can rename, move,
|
|
109
|
-
console.log(' in the web interface—no CLI needed.
|
|
110
|
-
console.log(' translators and managing complex
|
|
108
|
+
console.log(' With Locize, built by the i18next maintainers, you can rename, move,');
|
|
109
|
+
console.log(' and copy translation keys directly in the web interface—no CLI needed.');
|
|
110
|
+
console.log(' Perfect for collaboration with translators and managing complex');
|
|
111
|
+
console.log(' refactoring across namespaces.');
|
|
111
112
|
console.log(` Learn more: ${styleText('cyan', 'https://www.locize.com/docs/how-can-a-segment-key-be-copied-moved-or-renamed')}`);
|
|
112
113
|
return recordFunnelShown('rename-key');
|
|
113
114
|
}
|
|
@@ -22,7 +22,7 @@ async function printUntranslatedFunnel(funnelKey, gaps, signupUrl, log = console
|
|
|
22
22
|
: `(${open.map(g => `${g.locale} ${g.untranslated}`).join(', ')})`;
|
|
23
23
|
const identical = open.reduce((sum, g) => sum + (g.identical ?? 0), 0);
|
|
24
24
|
const copied = identical ? `, ${identical} of them still identical to the primary language` : '';
|
|
25
|
-
log(`\n💡 ${total} untranslated key${total === 1 ? '' : 's'} ${where}${copied}.
|
|
25
|
+
log(`\n💡 ${total} untranslated key${total === 1 ? '' : 's'} ${where}${copied}. Locize, built by the i18next maintainers, translates them with AI in one command: ${styleText('cyan', 'npx i18next-cli localize')} (sign up: ${signupUrl})`);
|
|
26
26
|
return recordFunnelShown(funnelKey);
|
|
27
27
|
}
|
|
28
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18next-cli",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.2",
|
|
4
4
|
"description": "A unified, high-performance i18next CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"@rollup/plugin-terser": "^1.0.2",
|
|
57
57
|
"@rollup/plugin-typescript": "^12.3.1",
|
|
58
58
|
"@types/inquirer": "^9.0.10",
|
|
59
|
-
"@types/node": "^26.6.
|
|
59
|
+
"@types/node": "^26.6.6",
|
|
60
60
|
"@types/react": "^19.3.0",
|
|
61
|
-
"@typescript-eslint/parser": "^8.72.
|
|
62
|
-
"@vitest/coverage-v8": "^5.0
|
|
63
|
-
"eslint": "^
|
|
61
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
62
|
+
"@vitest/coverage-v8": "^5.1.0",
|
|
63
|
+
"eslint": "^10.14.0",
|
|
64
64
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
65
|
-
"eslint-plugin-import": "^
|
|
65
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
66
66
|
"memfs": "^4.80.0",
|
|
67
67
|
"neostandard": "^0.14.1",
|
|
68
68
|
"react": "^19.3.1",
|
|
69
|
-
"rollup": "^4.
|
|
69
|
+
"rollup": "^4.67.4",
|
|
70
70
|
"typescript": "^6.0.3",
|
|
71
71
|
"unplugin-swc": "^2.0.0",
|
|
72
|
-
"vitest": "^5.0
|
|
72
|
+
"vitest": "^5.1.0"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@croct/json5-parser": "^0.2.2",
|
|
@@ -78,19 +78,19 @@
|
|
|
78
78
|
"@inquirer/input": "^5.1.9",
|
|
79
79
|
"@inquirer/password": "^5.2.5",
|
|
80
80
|
"@inquirer/select": "^5.2.8",
|
|
81
|
-
"@swc/core": "^1.16.
|
|
81
|
+
"@swc/core": "^1.16.21",
|
|
82
82
|
"chokidar": "^5.0.0",
|
|
83
83
|
"commander": "^15.0.0",
|
|
84
|
-
"glob": "^
|
|
85
|
-
"i18next": "^26.
|
|
84
|
+
"glob": "^14.0.3",
|
|
85
|
+
"i18next": "^26.7.1",
|
|
86
86
|
"i18next-resources-for-ts": "^2.1.2",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
88
|
"jsonc-parser": "^3.3.1",
|
|
89
|
-
"magic-string": "^1.4.
|
|
89
|
+
"magic-string": "^1.4.5",
|
|
90
90
|
"messageformat": "^4.1.0",
|
|
91
|
-
"minimatch": "^
|
|
91
|
+
"minimatch": "^11.0.4",
|
|
92
92
|
"nano-spawn": "^2.1.0",
|
|
93
|
-
"react-i18next": "^17.1.
|
|
93
|
+
"react-i18next": "^17.1.11",
|
|
94
94
|
"yaml": "^2.9.1",
|
|
95
95
|
"yocto-spinner": "^1.2.2"
|
|
96
96
|
}
|
package/types/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqBnC,QAAA,MAAM,OAAO,SAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAqBnC,QAAA,MAAM,OAAO,SAAgB,CAAA;AAmhB7B,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/translation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"translation-manager.d.ts","sourceRoot":"","sources":["../../../src/extractor/core/translation-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAmtC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAC/B,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,MAAM,EAAE,oBAAoB,EAC5B,EACE,uBAA+B,EAC/B,OAAe,EACf,oBAA4B,EAC5B,MAA4B,EAC5B,YAAiB,EAClB,GAAE;IACD,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,GACL,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA6K9B"}
|