Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Auto Translate Javascript | Version 0.5.1

How it works ?

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" >

Enjoy !



This plugin use Reverso API

About

A Javascript plugin to automatically translate your HTML page into several languages

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages