Download
Demo
- Overview
- Documents
User Rating: 0/5 ( 0 votes)
Your Rating:
jQuery Localization Tool is a simple localization dropdown for your website. Translates strings in the languages you provide. This widget is built with the single page scenario in mind. It supports right-to-left text direction when languages like Arabic are selected.
Fully Featured
Keyboard Support, Tested, Compatible with IE7+, Mobile Devices, Desktops and Maintained with ❤.
Source: darksmo.github.io
1. INCLUDE CSS AND JS FILES
<link type="text/css" rel="stylesheet" href="/dist/jquery.localizationTool.css"> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="/src/jquery.localizationTool.js"></script>
Make sure UTF-8 encoding is specified
<meta charset="utf-8">
2. HTML
<div id="localizationToolbar"></div> <div id="someId">Original string goes here</div>
3. JAVASCRIPT
$("#localizationToolbar").localizationTool({ strings : { 'id:someId': { 'it_IT' : 'Italian translation here', 'de_DE' : 'German translation here', 'fr_FR' : 'French translation here', 'es_ES' : 'Spanish translation here', 'en_AU' : 'Australian english translation here', 'br_PT' : 'Portuguese translation here', 'en_GB' : 'British english translation here', 'jp_JP' : 'Japanese translation here', 'ar_TN' : 'Arabic translation here', }, /* ... more strings can follow */ } });
Destroy with:
$("#localizationToolbar").localizationTool('destroy');
4. OPTIONS
Option | Type | Default | Description |
---|---|---|---|
defaultLanguage | string | en_GB | the language_country code the page to translate is initially in. |
languages | object | {} | additional/custom language definitions |
strings | object | {} | pointers to the original strings and their translations in various languages |
showFlag | boolean | true | whether to show the flag on the widget |
showLanguage | boolean | true | whether to show the language name on the widget |
showCountry | boolean | true | whether to show the country name on the widget |
5. METHODS
Method | Argument | Description |
---|---|---|
translate | string (languageCode) | translates the text in the given language programmatically |
destroy | None | destroys the localization tool |
6. AMBITIOUS
This is the list of the currently supported languages/countries.
-
en_GB - United Kingdom (English)United Kingdom (English)
-
de_DE - Germany (German)Deutschland (Deutsch)
-
es_ES - Spain (Spanish)España (Español)
-
fr_FR - France (French)France (Français)
-
br_PT - Brazil (Portuguese)Brasil (Português)
-
en_AU - Australia (English)Australia (English)
-
en_IN - India (English)India (Indian)
-
it_IT - Italy (Italian)Italia (Italiano)
-
jp_JP - Japan (Japanese)日本 (日本語)
-
ar_TN - Tunisia (Arabic)تونس (عربي)
-
en_IE - Ireland (English)Ireland (English)
-
nl_NL - Netherlands (Dutch)Nederland (Nederlands)
-
zh_CN - China (Chinese)中国 (中文)
-
fi_FI - Finland (Finnish)Suomi (Suomi)
-
pt_PT - Portugal (Portuguese)Portugal (Português)
-
pl_PL - Poland (Polish)Polska (Polski)
-
ru-RU - Russia (Russian)Россия (Русский)
It would be great if you could contribute by indicating the followings: