@kokimoki/app 3.1.0 → 3.1.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/dist/services/kokimoki-i18n.js +24 -14
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -124,21 +124,31 @@ export class KokimokiI18nService {
|
|
|
124
124
|
const namespaces = env.i18nNamespaces ?? [];
|
|
125
125
|
const fallbackLng = this.options.fallbackLng ?? language;
|
|
126
126
|
const defaultNS = this.options.defaultNS;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
// Wrap in a proper Promise to ensure we wait for backend loading
|
|
128
|
+
this.initPromise = new Promise((resolve, reject) => {
|
|
129
|
+
this.instance.init({
|
|
130
|
+
lng: language,
|
|
131
|
+
fallbackLng,
|
|
132
|
+
ns: namespaces,
|
|
133
|
+
defaultNS,
|
|
134
|
+
backend: {
|
|
135
|
+
// i18next-http-backend passes lng as array, extract first element
|
|
136
|
+
loadPath: (lngs, ns) => {
|
|
137
|
+
const lang = Array.isArray(lngs) ? lngs[0] : lngs;
|
|
138
|
+
return this.getNamespaceUrl(lang, ns);
|
|
139
|
+
},
|
|
137
140
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
141
|
+
interpolation: {
|
|
142
|
+
escapeValue: false,
|
|
143
|
+
},
|
|
144
|
+
}, (err) => {
|
|
145
|
+
if (err) {
|
|
146
|
+
reject(err);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
resolve();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
142
152
|
});
|
|
143
153
|
return this.initPromise;
|
|
144
154
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const KOKIMOKI_APP_VERSION = "3.1.
|
|
1
|
+
export declare const KOKIMOKI_APP_VERSION = "3.1.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated file. Do not edit manually.
|
|
2
|
-
export const KOKIMOKI_APP_VERSION = '3.1.
|
|
2
|
+
export const KOKIMOKI_APP_VERSION = '3.1.2';
|