jQuery.dict()
Categories: Utilities | Internationalisation
jQuery.dict( dictname, [ options ] )Returns: Object
Plugin: jQuery.dict
Description: Get a dictionary object for translation.
-
jQuery.dict( dictname, [ options ] )
version added: 1.0dictname The name of the dictionary, optional including the namespace of region.
options A set of key/value pairs that configure the jQuery.dict call. A default are set for any option by jQuery.dictSettings.
Get a dictionary object for translation.
-
Use a dictionary.
Code:
// The example dictionary is already defined. // use default region/language $.dict( 'example' ); // use german $.dict( 'example', {region:'de'} ); // use german $.dict( 'de:example' );
-
Translate keywords and parse text with a dict.
Code:
var obj = $.dict( 'de:example' ); obj.translate('translation'); // results: ÃÂbersetzung obj.parse('jQuery SDK {translation}'); // results: jQuery SDK ÃÂbersetzung