Introduction

Localisation works by appending language indicators to the base package name to download and implement the contained overrides. If no specific language is given, the default setting for the browser is used. For example, setting the language to English - Australian (en-AU) for the greeting package causes the download and evaluation of the greeting-en.js and greeting-en-AU.js files (if they exist) in that order.

As an example the greeting package has the following localisation packages available:

FileLanguageValue
greeting.jsDefaultHello
greeting-en.jsStandard EnglishGood morning
greeting-en-AU.jsAustralian EnglishG'day
greeting-en-US.jsUS EnglishHi
greeting-fr.jsFrenchBonjour

These packages just set a variable (greeting) that is then displayed:

Default language

Change to another language

for language

$('#defaultLang').val($.localise.defaultLanguage);
		
$('#changeLocale').change(function() {
		var newLang = $(this).val();
		$.localise('js/greeting', {language: newLang, loadBase: true});
		$('#greeting').val(greeting);
		$('#languages').val(newLang);
	}).
	val($.localise.defaultLanguage).
	change();
In the Wild

This tab highlights examples of this plugin in use "in the wild".

To add another example, please contact me (kbwood{at}iinet.com.au) and provide the plugin name, the URL of your site, its title, and a short description of its purpose and where/how the plugin is used.

Quick Reference

A full list of all possible uses is shown below. For more detail see the documentation reference page.

$.localise(package(s), settings)
$.localise(package(s), language, loadBase, path, timeout, async, complete)

$.localise.defaultLanguage

$.localize(package(s), settings)
$.localize(package(s), language, loadBase, path, timeout, async, complete)

$.localize.defaultLanguage