Skip to content

2.0.0

Compare
Choose a tag to compare
@jarda-svoboda jarda-svoboda released this 17 Feb 01:03
· 216 commits to master since this release

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