i18next 23.1.0 → 23.2.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/esm/package.json +1 -1
- package/index.d.ts +23 -3
- package/package.json +3 -2
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"23.1
|
|
1
|
+
{"type":"module","version":"23.2.1"}
|
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 Array<infer FallbackNs extends Namespace>
|
|
845
|
+
?
|
|
846
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
847
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<FallbackNs>], KPrefix>
|
|
848
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
849
|
+
| ParseKeysByNamespaces<FallbackNs, Keys>
|
|
850
|
+
: _FallbackNamespace extends Namespace
|
|
851
|
+
?
|
|
852
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
853
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<_FallbackNamespace>], KPrefix>
|
|
854
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
855
|
+
| ParseKeysByNamespaces<_FallbackNamespace, Keys>
|
|
856
|
+
:
|
|
857
|
+
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
858
|
+
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
839
859
|
: string;
|
|
840
860
|
|
|
841
861
|
/*********************************************************
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "i18next",
|
|
3
|
-
"version": "23.1
|
|
3
|
+
"version": "23.2.1",
|
|
4
4
|
"description": "i18next internationalization framework",
|
|
5
5
|
"main": "./dist/cjs/i18next.js",
|
|
6
6
|
"module": "./dist/esm/i18next.js",
|
|
@@ -103,13 +103,14 @@
|
|
|
103
103
|
"watchify": "4.0.0"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
106
|
-
"pretest": "npm run test:typescript && npm run test:typescript:customtypes && npm run test:typescript:noninterop",
|
|
106
|
+
"pretest": "npm run test:typescript && npm run test:typescript:customtypes && npm run test:typescript:fallbacktypes && npm run test:typescript:noninterop",
|
|
107
107
|
"lint": "eslint src",
|
|
108
108
|
"test": "npm run lint && npm run test:new && npm run test:compat",
|
|
109
109
|
"test:new": "karma start karma.conf.js --singleRun",
|
|
110
110
|
"test:compat": "karma start karma.backward.conf.js --singleRun",
|
|
111
111
|
"test:typescript": "tslint --project tsconfig.json",
|
|
112
112
|
"test:typescript:customtypes": "tslint --project test/typescript/custom-types/tsconfig.json",
|
|
113
|
+
"test:typescript:fallbacktypes": "tslint --project test/typescript/fallback-types/tsconfig.json",
|
|
113
114
|
"test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json",
|
|
114
115
|
"tdd": "karma start karma.conf.js",
|
|
115
116
|
"tdd:compat": "karma start karma.backward.conf.js",
|