31.6 LANG Function

Use this function to return a translated text string for translations defined in dynamic translations.

Syntax

APEX_LANG.LANG (
    p_primary_text_string IN VARCHAR2 DEFAULT NULL,
    p0 IN VARCHAR2 DEFAULT NULL,
    p1 IN VARCHAR2 DEFAULT NULL,
    p2 IN VARCHAR2 DEFAULT NULL,
    ...
    p9 IN VARCHAR2 DEFAULT NULL,
    p_primary_language IN VARCHAR2 DEFAULT NULL )
RETURN VARCHAR2;

Parameters

Table 31-5 LANG Parameters

Parameter Description
p_primary_text_string Text string of the primary language. This is the value of the Translate From Text in the dynamic translation.
p0 through p9 Dynamic substitution value: p0 corresponds to %0 in the translation string; p1 corresponds to %1 in the translation string; p2 corresponds to %2 in the translation string, and so on.
p_primary_language

Language code for the message to be retrieved. If not specified, Oracle APEX uses the current language for the user as defined in the Application Language Derived From attribute.

See also Specifying the Primary Language for an Application in Oracle APEX App Builder User’s Guide.

Example

In a table that defines all primary colors, you can define a dynamic message for each color and then apply the LANG function to the defined values in a query. For example:

SELECT APEX_LANG.LANG(color)
FROM my_colors

In an application in German where RED (English) is a value for the color column in the my_colors table, and you defined the German word for red, the previous example returns ROT.