🚀 Translate Once, Reach Everyone: Oracle APEX 26.1 Application Translation

🚩Introduction 

  • In modern Oracle APEX applications, it is important to make the app usable for people who speak different languages. Oracle APEX 26.1 introduces a simple way to do this called Application Translations using Text Messages

  • With this feature, developers can build the application in their primary language first, then convert the labels and other text into reusable Text Messages. These text messages can be exported, translated, and imported back, so the same application can run smoothly in multiple languages without extra effort.

📑 Why This Approach Is Needed

In Oracle APEX applications, users from different regions often need the app in their own language. Doing this manually by creating separate copies of the application can take time, cause mistakes, and become hard to maintain.

Using Text Message based translations becomes important when:

  • Applications need to support more than one language

  • Text needs to stay consistent and easy to update

  • Translations need to be shared with external translators using standard formats like CSV or XLIFF

  • Developers want to manage all languages from a single application

  • A simple and reliable translation process is important

This approach helps developers work faster, avoid duplicate applications, and makes the overall translation process smoother while keeping everything simple and well integrated in Oracle APEX.

👉 Use Case: Application Translations in Oracle APEX 26.1

In Oracle APEX, developers often need to make one application available in multiple languages, such as English, Spanish, or Arabic. With Application Translations, developers can enable translation from Shared Components, convert the application text into Text Messages, and define the target languages.

In this blog, we will see how Application Translations can be used in Oracle APEX 26.1 to export text messages, get them translated, and import them back into the application. It helps developers manage multiple languages from one place, making the app more accessible and easier to maintain.

Step 1: 

First we need to enable the application translation, to do so, go to Shared Component-> Globalization Attributes -> Enable Translate Application and select the Translation method as Text Message Based.

Step 2: 

Next, Go the Shared Components -> Application Translations, click on the add language and select the language which you want.

Step 3: 

Once the language is added, click on the Export Text Messages and download as XLIFF/CSV file

Step 4: 

Now, Translate the contents in the downloaded file using any AI Tools (Claude / Chatgpt) and again import it using Import Text Messages option in the Shared Components -> Application Translations

Step 5: 

Once the required languages were added, translated and imported into the application, then go the Shared Components -> Application Items, create new application item (G_LANG_PREFERENCE).

Step 6: 

Next, Go to the Shared Components -> Globalization and select the property Application Preference (use FSP_LANGUAGE_PREFERENCE) from the Translation Language Derived From.


Step 7: 

Now, Go the Shared Components -> Application Process, create the process of type (On Load: Before Header) and copy paste the code below.

BEGIN
APEX_UTIL.SET_PREFERENCE(
p_preference => 'FSP_LANGUAGE_PREFERENCE',
p_value => :G_LANG_PREFERENCE -- Application Item
);
apex_util.redirect_url(p_url=>'&APP_PAGE_ALIAS.' || '?session=' || '&APP_SESSION.');
END;


And in the conditions section, select the condition type as Request = Expression 1 and in the Expression1 LANG

Step 8: 

In the Global Page (0), create the Radio button / Select List with the languages you want to switch between, it should return the respective language codes (like for english : en and tamil : ta). Create the dynamic action for that page item and create the action as Execute Server-side code action and copy paste the below code. Create one hidden page item to store the url.

DECLARE
l_url VARCHAR2(4000);
BEGIN
l_url := apex_page.get_url(
p_page => :APP_PAGE_ID,
p_request => 'LANG',
p_items => 'G_LANG_PREFERENCE',
p_values => :P0_LANG -- Page Item ('ar-om')
);

:P0_URL := l_url; -- hidden page item
END;

create the another action as Execute JavaScript Code action and copy paste the below code. This is used to reload the page with the request Lang and it switches between the selected languages.

window.location.href = apex.item("P0_URL").getValue();

Step 9: 

Now, save and run the page, you will see the radio button / select list page item, there you can switch between the languages, once you select different language then the page is translated into the desired language.

🔥 Conclusion

Thus, in Oracle APEX 26.1, Application Translations using Text Messages allows developers to easily manage multiple languages in a single application. This makes it simple to export, translate, and import text using standard formats, reduces manual effort, and improves usability for users across different languages.


Comments

Popular posts from this blog

🔍 Extending Smart Search Filter for Multiple Regions

📌Track Active Tab switch in Region Display Selector without any plugins

💡 Designing Dynamic QuickPicks in Oracle APEX