Translating an Application in Oracle Application Express 5.1


Options



Before You Begin

Purpose

This tutorial shows how to translate an application developed in Application Builder using Oracle Application Express 5.1.

Time to Complete

Approximately 40 minutes.

Overview

Oracle Application Express (Oracle APEX) is a rapid web application development tool for the Oracle database. Using only a web browser and limited programming experience, you can develop and deploy professional applications that are both fast and secure. Oracle Application Express is available with the Oracle Database, whether it's on-premises or in an Oracle Database Cloud Service.

In this tutorial, you use Oracle Application Express Release 5.1 to translate an application developed in Application Builder. To translate an application developed in Application Builder, you must map the primary and target language, seed and export text to a translation file, translate the text, apply the translation file, and publish the translated application. In this tutorial, you will import an application that is developed in Application Builder using English as the Primary Language. You will then perform some steps to translate this application to German.

Please keep in mind the following while running this tutorial:

  • Logging into your Oracle Application Express workspace: Your Oracle Application Express workspace may reside in an on-premises Oracle Database or in Oracle Database Cloud Services. The login credentials differ depending on where your workspace is located:
    • Logging into Oracle Application Express in a Oracle Database Cloud Service:  Reference the Oracle Help Center for your Oracle Database Cloud Service. To do this, go to the Oracle Help Center for Cloud, and select Platform or Infrastructure (depending on your service). From here, select your Database Cloud Service and the Get Started page will appear.
    • Logging in to Oracle Application Express on-premises: From your browser, go to the location of your on-premises installation of your Oracle Application Express workspace provided by your Workspace Administrator.
  • Application ID: Screenshots in this tutorial show a blurred Application ID. Your Application ID can be any value assigned automatically while creating the application.
  • Schema: If you are accessing an Oracle Application Express workspace in Database Schema Service,  you have one schema assigned to you with a schema name that you cannot change. If you are accessing the workspace in an on-premises Oracle database, you may have more than one schema assigned to your workspace by the Oracle Application Express Instance Administrator.

What Do You Need?

Before starting this tutorial, you should:

  • Visit Oracle Help Center for Cloud.
  • Have access to an Oracle Database 11g or later release, either on-premises or in a Database Cloud Service.
  • Install Oracle Application Express Release 5.1 into your Oracle Database (for on-premises only).
  • Download and unzip the files.zip into your working directory.
  • Provision at least one Oracle Application Express user. See Creating New User Accounts in Oracle Application Express Administration Guide.
  • All files for this hands-on activity are located in the Home/Desktop/APEX_Track/files folder.

  • The following files are used in this hands-on activity:

    • Order Management.sql

Importing the Order Management Application

In this topic, you will first import a pre-built Order Management application into Application Builder. This application is currently using English as its Primary Language. You will later translate this application into German.
  1. In the Application Express login page, enter the following login credentials and click Sign In:

    • Workspace: obe

    • Username: obe

    • Password: oracle

    Login page
    Description of this image
  2. From the Oracle Application Express home page,  click the down arrow next to the App Builder tab and select Import.

    Description of this image
  3. Click the Browse button. Browse to your working directory (the folder where you downloaded and unzipped files.zip), locate Order Management.sql, and click Open.

    Click the Browse button. Browse to the files directory and locate Order Management.sql, and click Open.

    Description of this image
  4. Click Next.

    Description of this image
  5. Click Next.

    Description of this image
  6. Click Install Application.

    Description of this image
  7. Click Run Application.

    Description of this image
  8. Enter your Oracle Application Express credentials, and click Login.

    Description of this image
  9. The Order Management application is launched displaying the Home page. Notice that this application uses English as its Primary Language.

    Description of this image

Translating the Order Management Application

To translate an application, you must:
  • Map the primary and target language
  • Seed and export text to a translation file
  • Translate the text
  • Apply the translation file
  • Publish the translated application
