jquery.localizationTool.js

今日は

Easy localization for one-page websites

Fully Featured

Keyboard Support, Tested, Compatible with IE7+, Mobile Devices, Desktops and Maintained with .

Dead Easy

Say you had to translate this:

                   <div id="hello">Hello</div>
                

Step 1: place the widget wherever you like.

                   <div id="widget" class="localizationTool"></div>
                

Step 2: translate.

                   $("#widget").localizationTool({
                       strings: {
                           "id:hello" : { 
                               it_IT : "Ciao",
                               de_DE : "Hallo",
                               fr_FR : "Salut"
                           }
                       }
                   });
this is the source string selector
translate!
translate!
translate!

Flexible

Select the text of DOM elements to translate directly via source string selectors:

by ID
id:hello
by CLASS
class:hello
by ELEMENT NAME
element:h2


You can use any text as well, and DOM elements will be extracted from the page automatically!

by whatever TEXT
Hello!


And from version 0.0.13, you can translate attributes as well!
Use <attributeName>::<id|class|element selector> to select attributes:

by ATTRIBUTE
placeholder::element:input

Customizable

Define your own languages!

                    $('#widget').localizationTool({
                     languages: {
                         
                         'myDialect' : {
                            language: 'Dialect',
                            country: 'Barletta',
                            languageTranslated: "Barlett'n",
                            countryTranslated: "Barli'tt",
                            flag: {
                                'url' : 'http://www.example.org/barlettaFlag.png'
                            }
                         }
                         
                     },
                     strings: {
                         'id:hello' : {
                             it_IT : 'Ciao',
                             de_DE : 'Hallo',
                             fr_FR : 'Salut',
                             myDialect : 'Wanná!'
                         }
                     }
                    });
                

Ambitious

This is the list of the currently supported languages/countries.

If you can't find your favourite language here, feel free to request it.

It would be great if you could contribute by indicating the followings:

  1. language code - pick from this list
  2. country code - pick from this list
  3. language name in English
  4. country name in English
  5. translated language name
  6. translated country name

Still not Convinced?

If you think something is missing, don't be shy, suggest a feature!

Go Get IT!

Start translating your one page website now.



JsDocs can be found in the "docs/" directory of the the repository.

comments powered by Disqus