Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\global_mess_plsql.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Translating Messages Used in PL/SQL Procedures</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T16:11:32Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Translating Messages Used in PL/SQL Procedures" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E11947-01" /> <link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface.htm" title="Home" type="text/html" /> <link rel="up" href="global.htm" title="Managing Application Global..." type="text/html" /> <link rel="up" href="global_messages.htm" title="Translating Messages" type="text/html" /> <link rel="up" href="global_mess_plsql.htm" title="Translating Messages Used i..." type="text/html" /> <link rel="prev" href="global_messages.htm" title="Previous" type="text/html" /> <link rel="next" href="global_mess_reports.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface.htm" title="Home">Home</a> > <a href="global.htm" title="Managing Application Global...">Managing Application Global...</a> > <a href="global_messages.htm" title="Translating Messages">Translating Messages</a> > Translating Messages Used i...</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="global_messages.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="global_mess_reports.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CHDBACIG" name="CHDBACIG"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1><a name="HTMDB25937" id="HTMDB25937"></a>Translating Messages Used in PL/SQL <a id="sthref2365" name="sthref2365"></a><a id="sthref2366" name="sthref2366"></a><a id="sthref2367" name="sthref2367"></a><a id="sthref2368" name="sthref2368"></a><a id="sthref2369" name="sthref2369"></a>Procedures</h1> <p>If your application includes PL/SQL regions or PL/SQL processes or calls PL/SQL package, procedures, or functions, you may need to translate generated HTML. First, you define each message on the Translatable Messages page. Second, you use the <code>APEX_LANG</code>.<code>MESSAGE</code> API to translate the messages from PL/SQL stored procedures, functions, triggers, or packaged procedures and functions.</p> <p>You create translatable <a id="sthref2370" name="sthref2370"></a>messages on the Translate Messages page.</p> <p>To define a new translation message:</p> <ol> <li> <p>Navigate to the Translate Application page:</p> <ol> <li> <p>On the Workspace home page, click the <span class="bold">Application Builder</span> icon.</p> </li> <li> <p>Select an application.</p> </li> <li> <p>Click <span class="bold">Shared Components</span>.</p> </li> <li> <p>Under Globalization, click <span class="bold">Text Messages</span>.</p> </li> </ol> </li> <li> <p>On the Translate Messages page, click <span class="bold">Create</span>.</p> </li> <li> <p>On Identify Text Message, specify the following:</p> <ol> <li> <p>Name - Enter a name to identify the message.</p> </li> <li> <p>Language - Select the language for which the message would be used.</p> </li> <li> <p>Text - Enter the text to be returned when the text message is called.</p> <p>For example, you could define the message <code>GREETING_MSG</code> in English as:</p> <pre xml:space="preserve" class="oac_no_warn"> <code>Good morning %0</code> </pre> <p>Or, you could define the message <code>GREETING_MSG</code> in German as:</p> <pre xml:space="preserve" class="oac_no_warn"> Guten Tag %0 </pre></li> </ol> </li> <li> <p>Click <span class="bold">Create</span>.</p> </li> </ol> <div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref2371" name="sthref2371"></a> <h2><a name="HTMDB25938" id="HTMDB25938"></a>About the APEX_LANG.MESSAGE <a id="sthref2372" name="sthref2372"></a><a id="sthref2373" name="sthref2373"></a>API</h2> <p>Use the <code>APEX_LANG</code>.<code>MESSAGE</code> API to translate text strings (or messages) generated from PL/SQL stored procedures, functions, triggers, packaged procedures, and functions.</p> <a id="sthref2374" name="sthref2374"></a> <p class="subhead2">Syntax</p> <pre xml:space="preserve" class="oac_no_warn"> APEX_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; </pre> <a id="sthref2375" name="sthref2375"></a> <p class="subhead2">Parameters</p> <p><a href="#CHDGFDFA">Table: APEX_LANG.MESSAGE Parameters</a> describes the parameters available in the <code>APEX_LANG</code>.MESSAGE API.</p> <div class="tblformal"><a id="sthref2376" name="sthref2376"></a><a id="CHDGFDFA" name="CHDGFDFA"></a> <p class="titleintable">APEX_LANG.MESSAGE Parameters</p> <table class="Formal" title="APEX_LANG.MESSAGE Parameters" summary="This table describes the parameters available in HTMLDB_LANG.MESSAGE." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0"> <col width="31%" /> <col width="*" /> <thead> <tr align="left" valign="top"> <th align="left" valign="bottom" id="r1c1-t19">Parameter</th> <th align="left" valign="bottom" id="r1c2-t19">Description</th> </tr> </thead> <tbody> <tr align="left" valign="top"> <td align="left" id="r2c1-t19" headers="r1c1-t19"> <p><code>p_name</code></p> </td> <td align="left" headers="r2c1-t19 r1c2-t19"> <p>Name of the message as defined in Oracle Application Express.</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r3c1-t19" headers="r1c1-t19"> <p><code>p0</code></p> <p>...</p> <p><code>p9</code></p> </td> <td align="left" headers="r3c1-t19 r1c2-t19"> <p>Dynamic substitution value: <code>p0</code> corresponds to 0% in the message; <code>p1</code> corresponds to 1% in the message; p2 corresponds to 2% in the message, and so on.</p> </td> </tr> <tr align="left" valign="top"> <td align="left" id="r4c1-t19" headers="r1c1-t19"> <p><code>p_lang</code></p> </td> <td align="left" headers="r4c1-t19 r1c2-t19"> <p>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.</p> <p><span class="bold">See Also:</span> <a href="global_primary_lang.htm#CHDFFJEJ">"Specifying the Primary Language for an Application"</a></p> </td> </tr> </tbody> </table> <br /></div> <!-- class="tblformal" --> <a id="sthref2377" name="sthref2377"></a> <p class="subhead2">Example</p> <p>The following example assumes you have defined a message called <code>GREETING_MSG</code> in your application in English as <code>Good morning%0</code> and in German as <code>Guten Tag%1</code>. The following example demonstrates how you could invoke this message from PL/SQL:</p> <pre xml:space="preserve" class="oac_no_warn"> BEGIN -- -- Print the greeting -- APEX_LANG.MESSAGE('GREETING_MSG', V('APP_USER')); END; </pre> <p>How the <code>p_lang</code> 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 <code>APEX_LANG</code>.<code>MESSAGE</code> API, the Application Express engine first looks for a message called <code>GREETING_MSG</code> with a <code>LANG_CODE</code> of <code>de</code>. 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 <code>en-us</code>.</p> <div align="center"> <div class="inftblnotealso"><br /> <table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0"> <tbody> <tr> <td align="left"> <p class="notep1">See Also:</p> <a href="global_primary_lang.htm#CHDFFJEJ">"Specifying the Primary Language for an Application"</a> for information about the Application Primary Language attribute and <a href="http://www.oracle.com/pls/db112/lookup?id=AEAPI354">APEX_LANG</a> in the <a href="AEAPI/preface.htm"><span class="italic">Oracle Application Express API Reference</span></a></td> </tr> </tbody> </table> <br /></div> <!-- class="inftblnotealso" --></div> </div> <!-- class="sect3" --></div> <!-- class="sect2" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="global_messages.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="global_mess_reports.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de