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.
| Name | Returns | Comments |
|---|---|---|
| $.localise(package, settings) | - | Load in localised versions of specified JavaScript packages.package (string or string[]) is the name(s) of the
package(s) to loadsettings (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 loadlanguage (string, optional) to specify the language to loadloadBase (boolean, optional) should base package be loadedpath (string or string[2], optional) paths to packagestimeout (number, optional) timeout period for the loadSince 1.0.3 - language parameter only.Since 1.0.4 - remaining parameters. |
| $.localise.defaultLanguage | string | 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. |
| Name | Values | Default | Comments |
|---|---|---|---|
| language | string | browser 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. |
| loadBase | boolean | false | When set to true, the base package (<package name>.js) is
loaded prior to any of the language override versions. |
| path | string 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. |
| timeout | number | 500 | 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.