i18next-cli 1.54.0 → 1.54.1
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
|
@@ -31,7 +31,7 @@ const program = new commander.Command();
|
|
|
31
31
|
program
|
|
32
32
|
.name('i18next-cli')
|
|
33
33
|
.description('A unified, high-performance i18next CLI.')
|
|
34
|
-
.version('1.54.
|
|
34
|
+
.version('1.54.1'); // This string is replaced with the actual version at build time by rollup
|
|
35
35
|
// new: global config override option
|
|
36
36
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
37
37
|
program
|
|
@@ -689,21 +689,27 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
689
689
|
else {
|
|
690
690
|
// Non-primary locale behavior
|
|
691
691
|
const isVariantKey = key.includes(pluralSeparator) || key.includes(contextSeparator);
|
|
692
|
+
const primaryDivergedFromDefault = Boolean(defaultValue$1 &&
|
|
693
|
+
!primaryShouldPreserveObject &&
|
|
694
|
+
(primaryExistingValue === undefined ||
|
|
695
|
+
primaryIsStaleObject ||
|
|
696
|
+
((!isVariantKey || explicitDefault) &&
|
|
697
|
+
primaryExistingValue !== defaultValue.resolveDefaultValue(defaultValue$1, key, namespace || config?.extract?.defaultNS || 'translation', primaryLanguage, defaultValue$1))));
|
|
698
|
+
const syncExplicitDefault = Boolean(syncAll &&
|
|
699
|
+
locale !== primaryLanguage &&
|
|
700
|
+
explicitDefault &&
|
|
701
|
+
primaryDivergedFromDefault);
|
|
692
702
|
const syncDerivedDefault = Boolean(syncAll &&
|
|
693
703
|
locale !== primaryLanguage &&
|
|
694
704
|
syncPrimaryWithDefaults &&
|
|
695
705
|
trustDerivedDefaults &&
|
|
696
706
|
defaultValue$1 &&
|
|
697
707
|
isDerivedDefault &&
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
if (syncAll && locale !== primaryLanguage && (explicitDefault || syncDerivedDefault)) {
|
|
704
|
-
// When syncAll is requested, clear (reset) any existing translations for keys
|
|
705
|
-
// that had explicit defaults in code so the primary default can be propagated
|
|
706
|
-
// while secondary locales get a blank/placeholder value.
|
|
708
|
+
primaryDivergedFromDefault);
|
|
709
|
+
if (syncAll && locale !== primaryLanguage && (syncExplicitDefault || syncDerivedDefault)) {
|
|
710
|
+
// When syncAll is requested and the primary value has actually diverged from the
|
|
711
|
+
// code-provided default, clear secondary translations so the new primary default
|
|
712
|
+
// can be propagated while secondary locales get a blank/placeholder value.
|
|
707
713
|
valueToSet = defaultValue.resolveDefaultValue(emptyDefaultValue, key, namespace || config?.extract?.defaultNS || 'translation', locale, defaultValue$1);
|
|
708
714
|
}
|
|
709
715
|
else {
|
package/dist/esm/cli.js
CHANGED
|
@@ -29,7 +29,7 @@ const program = new Command();
|
|
|
29
29
|
program
|
|
30
30
|
.name('i18next-cli')
|
|
31
31
|
.description('A unified, high-performance i18next CLI.')
|
|
32
|
-
.version('1.54.
|
|
32
|
+
.version('1.54.1'); // This string is replaced with the actual version at build time by rollup
|
|
33
33
|
// new: global config override option
|
|
34
34
|
program.option('-c, --config <path>', 'Path to i18next-cli config file (overrides detection)');
|
|
35
35
|
program
|
|
@@ -687,21 +687,27 @@ function buildNewTranslationsForNs(nsKeys, existingTranslations, config, locale,
|
|
|
687
687
|
else {
|
|
688
688
|
// Non-primary locale behavior
|
|
689
689
|
const isVariantKey = key.includes(pluralSeparator) || key.includes(contextSeparator);
|
|
690
|
+
const primaryDivergedFromDefault = Boolean(defaultValue &&
|
|
691
|
+
!primaryShouldPreserveObject &&
|
|
692
|
+
(primaryExistingValue === undefined ||
|
|
693
|
+
primaryIsStaleObject ||
|
|
694
|
+
((!isVariantKey || explicitDefault) &&
|
|
695
|
+
primaryExistingValue !== resolveDefaultValue(defaultValue, key, namespace || config?.extract?.defaultNS || 'translation', primaryLanguage, defaultValue))));
|
|
696
|
+
const syncExplicitDefault = Boolean(syncAll &&
|
|
697
|
+
locale !== primaryLanguage &&
|
|
698
|
+
explicitDefault &&
|
|
699
|
+
primaryDivergedFromDefault);
|
|
690
700
|
const syncDerivedDefault = Boolean(syncAll &&
|
|
691
701
|
locale !== primaryLanguage &&
|
|
692
702
|
syncPrimaryWithDefaults &&
|
|
693
703
|
trustDerivedDefaults &&
|
|
694
704
|
defaultValue &&
|
|
695
705
|
isDerivedDefault &&
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
if (syncAll && locale !== primaryLanguage && (explicitDefault || syncDerivedDefault)) {
|
|
702
|
-
// When syncAll is requested, clear (reset) any existing translations for keys
|
|
703
|
-
// that had explicit defaults in code so the primary default can be propagated
|
|
704
|
-
// while secondary locales get a blank/placeholder value.
|
|
706
|
+
primaryDivergedFromDefault);
|
|
707
|
+
if (syncAll && locale !== primaryLanguage && (syncExplicitDefault || syncDerivedDefault)) {
|
|
708
|
+
// When syncAll is requested and the primary value has actually diverged from the
|
|
709
|
+
// code-provided default, clear secondary translations so the new primary default
|
|
710
|
+
// can be propagated while secondary locales get a blank/placeholder value.
|
|
705
711
|
valueToSet = resolveDefaultValue(emptyDefaultValue, key, namespace || config?.extract?.defaultNS || 'translation', locale, defaultValue);
|
|
706
712
|
}
|
|
707
713
|
else {
|
package/package.json
CHANGED
|
@@ -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;AA88B9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAC7B,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,CAAA;CACX,GACL,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiK9B"}
|