Translato
Translato is a javascript library that helps to translate a html page into different languages with a previous defined JSON dictionary.
Installation
Install via NodeJS and NPM:
npm install translato --save
Usage
Example
API
translato.on({string} eventName, {function} callback)
- listen for events in translatotranslato.translateKeys({strings} keys...)
- translate keys, returns an array if multiple keys are giventranslato.translatePage()
- translate the whole pagetranslato.translateHTML({string} html)
- translate the given HTML stringtranslato.setLocale({string} languageKey, {boolean} translatePage?)
- language identifier, depends on dictionarytranslato.setDictionary({object} dictionary)
- set the whole dictionary for the translations
Events
translato.on("languageChanged", function)
- is fired when setLocale is executed