To start, download and insert the "auto_translate.js" file at the bottom of your HTML page
<script src="./auto_translate.js"></script>
Then, on a "div" or the "body" at the top of the page, add the id "trlInit" and data-trlfrom = "" and data-trlto = "".
<div id="trlInit" data-trlfrom="" data-trlto=""></div>
In "data-trlfrom" enter the language of your page and in "data-trlto" enter in which language you want to translate it.
The list of languages is :
- English = 'eng'
- French = 'fra'
- Arabic = 'ara'
- Chinese = 'chi'
- Dutch = 'dut'
- German = 'ger'
- Hebrew = 'heb'
- Italian = 'ita'
- Japanese = 'jpn'
- Polish = 'pol'
- Portuguese = 'por'
- Romanian = 'rum'
- Russian = 'rus'
- Spanish = 'spa'
- Turkish = 'tur'
<div id="trlInit" data-trlfrom="eng" data-trlto="fra"></div>
Finally add the class "trlText" on all the tags containing text
<p class="trlText">Hello<p>
<p class="trlText">I love cat<p>
<p class="trlText">I am tired<p>
The plugin works the same way with the input placeholders
<input class="trlText" type="text" placeholder="Hello" >
This plugin use Reverso API