1.5.0
What's Changed
-
Added
get
method to$translations
and$locale
stores -
Added
config.translations
for synchronous sources -
Fixed translation key glitch when switching locales
-
Replaced
initLocale
bysetLocale
method. From now, you should prevent unwanted locale change (to default) while navigating like so:
<script context="module">
import { locale, loadTranslations } from '$lib/translations';
export const load = async ({ url }) => {
const { pathname } = url;
const defaultLocale = 'en';
const initLocale = locale.get() || defaultLocale; // set default only if no locale already set
await loadTranslations(initLocale, pathname);
return {};
}
</script>
Full Changelog: 1.4.0...1.5.0