i18next 23.1.0 → 23.2.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/esm/package.json +1 -1
- package/index.d.ts +23 -3
- package/package.json +1 -1
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"23.
|
|
1
|
+
{"type":"module","version":"23.2.0"}
|
package/index.d.ts
CHANGED
|
@@ -75,6 +75,12 @@ export type TypeOptions = $MergeBy<
|
|
|
75
75
|
*/
|
|
76
76
|
defaultNS: 'translation';
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Fallback namespace used if translation not found in given namespace
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
fallbackNS: false;
|
|
83
|
+
|
|
78
84
|
/**
|
|
79
85
|
* Json Format Version - V4 allows plural suffixes
|
|
80
86
|
*/
|
|
@@ -516,6 +522,7 @@ export interface InitOptions<T = object> extends PluginOptions<T> {
|
|
|
516
522
|
|
|
517
523
|
/**
|
|
518
524
|
* Returns an object that includes information about the used language, namespace, key and value
|
|
525
|
+
* @default false
|
|
519
526
|
*/
|
|
520
527
|
returnDetails?: boolean;
|
|
521
528
|
|
|
@@ -740,6 +747,7 @@ type _KeySeparator = TypeOptions['keySeparator'];
|
|
|
740
747
|
type _NsSeparator = TypeOptions['nsSeparator'];
|
|
741
748
|
type _PluralSeparator = TypeOptions['pluralSeparator'];
|
|
742
749
|
type _DefaultNamespace = TypeOptions['defaultNS'];
|
|
750
|
+
type _FallbackNamespace = TypeOptions['fallbackNS'];
|
|
743
751
|
type _Resources = TypeOptions['resources'];
|
|
744
752
|
type _JSONFormat = TypeOptions['jsonFormat'];
|
|
745
753
|
type _InterpolationPrefix = TypeOptions['interpolationPrefix'];
|
|
@@ -833,9 +841,21 @@ export type ParseKeys<
|
|
|
833
841
|
Keys extends $Dictionary = KeysByTOptions<TOpt>,
|
|
834
842
|
ActualNS extends Namespace = NsByTOptions<Ns, TOpt>,
|
|
835
843
|
> = $IsResourcesDefined extends true
|
|
836
|
-
?
|
|
837
|
-
|
|
838
|
-
|
|
844
|
+
? _FallbackNamespace extends false
|
|
845
|
+
?
|
|
846
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
847
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
848
|
+
: _FallbackNamespace extends Array<infer FallbackNs extends Namespace>
|
|
849
|
+
?
|
|
850
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
851
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<FallbackNs>], KPrefix>
|
|
852
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
853
|
+
| ParseKeysByNamespaces<FallbackNs, Keys>
|
|
854
|
+
:
|
|
855
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
856
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<_FallbackNamespace>], KPrefix>
|
|
857
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
858
|
+
| ParseKeysByNamespaces<_FallbackNamespace, Keys>
|
|
839
859
|
: string;
|
|
840
860
|
|
|
841
861
|
/*********************************************************
|