jQuery.dictionary()
Categories: Utilities | Internationalisation
jQuery.dictionary( dictname, data )Returns: Object
Plugin: jQuery.dict
Description: Define a dictionary.
-
jQuery.dictionary( dictname, data )
version added: 1.0dictname The name of the dictionary, including the namespace of region.
data An array containing names of other dictionaries, dictionary objects or a map of keyword/translation pairs to add.
Use jQuery.dictionary
method to define an dictionaries for using jQuery.dict()
.
-
Use an existing dictionary.
Code:
// The example dictionary is already defined. // use default region/language $.dictionary( 'example' ); // use german $.dictionary( 'example', {region:'de'} );
-
Create a foo dictionary.
Code:
// The example dictionary is already defined. // use default region/language $.dictionary( 'foo', [ 'example', {"strawberry":"Strawberry"} ] ); // use german $.dictionary( 'foo', [ 'example', {"strawberry":"Erdbeere"} ], {region:'de'} );