Skip to content

Latest commit

 

History

History
112 lines (73 loc) · 4.42 KB

CHANGELOG.md

File metadata and controls

112 lines (73 loc) · 4.42 KB

Changelog

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.0.4] - 2021-12-20

Fixed

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

[2.0.3] - 2020-09-04

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.

[2.0.2] - 2020-08-04

Changed

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

[2.0.1] - 2020-07-30

Changed

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

[2.0.0] - 2020-07-29

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

[1.2.0] - 2020-07-21

Added

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

[1.1.1] - 2020-04-05

Changed

  • getTranslationByKey uses the fallback language when provided.
  • Update the documentation.

[1.1.0] - 2020-04-04

Added

  • Provide a fallback language using the options.defaultLanguage property.
  • Translate all HTML attributes like title or placeholder, not only text.
  • Add the method getTranslationByKey to translate a single key programmatically.

Changed

  • Use cache to translate faster and save network data.
  • Print a warning message when a key was not found in the translation files. Thanks @andi34.

Dependencies

  • Bump eslint to 6.8.0

[1.0.0] - 2019-10-16

  • Initial release