pp108 : format

format


This method retrieves the translated string for a message with insertions in the runtime language.

Syntax


Localization.format(translatabletext,argument1,argument2,..);

Parameters

Parameter

Description

translatableText

Required. Refers to the TranslatableText object

arguments

Optional. If the TranslatableText contains insertions, arguments must be provided for inserting the respective insertions. Insertions can be plain strings or other TranslatableText Objects


Return Value


This method returns translated string for a message with insertions in the runtime language.

Remarks


This method is used to get the translated value of a message with insertions at runtime .If there is no translation available for the specified TextIdentifier ,it will be notified to the user and null will be returned.


Example


The following example shows how to use the makeCompositeText method:

application.importType("translation.library.util.Localization");
application.importType("translation.library.util.MessageBundle");

var bundle = MessageBundle.getBundle("/validations/datevalidationmessagebundle");
var incorrectDateMessage = bundle.get("Date validation message");
var dateMessage = Localization.format(incorrectDateMessage,"January");
application.notify(dateMessage);

See Also


Localization