Skip to content

Releases: sveltekit-i18n/lib

2.1.3

06 Apr 22:51
Compare
Choose a tag to compare

Updated @sveltekit-i18n/base to version 1.1.2:

  • Fixed non-standard locale handling

Full Changelog: 2.1.2...2.1.3

2.1.2

31 Mar 23:39
Compare
Choose a tag to compare

Updated @sveltekit-i18n/parser-default to version 1.0.3:

  • Fixed date modifier

Full Changelog: 2.1.1...2.1.2

2.1.1

12 Mar 20:20
Compare
Choose a tag to compare

Updated @sveltekit-i18n/base to version 1.1.1:

  • Added config.debug

Full Changelog: 2.0.0...2.1.1

2.1.0

24 Feb 02:50
Compare
Choose a tag to compare

This release contains fixes related to locale setting and promises handling.

2.0.0

17 Feb 01:03
Compare
Choose a tag to compare

This major version provides the biggest changes under the hood. sveltekit-i18n library has been split into two – @sveltekit-i18n/base and @sveltekit-i18n/parser-default. This gives you more flexibility to use any message syntax you want by just including according parser.

However, this does not mean you have to start using @sveltekit-i18n/base and @sveltekit-i18n/parser-default libraries directly – you can keep using sveltekit-i18n if you like the default parser. From now, sveltekit-i18n automatically encapsulates the @sveltekit-i18n/base and @sveltekit-i18n/parser-default for you.

There is one change in sveltekit-i18n API, though. config.customModifiers is now config.parserOptions.customModifiers, so you should move your customModifiers under parserOptions object in your configuration. Besides that, no other changes in this release should affect your implementation.

  • config.customModifiers is now config.parserOptions.customModifiers
  • Added config.parserOptions.modifierDefaults to globally define default properties for built-in modifiers
  • Added modifier props$('your.translation', { payload: 'value' }, { modifier: 'props' }) so you can easily change properties of modifier directly from your .svelte files. This overrides config.parserOptions.modifierDefaults.
  • Added config.cache for cache management.
  • Improved built-in modifiers
  • Added CommonJS support (useful for testing for example)
  • Improved TS support
  • Fixed concurrent loading (#32)
  • Improved performance

Full Changelog: 1.5.4...2.0.0

1.5.4

04 Feb 22:28
Compare
Choose a tag to compare
  • Fixed locale propagation to modifiers when used with $l(locale, ... ) (originally, $locale was propagated instead of the given one)
  • Refactored source

Full Changelog: 1.5.3...1.5.4

1.5.3

17 Jan 23:25
Compare
Choose a tag to compare

What's Changed

For example:

$t('common.placeholder_unknown', { default: 'DYNAMIC_DEFAULT_VALUE' });

Also another translation (or variable) can be used as default:

$t(`error.${code}`, { default: $t('error.default') });

Full Changelog: 1.5.2...1.5.3

1.5.2

16 Jan 14:45
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.5.1...1.5.2

1.5.1

15 Jan 13:32
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.5.0...1.5.1

1.5.0

14 Jan 11:27
57780a1
Compare
Choose a tag to compare

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