The Localization API is used to invoke the methods for translating text that may or may not contain insertions.
The methods defined on the Localization component are as follows:
Table 1. List of Prototype Methods
Method |
Description |
get(textidentifier) |
This method returns the translatableText object, which gives the translated label for the identifier in the runtime language.
- textidentifier: Required. Refers to the textidentifier for the label to be translated.
|
translateXML(<XMLDocument>) |
This method returns an XML object with the translated text node.
- XMLDocument: Required. Refers to the XML, which has the text node to be translated.
|
Table 1. List of Static Methods
Method |
Description |
makeCompositeText(translatableText,argument1,argument2,..) |
This method returns a composite translatableText object.
- translatableText: Required. Refers to the translatableText object.
- arguments: Optional. If the translatableText contains insertions, arguments must be provided for inserting the respective insertions. The insertions can be plain strings or other translatableText objects.
|
format(translatableText,argument1,argument2,..) |
This method returns the translated string.
- translatableText: Required. Refers to the translatableText object.
- arguments: Optional. If the translatableText contains insertions, arguments must be provided for inserting the respective insertions. The insertions can be plain strings or other translatableText objects.
|