sveltekit-i18n
Advanced tools
Comparing version 1.5.0 to 1.5.1
{ | ||
"name": "sveltekit-i18n", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Internationalization library for SvelteKit", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -81,3 +81,3 @@ [![npm version](https://badge.fury.io/js/sveltekit-i18n.svg)](https://badge.fury.io/js/sveltekit-i18n) ![](https://github.com/jarda-svoboda/sveltekit-i18n/workflows/Tests/badge.svg) | ||
<script context="module"> | ||
import { loadTranslations } from '$lib/translations'; | ||
import { locale, loadTranslations } from '$lib/translations'; | ||
@@ -87,5 +87,8 @@ export const load = async ({ url }) => { | ||
const locale = 'en'; // get from cookie or user session... | ||
await loadTranslations(locale, pathname); | ||
const defaultLocale = 'en'; // get from cookie, user session, ... | ||
const initLocale = locale.get() || defaultLocale; // set default if no locale already set | ||
await loadTranslations(initLocale, pathname); | ||
return {}; | ||
@@ -92,0 +95,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15987
117