pp108 : getBundle()

getBundle()


This method retrieves a Localization object corresponding to the (Multi-Language Mapper) .mlm file of the Javascript Message Bundle.


Syntax


MessageBundle.getBundle(path);

Parameters

Parameter

Description

path

Required. Path of the Javascript Message Bundle document.


Return Value


Returns the Localization object.

Remarks


This method can be invoked to fetch the Localization object corresponding to the (Multi-Language Mapper) .mlm file of the Javascript Message Bundle in the runtime language and the prototype method get(textidentifier) can be invoked on the returned object to fetch the translated value.

Example


The following example shows how to use the getBundle method:

application.importType("translation.library.util.MessageBundle");
var bundle = MessageBundle.getBundle("/validations/datevalidationmessagebundle");
var incorrectDateMessage = bundle.get("Date validation message");
application.notify(incorrectDateMessage);

See Also


Localization