🚀 Translate Once, Reach Everyone: Oracle APEX 26.1 Application Translation
🚩Introduction
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
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
Step 3:
Step 4:
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;
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.
Comments
Post a Comment