Add the following script tags at the end of the HTML body:
<script src="js/parrot.js"></script>
<script>
parrot.init();
</script>
To add a translation, add the attribute data-i18n with a key value:
<p data-i18n="KEY">this will be translated</p>
To change language call:
parrot.load('en'); // language shortcode: en, sv etc.
This will load the translation from the server @ i18n/en.json and update
the page
{ "KEY": "translation" }
Special key postfixes:
<a href="url..." title="translated" data-i18n="KEY__TITLE">not
translated</a> // __TITLE only sets title
<p
data-i18n="KEY__REPLACE"><span>text<span></p> //
__REPLACE replaces everything inside tag with data-i18n attribute
You can download Parrot
here.