Skip Headers
Oracle® Fusion Middleware Publishing Reports to the Web with Oracle Reports Services
11g Release 1 (11.1.1)

Part Number B32121-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

23.6 Translating Applications

In any Oracle Reports Services application, you see many types of messages, including:

If the NLS_LANG environment variable is set correctly and the appropriate message files are available, then translation of messages for the first two items is done for you. To translate messages and boilerplate text defined as part of the application, you can use the Oracle translation tool, TranslationHub, and you might also find it useful to use PL/SQL Libraries for strings of code.

Note:

You'll find information about using TranslationHub on your Oracle Developer Suite documentation CD and on the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Manual translation is required for constant text within a PL/SQL block because that text is not clearly delimited, but is often built up from variables and pieces of strings. To translate these strings, you can use PL/SQL libraries to implement a flexible message structure.

You can use attachable PL/SQL libraries to implement a flexible message function for messages that are displayed programmatically by the SRW.MESSAGE built-in procedure, or by assigning a message to a display item from a trigger or procedure. The library can be stored on the host and dynamically attached at runtime. At runtime, based on a search path, you can pull in the attached library. For example, a library might hold only the Italian messages:

FUNCTION nls_appl_mesg(index_no NUMBER)
RETURN CHAR
IS
   msg CHAR(80);
BEGIN
   IF index_no = 1001 THEN
      msg := 'L''impiegato che Voi cercate non esiste...';
   ELSIF index_no = 1002 THEN
      msg := 'Lo stipendio non puo essere minore di zero.';
   ELSIF  ...
   .
   .
   ELSE
      msg := 'ERRORE: Indice messaggio inesistente.';
   END IF;
   RETURN msg;
END;

A routine like this could be used anywhere a character expression would normally be valid. For example, to display text with the appropriately translated application message, you might include the following code:

SRW.MESSAGE(1001,nls_appl_mesg(1001));

Note:

For a description of the SRW built-in package, including the SRW.MESSAGE built-in procedure, see the Oracle Reports online Help.

To change the application to another language, simply replace the PL/SQL library containing the nls_appl_mes function with a library of the same name containing the nls_appl_mesg function with translated text.