Regional settings - Edit language constant

Portal menu / Portal properties Regional settings Global texts Global language constants / Add new language constant

Name

Provide the language constant with a name here. This name will be used later to address the constant in each scope. The name has to be unique. Only use capital letters and avoid using special characters and spaces. The name must start with a letter, followed by letters, numbers or _.

Type

Here, you can specify the scope of a language constant: In Groovy, multilingual text constants can be used to generate log entries or constructions, that, for example, are written back to data fields. The constants can also be implemented for the purpose of labelling when generating data exports via Groovy (e.g. XML files). The object "g_i18n" is available for this purpose, it is initialized with the context language. If the context is missing, the default portal language is used as the fallback.
// Read application constant
def app = g_i18n.application("APPLICATION_GUID")
def appConst = app["APPLICATION_LANGUAGE_CONSTANT"]

// Read application constant with a predefined language
def appde = app.language("ISO_LANGUAGE_CODE")

// Read portal constant
def portalConst = g_i18n["PORTAL_LANGUAGE_CONSTANT "]

// Read portal constant with a predefined language
def portalde = g_i18n.language("ISO_LANGUAGE_CODE ")
def portalConst = portalde["APPLICATION_LANGUAGE_CONSTANT "]

// Example: Read application constant explicitly in English
def app = g_i18n.application("3F2…E1A")
def appen = app.language("en")
def text1 = appen["CUSTOMER"]

// Example: Read application constant
def app = g_i18n.application("3F2…E1A")
def text2 = app["CUSTOMER"]

// Example: Read portal constant explicitly in German
def portalde = g_i18n.language("de")
def text3 = portalde["CAL_WEEK"]

// Example: Read portal constant
def text4 = g_i18n["CAL_WEEK"]

Title

You can give the language constant a title for each of your different portal languages.

Language column

The portal languages are shown here.

Title column

The title corresponds to the value that the constant has - it will be displayed when the constant is used in the selected area. Enter the value of your choice here.

More information

Multilingual portals