Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

i18nText(baseDir, key, language)

Package

Alias

Pkg Usage

Warning

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

Description

Excerpt
hiddentrue

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

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

Parameters

...

...

Parameter name

Type

Required

Description

baseDir

...

string

...

yes

The relative path to the properties files directory. The path is relative to

...

kepler home.

key

...

string

...

yes

Key for the i18ned message.

language

...

string

...

yes

The language to use for the i18ned text.

...

Returns

Stringstring

Example

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

property file

content

messages.properties

Code Block
com.mymessage.test.working = Deafulttest message.
Code Block
com.mymessage.test.inexistent.property.file = inexisting message.

messages_en_UK.properties

Code Block
com.mymessage.test.working = This function is working!

messages_en_US.properties

Code Block
com.mymessage.test.working = This routine is working as exepected! 

messages_fr_CH.properties

Code Block
com.mymessage.test.working = Cette fonction fonctionne!

messages_fr_FR.properties

Code Block
com.mymessage.test.working = Cette routine fonctionne comme prévu!
Code Block
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 results of the above code will be:

...


Note

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


See also

Filter by label (Content by label)
showLabelsfalse

...

showSpacefalse
cqllabel = "

...

system_routines"
labels

...

system_routines