Skip to content

Releases: andreasremdt/simple-translator

v2.0.4 (2021-12-20)

20 Dec 13:14
Compare
Choose a tag to compare

Fixed

  • Don't depend on the localStorage API to exist in the environment. Ensures compatibility with Android WebView. #154 - @UshakovVasilii

v2.0.3 (2020-09-04)

04 Sep 11:13
Compare
Choose a tag to compare

Fixed

  • The currentLanguage getter now returns the correct language. If language detection is enabled, it will return the detected language by default or otherwise the default language.

v2.0.2 (2020-08-04)

04 Aug 09:39
78b5648
Compare
Choose a tag to compare

Changed

  • Added compatibility for older browsers (including Safari 9) by using Array.from to convert a NodeList into an array.

v2.0.1 (2020-07-30)

30 Jul 18:58
c8cba51
Compare
Choose a tag to compare

Changed

  • Added more CodeSandbox examples to the documentation's example section.

v2.0 (2020-07-29)

30 Jul 08:40
c520f57
Compare
Choose a tag to compare

Breaking changes

  • This release is a complete rewrite of the codebase.
  • The methods load() and getTranslationByKey() have been removed in favor of a new API. Use fetch(), translateForKey(), and translatePageTo() instead.
  • The config option languages has been removed.
  • For more documentation on the new API, see the Usage section or the API Reference.

Added

  • Added a config option registerGlobally that, if specified, registers a global helper with the same name as the given value. This allows you to translate single strings using shortcuts like __('header.title').
  • Added a config option persistKey that specifies the name of the localStorage key.
  • Added a config option debug that, if set to true, prints useful error messages.
  • Added fetch() for easier JSON fetching.
  • Added add() to register new languages to the translator.
  • Added remove() to remove languages from the translator.
  • Added translateForKey() and translatePageTo() to translate single keys or the entire website.
  • Added get currentLanguage to get the currently used language.
  • Transpiled and minified UMD, ESM and CJS builds are available via unpkg and npm.
  • Added a build system for easier packaging and testing.
  • Added CONTRIBUTING.md
  • Added CODE_OF_CONDUCT.md

Changed

Removed

  • The option languages has been removed.
  • The method load() has been removed.
  • The method getTranslationByKey() has been removed.

Dependencies

v1.2 (2020-07-21)

30 Jul 08:37
b6b623e
Compare
Choose a tag to compare

Added

  • data-i18n-attr can now translate multiple attributes by providing a space-separated list. Thanks @gwprice115.