Skip to content

i18nJS is a little javascript library just in time translation

Notifications You must be signed in to change notification settings

damianpumar/i18njs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i18n js translate is a just in time and lightweight translator for websites

Live demostration

www.fullcoders.com

Usage

  1. Add references i18njs into last line body tag.
    <script src="js/i18n.js"></script>
  2. Add "lang" class to the element you want to translate and the key with which you want to identify it.
    <h1 class="lang" key="key1">Hola</h1>
  3. Create your custom translate dictionary defined key/value translates, replacing "translation.js".
var languages = {
    'es': {
      "key1": "Hola",
      "key2": "Hola2"
      //etc
    }
    , 'en': {
      "key1": "Hello",
      "key2": "Hello2"
      //etc
    }
  };

**It is very important that you keep the folder structure.

Thanks!

About

i18nJS is a little javascript library just in time translation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published