@sveltebase/i18n 0.4.1 → 0.4.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/index.js +6 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -289,16 +289,15 @@ function createI18n(languages, localeStorageKey = DEFAULT_LOCALE_STORAGE_KEY) {
|
|
|
289
289
|
);
|
|
290
290
|
},
|
|
291
291
|
init(cookies) {
|
|
292
|
-
if (initialized) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
292
|
+
if (!initialized) {
|
|
293
|
+
const resolvedCookies = typeof cookies === "function" ? cookies() : cookies;
|
|
294
|
+
if (resolvedCookies) {
|
|
295
|
+
localeState.init(resolvedCookies);
|
|
296
|
+
}
|
|
297
|
+
initialized = true;
|
|
298
298
|
}
|
|
299
299
|
const { set } = ensureContext();
|
|
300
300
|
set(i18n);
|
|
301
|
-
initialized = true;
|
|
302
301
|
}
|
|
303
302
|
};
|
|
304
303
|
i18nInternals.set(i18n, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltebase/i18n",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sveltebase/state": "0.4.
|
|
21
|
+
"@sveltebase/state": "0.4.2",
|
|
22
22
|
"use-intl": "^4.4.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|