@sveltekit-i18n/base 1.3.3 → 1.3.4
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/README.md +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,14 +85,13 @@ export const { t, locale, locales, loading, loadTranslations } = new i18n(config
|
|
|
85
85
|
...load your translations in `+layout.js`...
|
|
86
86
|
|
|
87
87
|
```js
|
|
88
|
-
import {
|
|
88
|
+
import { loadTranslations } from '$lib/translations';
|
|
89
89
|
|
|
90
|
+
/** @type {import('@sveltejs/kit').Load} */
|
|
90
91
|
export const load = async ({ url }) => {
|
|
91
92
|
const { pathname } = url;
|
|
92
93
|
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const initLocale = locale.get() || defaultLocale; // set default if no locale already set
|
|
94
|
+
const initLocale = 'en'; // get from cookie, user session, ...
|
|
96
95
|
|
|
97
96
|
await loadTranslations(initLocale, pathname); // keep this just before the `return`
|
|
98
97
|
|
package/package.json
CHANGED