jQuery Localisation Reference

A jQuery plugin that automatically loads JavaScript localisation packages based on the user's language preference. If you find this plugin useful please vote for it on the jQuery site.

This page provides a documentation reference for working with the plugin v1.0.4. See a demonstration of the localisation plugin and download the code from there.

Functionality

NameReturnsComments
$.localise(package, settings)- Load in localised versions of specified JavaScript packages.
package (string or string[]) is the name(s) of the package(s) to load
settings (object) to provide several settings (see settings) or is omitted to use the default language setting and parameters
$.localise(package, language, loadBase, path, timeout)- Load in localised versions of specified JavaScript packages. See settings for more details on the parameters.
package (string or string[]) is the name(s) of the package(s) to load
language (string, optional) to specify the language to load
loadBase (boolean, optional) should base package be loaded
path (string or string[2], optional) paths to packages
timeout (number, optional) timeout period for the load
Since 1.0.3 - language parameter only.
Since 1.0.4 - remaining parameters.
$.localise.defaultLanguagestring The default language set in the browser.
Since 1.0.3 - previously it was $.defaultLanguage.
$.localize- A localisation of the $.localise object!
Since 1.0.3.

Settings

NameValuesDefaultComments
languagestringbrowser setting When specified, this value is used to drive the localisation process rather than the browser setting. It is the RFC 4646 language-region code and should be in the format aa or aa-AA. For example: en = English, en-AU = Australian English.
loadBasebooleanfalse When set to true, the base package (<package name>.js) is loaded prior to any of the language override versions.
pathstring or string[2]['', ''] The path or paths to the JavaScript files. If a single string is provided it applies to both the base and localisations files. If an array of two strings is given, the first is for the base file and the second is for the localisations.
Since 1.0.4.
timeoutnumber500 The timeout period for downloading the localisation packages. A value of 0 indicates no timeout.

Contact Keith Wood at kbwood{at}iinet.com.au with comments or suggestions.