@kokimoki/app 3.1.1 → 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.
@@ -124,23 +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
- this.initPromise = this.instance.init({
128
- lng: language,
129
- fallbackLng,
130
- ns: namespaces,
131
- defaultNS,
132
- // Wait for backend to load translations before resolving
133
- initImmediate: false,
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);
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
+ },
139
140
  },
140
- },
141
- interpolation: {
142
- escapeValue: false,
143
- },
141
+ interpolation: {
142
+ escapeValue: false,
143
+ },
144
+ }, (err) => {
145
+ if (err) {
146
+ reject(err);
147
+ }
148
+ else {
149
+ resolve();
150
+ }
151
+ });
144
152
  });
145
153
  return this.initPromise;
146
154
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const KOKIMOKI_APP_VERSION = "3.1.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.1';
2
+ export const KOKIMOKI_APP_VERSION = '3.1.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokimoki/app",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "type": "module",
5
5
  "description": "Kokimoki app",
6
6
  "main": "dist/index.js",