Skip to end of banner
Go to start of banner

i18nText

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Keep in mind that after modifying properties file you have to restart the JIra.

Description

Returns the i18n text if the key can be resolved. Otherwise, the key itself will be returned.

Parameters

Return Type

String

Example

If we have a directory called messages placed under the cprime home directory with the following properties files:

runnerLog("UK: " + i18nText("messages", "com.mymessage.test.working", "en_UK"));
runnerLog("US: " + i18nText("messages", "com.mymessage.test.working", "en_US"));
runnerLog("US: " + i18nText("messages", "com.mymessage.test.working", "en"));

runnerLog("Test inexistent key: " + i18nText("message", "com.mymessage.test.inexistent.key", "en_US"));

runnerLog("fr_CH: " + i18nText("messages", "com.mymessage.test.working", "fr_CH"));
runnerLog("fr_FR: " + i18nText("messages", "com.mymessage.test.working", "fr_FR"));

// if the property file does not exists, the value will be returned from the default properties file if exists
runnerLog("Test inexistent property file: " + i18nText("messages", "com.mymessage.test.inexistent.property.file", "ro_RO"));

The properties files should match the folder name and had the properties extension.

See also

  • No labels