Introduction
Specifying the primary language for an application in Oracle APEX is the first step toward creating a globalized, multilingual experience. The primary language acts as the default for all application labels, messages, and user interface text when no other language preference is set. It also serves as the base language for translation files and determines how Oracle APEX handles text rendering and regional settings by default.
In Oracle APEX, specifying the primary language of your application is the foundational step for enabling multilingual support and regional formatting. The primary language acts as the default for all application interface elements, and it also becomes the source language when you export content for translation.
To define the primary language in Oracle APEX:
-
Open Your Application
From the APEX App Builder, open the application where you want to set the primary language. -
Navigate to Globalization Attributes
Go to Shared Components > Globalization Attributes. This section controls how language and regional formatting are handled across the application. -
Set the Primary Language
In the Globalization Attributes screen, locate the field labeled Primary Language. Select the appropriate language code from the list (e.g.,en
for English,fr
for French,es
for Spanish). This value tells APEX which language to use as the default when no other language is defined for the session or user. -
Select Language Source (Optional but Recommended)
Below the primary language field is Application Language Derived From. This option determines how the application decides which language to use during a session. You can choose from:-
Browser Language – Detects the browser’s default setting.
-
Application Item – Uses a page item (like
P0_LANGUAGE
) to control language, often from a language selector dropdown. -
User Preference – Retrieves the language from a custom user profile.
-
Substitution String – Allows advanced or dynamic control.
If you plan to let users change the language, it's best to use the Application Item option, then create a dynamic action or process to set the value of that item based on user input.
-
-
Use with Language Translation
Once the primary language is set, APEX uses this as the base for any translation you implement. When exporting XLIFF files to translate application content, the source text is assumed to be written in the primary language. This ensures consistency and accuracy when importing translated versions. -
Save and Apply Changes
Click Apply Changes to confirm the configuration. APEX will now treat the selected language as the default for any session where no alternate language has been set. -
Test Your Setup
Run the application and verify that all UI text appears in the correct default language. If you’ve enabled user-selected languages via an item, make sure switching values updates the application accordingly.
By specifying the primary language, Oracle APEX ensures consistent text rendering, predictable formatting for dates and numbers, and a reliable foundation for managing multilingual support. This setting is crucial when planning for translation, as it helps Oracle APEX understand how to process language switching and fallback behavior.
Oracle APEX supports multi-language applications through Globalization Attributes, which determine how the application’s text, date formats, and other language-dependent settings behave. One of the key aspects of globalization is specifying the Primary Language for an application.
Setting the correct Primary Language ensures that Oracle APEX properly handles text direction (left-to-right or right-to-left), language-specific messages, and translated content.
Steps to Specify the Primary Language in Oracle APEX
To define the Primary Language for your application, follow these steps:
Open Your Application
Navigate to App Builder in Oracle APEX.
Select the application you want to modify.
Access Globalization Attributes
Click on Shared Components.
Under the Globalization section, select Globalization Attributes.
Set the Primary Language
Locate the Primary Language setting.
Choose the desired language from the dropdown list.
Save the Changes
Click Apply Changes to save and apply the selected language to the application.
How the Primary Language Affects an APEX Application
When you specify a Primary Language, Oracle APEX:
Automatically determines the default language used for labels, messages, and UI components.
Adjusts the date and number formats based on language conventions.
Controls the text direction (left-to-right for English, French, etc.; right-to-left for Arabic, Hebrew, etc.).
Determines which translation files are used when running a translated version of the application.
Overriding the Primary Language at Runtime
Even after setting a Primary Language, APEX allows users to override this setting dynamically.
1. Using a URL Parameter
Users can change the application’s language by appending the p_lang parameter to the URL:
f?p=100:1:&SESSION.:LANG=en
This forces the application to display in English.
2. Using Application Computations
To dynamically set the language based on user preferences, create a Computation for the APP_USER_LANG substitution string:
Go to Shared Components > Application Computations.
Create a new computation for APP_USER_LANG.
Use the following SQL to fetch the preferred language from a user profile table:
SELECT language_preference FROM user_settings WHERE user_id = :APP_USER;
Set computation point to On New Session.
This ensures that each user gets their preferred language when they log in.
3. Using PL/SQL to Change Language
If you need to programmatically update the language setting, use:
BEGIN
APEX_UTIL.SET_SESSION_LANG('fr');
END;
This will switch the session to French.
Best Practices for Setting the Primary Language
Choose a default language that matches your primary user base.
If supporting multiple languages, implement translation files (XLIFF).
Allow users to select their preferred language via session settings.
Use language-specific date and number formatting to ensure proper localization.
By properly configuring the Primary Language in Oracle APEX, you can create a more user-friendly and globally accessible application.
Conclusion
Setting the primary language in Oracle APEX provides a clear foundation for internationalizing your application. It ensures that all users see a consistent default language and allows you to build translation logic on top of a well-defined base. Whether you're targeting a single language audience or preparing for a multi-language rollout, correctly defining the primary language is an essential step in delivering a professional, localized application.