pp108 : makeCompositeText

makeCompositeText


This method retrieves a Composite TranslatableText object.

Syntax


Localization.makeCompositeText (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 a Composite TranslatableText object.

Remarks


This method is used to get the composite TranslatableText object with insertions,which returns the translated value of the messagewith 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.makeCompositeText(incorrectDateMessage,"January");
application.notify(dateMessage);

See Also


Localization