This name space provide some functionalities that facilitate JavaScript development of the associated projects.
Classes
Members
(static) i18n
Properties:
Name | Type | Description |
---|---|---|
i18n |
iJS.Gettext | Defined `Gettext` object, to make *iJS gettext* functionalities to be directly use. |
- Source:
Example
//set the locale in which the messages will be translated
iJS.i18n.setlocale("en_US.utf8") ;
//add domain where to find messages data
iJS.i18n.bindtextdomain("domain_po", "./path_to_locale", "po") ;
//add another domain where to find messages data
iJS.i18n.bindtextdomain("domain_json", "./path_to_locale", "json") ;
//Always do this after a `setlocale` or a `bindtextdomain` call.
iJS.i18n.try_load_lang() ; //will load and parse messages data from the setting catalog.
//set the current domain
iJS.i18n.textdomain("domain_po") ;
//now print your messages
alert( iJS.i18n.gettext("messages to be translated") ) ;