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.
Importing the Order Management Application
-
In the Application Express login page, enter the following login credentials and click Sign In:
Workspace: obe
Username: obe
Password: oracle
-
From the Oracle Application Express home page, click the down arrow next to the App Builder tab and select Import.
-
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 Next.
-
Click Next.
-
Click Install Application.
-
Click Run Application.
-
Enter your Oracle Application Express credentials, and click Login.
-
The Order Management application is launched displaying the Home page. Notice that this application uses English as its Primary Language.
Translating the Order Management Application
- 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
-
Click Application<n> in the developer toolbar.
-
Click Shared Components.
-
Under Globalization, click Globalization Attributes.
-
Select Application Primary Language for Application Language Derived From, and click Apply Changes.
-
Click Shared Components.
-
Under Globalization, click Translate Application.
-
Click Define application languages.
-
Click Create.
-
Enter a unique Application ID for Translation Application, German (Germany) (de) for Language, and click Create.
-
Click the Translate breadcrumb.
-
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. -
Select the check-box for your Translated Application, and click Seed.
-
Click the Translate breadcrumb.
-
Click Download XLIFF translation files.
-
Select German (Germany) (de) for Language, and click Export XLIFF File for Application. Save the exported file into your working directory.
-
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.
-
Save the changes, and close the file.
-
In the Oracle Application Express window, click the Translate breadcrumb.
-
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.
-
Click Upload Files.
-
Click Browse, browse to your working directory, select the XLIFF File you modified in the previous step, and click Upload.
-
Select the check-box for the row with your XLIFF file name, select a translation mapping for Apply to Translation, and click Apply Checked.
-
Click the Translate breadcrumb.
-
The final step is to publish the translated application from the translation repository. To do this, click Publish translated applications.
-
Select the check box for the Translated Application, and click Publish.
-
The translated application is successfully published. Click the Shared Components breadcrumb.
Specifying the Primary Language for the Translated Application
-
Under Globalization, click Globalization Attributes.
-
Select German (Germany) (de) for Application Primary Language, Application Primary Language for Application Language Derived From, and click Apply Changes.
-
Click Run Application.
-
Enter your Oracle Application Express credentials, and click OrdnungLogin.
-
Notice that the application is translated to German based on the XLIFF file that was uploaded.
-
In the next section, you will see how to translate messages used in PL/SQL. Click Anwendung<n> in the developer toolbar.
Translating Messages Used in PL/SQL
- 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:
-
Click Shared Components.
-
Under Globalization, click Globalization Attributes.
-
Select English (en) for Application Primary Language, No NLS (Application not translated) for Application Language Derived From, and click Apply Changes.
-
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.
-
In the Rendering tab, right-click Region Position 01, and select Create Region.
-
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; -
Click the Shared Components icon.
-
Under Globalization, click Text Messages.
-
Click Create Text Message.
-
Enter GREETING_MESSAGE for Name, select English (en) for Language, enter Good Morning %0 for Text, and click Create And Create Another.
-
Enter GREETING_MESSAGE for Name, select German (Germany) (de) for Language, enter Guten Tag %0 for Text, and click Create Text Message.
-
Click the Run Page 1 icon.
-
The Translation Region with the English greeting message is displayed. Click Application<n> in the developer toolbar.
-
You want to display this greeting message in German.Click Shared Components.
-
Under Globalization, click Globalization Attributes.
-
Select German (Germany) (de) for Application Primary Language, No NLS (Application not translated) for Application Language Derived From, and click Apply Changes.
-
Click the Run Page 1 icon.
-
The Home page is displayed with the Greeting message translated in German.
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?
- Other tutorials on Oracle Database Cloud Service - Database Schema Service
Credits
-
Curriculum Developer: Suresh Rajan
- Other Contributors: Chaitanya Koratamaddi