Webpage Translate Language In jQuery Plugin – localizationTool

Text
jQuery Plugin To Translate Webpage In A Given Language - localizationTool
File Size: 88.72 KB
Views Total: 3465 views
Last Update:February 27, 2024
Publish Date: July 31, 2014
Official Website: Go to website
License: MIT
Plugin Author:
Demo    Download

Webpage Translate Language In jQuery Plugin is 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 RTL text direction when languages like Arabic are selected.

How to use :

Make sure UTF-8 encoding in HTML file.

<meta charset="utf-8">

Add plugin required CSS & JS in the head section after jQuery Library.

<link rel="stylesheet" href="path/to/jquery.localizationTool.css">
<script src="jquery/1.11.1/jquery.min.js"></script>
<script src="path/to/jquery.localizationTool.js"></script>

Add some content to be translated in HTML file.

<p id="welcomeText">Welcome!</p>

Markup for the language selection tool (this is where the localization widget will appear).

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

Setup the plugin.

$('#selectLanguageDropdown').localizationTool({
'defaultLanguage' : 'en_GB',
/* do not throw error if a selector doesn't match */
'ignoreUnmatchedSelectors': false,
/* show the flag on the widget */
'showFlag' : true,
/* show the language on the widget */
'showLanguage': true,
/* show the country on the widget */
'showCountry': true,
/* format of the language/country label */
'labelTemplate': '{{country}} {{(language)}}',
'languages' : {
    /*
     * The format here is <country code>_<language code>.
     * - list of country codes: http://www.gnu.org/software/gettext/manual/html_node/Country-Codes.html
     * - list of language codes: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html#Usual-Language-Codes
     */
},
/*
 * Strings are provided by the user of the plugin. Each entry
 * in the dictionary has the form:
 *
 * [STRING_IDENTIFIER] : {
 *      [LANGUAGE] : [TRANSLATION]
 * }
 *
 * STRING_IDENTIFIER:
 *     id:<html-id-name>           OR
 *     class:<html-class-name>     OR
 *     element:<html-element-name> OR
 *     <string>
 *
 * LANGUAGE: one of the languages defined above (e.g., it_IT)
 *
 * TRANSLATION: <string>
 *
 */
'strings' : {},
/*
 * A callback called whenever the user selects the language
 * from the dropdown menu. If false is returned, the
 * translation will not be performed (but just the language
 * will be selected from the widget).
 *
 * The countryLanguageCode is a string representing the
 * selected language identifier like 'en_GB'
 */
'onLanguageSelected' : function (/*countryLanguageCode*/) { return true; }
});

Done

Thanks for make jQuery plugin is developed by For more Helpfull for users, please check the demo page or visit the official website.
List Of Version :
  • v0.0.24
  • v0.0.23
  • v0.0.22
  • v0.0.21
  • v0.0.20
  • v0.0.17
  • v0.0.16
  • v0.0.15
  • v0.0.14
  • v0.0.13
  • v0.0.12
  • v0.0.11
  • v0.0.10
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
  • 0.0.19

guri singh

My name is Guri. I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

Related jQuery Plugins

You Might Also Like