Application Express User's Guide > Managing Application Global... > Translating Messages Used i... > HTMLDB_LANG.MESSAGE API
HTMLDB_LANG.MESSAGE API |
Previous |
Next |
Use the HTMLDB_LANG
.MESSAGE
API to translate text strings (or messages) generated from PL/SQL stored procedures, functions, triggers, packaged procedures, and functions.
Syntax
HTMLDB_LANG.MESSAGE ( p_name 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_lang IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2;
Parameters
Table: HTMLDB_LANG.MESSAGE Parameters describes the parameters available in the HTMLDB_LANG
.MESSAGE API
.
HTMLDB_LANG.MESSAGE Parameters
Parameter | Description |
---|---|
|
Name of the message as defined in Oracle Application Express. |
...
|
Dynamic substitution value: |
|
Language code for the message to be retrieved. If not specified, Oracle Application Express 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" |
Example
The following example assumes you have defined a message called GREETING_MSG
in your application in English as Good morning%0
and in German as Guten Tag%1
. The following example demonstrates how you could invoke this message from PL/SQL:
BEGIN -- -- Print the greeting -- HTMLDB_LANG.MESSAGE('GREETING_MSG', V('APP_USER')); END;
How the p_lang
attribute is defined depends on how the Application Express engine derives the Application Primary Language. For example, if you are running the application in German and the previous call is made to the HTMLDB_LANG
.MESSAGE
API, the Application Express engine first looks for a message called GREETING_MSG
with a LANG_CODE
of de
. If it does not find anything, then it will revert to the Application Primary Language attribute. If it still does not find anything, the Application Express engine looks for a message by this name with a language code of en-us
.
See Also: "Specifying the Primary Language for an Application" for information about the Application Primary Language attribute |