Releases: andreasremdt/simple-translator
Releases · andreasremdt/simple-translator
v2.0.4 (2021-12-20)
Fixed
- Don't depend on the
localStorageAPI to exist in the environment. Ensures compatibility with Android WebView. #154 - @UshakovVasilii
v2.0.3 (2020-09-04)
Fixed
- The
currentLanguagegetter 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)
Changed
- Added compatibility for older browsers (including Safari 9) by using
Array.fromto convert a NodeList into an array.
v2.0.1 (2020-07-30)
Changed
- Added more CodeSandbox examples to the documentation's example section.
v2.0 (2020-07-29)
Breaking changes
- This release is a complete rewrite of the codebase.
- The methods
load()andgetTranslationByKey()have been removed in favor of a new API. Usefetch(),translateForKey(), andtranslatePageTo()instead. - The config option
languageshas been removed. - For more documentation on the new API, see the Usage section or the API Reference.
Added
- Added a config option
registerGloballythat, 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
persistKeythat specifies the name of the localStorage key. - Added a config option
debugthat, if set totrue, 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()andtranslatePageTo()to translate single keys or the entire website. - Added
get currentLanguageto 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
- The documentation has been updated and improved.
Removed
- The option
languageshas been removed. - The method
load()has been removed. - The method
getTranslationByKey()has been removed.
Dependencies
- Install
@babel/core@7.10.5, - Install
@babel/plugin-proposal-optional-chaining@7.10.4, - Install
@babel/plugin-transform-modules-commonjs@7.10.4, - Install
@babel/preset-env@7.10.4, - Install
@rollup/plugin-babel@5.1.0, - Install
eslint-config-google@0.14.0, - Install
eslint-config-prettier@6.11.0, - Install
husky@4.2.5, - Install
jest@26.1.0, - Install
npm-run-all@4.1.5, - Install
prettier@2.0.5, - Install
rollup@2.22.2, - Install
rollup-plugin-terser@6.1.0
v1.2 (2020-07-21)
Added
data-i18n-attrcan now translate multiple attributes by providing a space-separated list. Thanks @gwprice115.