Releases: andreasremdt/simple-translator
Releases · andreasremdt/simple-translator
v2.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
v2.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.
v2.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.
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
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 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 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
- The documentation has been updated and improved.
Removed
- The option
languages
has been removed. - The method
load()
has been removed. - The method
getTranslationByKey()
has been removed.
Dependencies
- Install
@babel/[email protected]
, - Install
@babel/[email protected]
, - Install
@babel/[email protected]
, - Install
@babel/[email protected]
, - Install
@rollup/[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
, - Install
[email protected]
v1.2 (2020-07-21)
Added
data-i18n-attr
can now translate multiple attributes by providing a space-separated list. Thanks @gwprice115.