TranslatableString Class

The TranslatableString class is a named text entity that enables different text string values to be displayed in an application depending on the locale of the client machine. Instead of hard coding a string literal value in your method source or for the caption of a label, you can define and use a translatable string.

When you define a translatable string with a specified name, separate translatable strings are created for each declared locale.

Each locale-specific translatable string can contain a different text string. For example, you can add a translatable with the name Hello and provide the following text string values for the France and New Zealand versions of the Hello translatable string.

Hello = "Bonjour" // for locale 1036 (French - France)
Hello = "Gidday"  // for locale 5129 (English - New Zealand)

In the JADE Editor and the JADE Painter, a translatable string is always prepended with a dollar sign ($), as shown in the following write instruction.

write $Hello;

At runtime, the output from the write instruction would depend on the locale of the client machine. In France, "Bonjour" would be output and in New Zealand "Gidday" would be output.

Translatable strings can be used in method source code and in the JADE Painter; for example, you could use a translatable string for the caption on a Label control. For details, see "Translating Control Properties", in Chapter 5 of the JADE Development Environment User’s Guide.

For details about working with translatable strings, see "Adding a New Translatable String", "Updating an Existing Translatable String", "Extract Translatable Strings Method Example", and "Load Translatable Strings Method Example", in Chapter 11 of the JADE Development Environment User’s Guide.

The Locale class provides the getTranslatableStringLocal, getTranslatableStrings, and getTranslatableStringsByNum methods for retrieving translatable strings defined for a locale.

For details about the properties and method defined in the TranslatableString class, see "TranslatableString Properties" and "TranslatableString Method", in the following subsections.

Constant

(None)