Go to primary content
Oracle® Application Express Application Builder User's Guide
Release 5.0
E39147-04
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

21.1 Understanding Application Translation and Globalization Support

You can develop applications in Application Builder that can run concurrently in different languages. A single Oracle database instance and Oracle Application Express can support multiple database sessions customized to support different languages.

21.1.1 About the Translation Process

In general, translating an application built in Application Builder involves the following steps:

  • Step 1 - Map the primary and target application IDs.

  • Step 2 - Seed and export the text to a file for translation.

  • Step 3 - Translate the text in the file.

  • Step 4 - Apply the translated file.

  • Step 5 - Publish the translated file.

21.1.2 About Language Identification

After you create an application, you specify a language preference. Then you select a primary application language and determine how the Application Express engine determines the application language. The application primary language can be static, derived from the Web browser language, or determined from a user preference or item.

21.1.3 About the Rules for Translating Database Applications

Use the following rules to determine which translated version to use:

  • Look for an exact match between the user language preference and the language code of the translated application.

  • Look for a truncated match. That is, see if the language and locale exist. For example, if the user language preference is en-us and the translated version of en-us does not exist, look for a translated application that has the language code en.

  • Use the primary application language.

For example, suppose you create an application with the primary language of German, de, and you create a translated version of the application with a language code of en-us. Users accessing this application with a browser language of en-us execute the English en-us version of the application. Users accessing the application with a browser language of en-gb view the application in the application's primary language, that is, in German. For this example, you should create the translated English version using language code en to encompass all variations of en.

21.1.4 How Translated Applications Are Rendered

After Oracle Application Express determines the language for an application, the Application Express engine alters the database language for a specific page request. It then looks for a translated application in the appropriate language. If the Application Express engine finds that language, it renders the application using that definition. Otherwise, it renders the application in the base (or primary) application language.

Note that the text that displays within an application is not translated on the fly. Oracle Application Express dynamically collects page attributes from either a base language application definition or an alternative application definition.

21.1.5 Making Application Attributes Translatable

When you build an application in Application Builder, you define a large number of declarative attributes such as field labels, region headings, page header text, and so on. This section describes best practices regarding how to make application attributes within your application translatable.

21.1.5.1 About Shortcuts that Support Translatable Messages

Application Builder includes two shortcut types that enable you to reference translatable messages:

  • Message. Use this shortcut to reference a translatable message at runtime. Note that the name of the shortcut must match the corresponding message name. At runtime, the name of the shortcut expands to the text of the translatable message for the current language.

  • Message with JavaScript Escaped Single Quotes. Use this shortcut to reference a shortcut inside of a JavaScript literal string and reference a translatable message at runtime. This shortcut defines a text string. When the shortcut is referenced, it escapes the single quotation marks required for JavaScript.


See Also:

"Using Shortcuts"

21.1.5.2 About Messages

If your application includes PL/SQL regions or PL/SQL processes, you must translate any generated HTML or text. You may also need to translate messages used in reports if your application uses a language that is not one of the ten languages into which Oracle Application Express is translated.

21.1.5.3 About Dynamic Translation Text Strings

Dynamic translations are used for database data that must be translated at runtime. For example, you might use a dynamic translation to translate a list of values based on a database query. A dynamic translation consists of a translate-from language string, a language code, and a translate-to string. You can also use the APEX_LANG.LANG API to retrieve dynamic translations programmatically.

21.1.5.4 About Translating Region Titles

By default, page region titles are included in the generated translation file. However, you can mark a region title as not translatable.

21.1.5.4.1 Marking a Region as Not Translatable in Page Designer

To mark a region title as not translatable:

  1. Navigate to the appropriate page in Page Designer. See "Viewing a Page in Page Designer."

    Page Designer appears

  2. In the Rendering tree, select the region.

    The Property Editor displays the region attributes.

  3. Expand the Advanced section.

  4. For Exclude Title from Translation, select Yes.

  5. Click Save.

21.1.5.4.2 Marking a Region as Not Translatable in Component View

To mark a region title as not translatable:

  1. Navigate to the page in Component View. See "Using Component View."

  2. On the page, select the region title.

    The Edit Region page appears.

  3. Under Identification, select the exclude title from translation check box.

21.1.5.5 About Translating Templates

By default, templates are not translatable, and therefore are not included in the generated translation file. Generally, templates do not and should not contain translatable text. However, if you must mark a template as translatable, select the Translatable check box on the Edit Page Template page.

To identify a template as translatable:

  1. On the Workspace home page, click the Application Builder icon.

  2. Select an application.

  3. On the Application home page, click Shared Components.

  4. Under User Interface, select Templates.

    The Templates page appears.

  5. Locate the template you want to edit and select the template name.

  6. Under Name, select Translatable.

You can include translatable text at the application-level by defining the translatable text using static substitution strings. Because application-level attributes are translated, any text defined as a static substitution string is included in the generated translation file.