Skip to content

1.5.0

Compare
Choose a tag to compare
@jarda-svoboda jarda-svoboda released this 14 Jan 11:27
· 339 commits to master since this release
57780a1

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 by setLocale 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