To translate the Order Management application to German, perform the following steps:
  1. Click Application<n> in the developer toolbar.

    Description of this image
  2. Click Shared Components.

    Description of this image
  3. Under Globalization, click Globalization Attributes.

    Description of this image
  4. Select Application Primary Language for Application Language Derived From, and click Apply Changes.

    Description of this image
  5. Click Shared Components.

    Description of this image
  6. Under Globalization, click Translate Application.

    Description of this image
  7. Click Define application languages.

    Description of this image
  8. Click Create.

    Description of this image
  9. Enter a unique Application ID for Translation Application, German (Germany) (de) for Language, and click Create.

    Description of this image
  10. Click the Translate breadcrumb.

    Description of this image
  11. Click Seed translatable text.

    Note: Seeding the translation copies translatable text into the translation text repository. Once the translatable text is seeded, you can translate the text strings.

    Description of this image
  12. Select the check-box for your Translated Application, and click Seed.

    Description of this image
  13. Click the Translate breadcrumb.

    Description of this image
  14. Click Download XLIFF translation files.

    Description of this image
  15. Select German (Germany) (de) for Language, and click Export XLIFF File for Application. Save the exported file into your working directory.

    Description of this image
  16. Open the exported XLIFF File in a text editor. Press Ctrl+H. For Find what, enter <target>. For Replace with, enter <target>Ordnung. Click Replace All.

    Description of this image
  17. Save the changes, and close the file.

    Description of this image
  18. In the Oracle Application Express window, click the Translate breadcrumb.

    Description of this image
  19. Once the XLIFF file is populated with the translations, the XLIFF file is uploaded back into the translation repository. To do this, click Apply XLIFF translation files.

    Description of this image
  20. Click Upload Files.

    Description of this image
  21. Click Browse, browse to your working directory, select the XLIFF File you modified in the previous step, and click Upload.

    Description of this image
  22. Select the check-box for the row with your XLIFF file name, select a translation mapping for Apply to Translation, and click Apply Checked.

    Description of this image
  23. Click the Translate breadcrumb.

    Description of this image
  24. The final step is to publish the translated application from the translation repository. To do this, click Publish translated applications.

    Description of this image
  25. Select the check box for the Translated Application, and click Publish.

    Description of this image
  26. The translated application is successfully published. Click the Shared Components breadcrumb.

    Description of this image

Specifying the Primary Language for the Translated Application

Globalization attributes specify how Oracle Application Express determines the primary language for an application. Perform the following steps to view your translated application by specifying the Primary Language.
  1. Under Globalization, click Globalization Attributes.

    Description of this image
  2. Select German (Germany) (de) for Application Primary Language, Application Primary Language for Application Language Derived From, and click Apply Changes.

    Description of this image
  3. Click Run Application.

    Description of this image
  4. Enter your Oracle Application Express credentials, and click OrdnungLogin.

    Description of this image
  5. Notice that the application is translated to German based on the XLIFF file that was uploaded.

    Description of this image
  6. In the next section, you will see how to translate messages used in PL/SQL. Click Anwendung<n> in the developer toolbar.

    Description of this image

Translating Messages Used in PL/SQL

If your application includes PL/SQL regions or PL/SQL processes or calls PL/SQL packages,  procedures, or functions, you may need to translate generated HTML as explained below:
  • Define each message on the Translatable Messages page.
  • Use the APEX_LANG.MESSAGE API to translate the messages from PL/SQL stored procedures, functions, triggers, or packaged procedures and functions.
  • Create translatable messages on the Translate Messages page.

To translate messages used in PL/SQL, perform the following steps:
  1. Click Shared Components.

    Description of this image
  2. Under Globalization, click Globalization Attributes.

    Description of this image
  3. Select English (en) for Application Primary Language, No NLS (Application not translated) for Application Language Derived From, and click Apply Changes.

    Description of this image
  4. You want to define a message called Greeting_Message in your application in English as "Good morning %0" and in German as "Guten Tag %0" and invoke this message from PL/SQL in the Home page by creating a region called Translation Region. Click 1 - Home.

    Description of this image
  5. In the Rendering tab, right-click Region Position 01, and select Create Region.

    Description of this image
  6. In the property editor, under Identification, enter Translation Region for Title, select PL/SQL Dynamic Content for Type. Under Source, enter the below given code for PL/SQL Code, and click Save.

    begin
    htp.p(apex_lang.message('GREETING_MESSAGE', V('APP_USER')));
    end;

    Description of this image
  7. Click the Shared Components icon.

    Description of this image
  8. Under Globalization, click Text Messages.

    Description of this image
  9. Click Create Text Message.

    Description of this image
  10. Enter GREETING_MESSAGE for Name, select English (en) for Language, enter Good Morning %0 for Text, and click Create And Create Another.

    Description of this image
  11. Enter GREETING_MESSAGE for Name, select German (Germany) (de) for Language, enter Guten Tag %0 for Text, and click Create Text Message.

    Description of this image
  12. Click the Run Page 1 icon.

    Description of this image
  13. The Translation Region with the English greeting message is displayed. Click Application<n> in the developer toolbar.

    Description of this image
  14. You want to display this greeting message in German.Click Shared Components.

    Description of this image
  15. Under Globalization, click Globalization Attributes.

    Description of this image
  16. Select German (Germany) (de) for Application Primary Language, No NLS (Application not translated) for Application Language Derived From, and click Apply Changes.

    Description of this image
  17. Click the Run Page 1 icon.

    Description of this image
  18. The Home page is displayed with the Greeting message translated in German.

    Description of this image

Summary

In this tutorial, you have learned how to:

  • Import an application
  • Translate the imported application
  • Specify the primary language for the translated application
  • Translate messages used in PL/SQL

Want to Learn More?