oracle-apexglobalization

Main Methdology steps to configure multi-languages application


I want to make my application multi-languagas and achieves following conditions:

What the main steps will be followed to apply the previous conditions on my Oracle Apex application? Try to apply these steps if you have two languages en and ar.


Solution

    1. From Shared Components > Globalization set the Application Primary Language to English (en), then set Application Language Derived From to Item Preference (use item containing preference).
    2. From Shared Components > Translate > Define application languages add Arabic (ar).
    3. From Shared Components > Application Items add new item FSP_LANGUAGE_PREFERENCE.
    4. From Shared Components > Lists > Navigation Bar add the entries which are their attributes defined in the following table:
    Name Target Type Page Icon Parent Entry Request Set these items With these values
    Select Language No Target - fa-globe - - - -
    English Page in this application &APP_PAGE_ID. - Select Language LANG FSP_LANGUAGE_PREFERENCE en
    العربية Page in this application &APP_PAGE_ID. - Select Language LANG FSP_LANGUAGE_PREFERENCE ar
    1. From Shared Components > Application Processes add SET_LANG process, with the source code of PL/SQL language:
    BEGIN
        APEX_UTIL.REDIRECT_URL(P_URL => '&APP_PAGE_ALIAS.' || '?SESSION=' || '&APP_SESSION.');
    END;
    

    then set its Condition Type as Request = Expression 1, where Expression 1 is LANG.

    1. In Login Page which its PAGE_ID is 9999 add the following:
    SELECT
        case
            WHEN :FSP_LANGUAGE_PREFERENCE = 'en' then 'English'
            WHEN :FSP_LANGUAGE_PREFERENCE = 'ar' then 'الإنجليزية'
        end as d,
        'en' as r
    FROM DUAL
    
    UNION ALL
    
    SELECT
        case
            WHEN :FSP_LANGUAGE_PREFERENCE = 'en' then 'Arabic'
            WHEN :FSP_LANGUAGE_PREFERENCE = 'ar' then 'العربية'
        end as d,
        'ar' as r
    FROM DUAL
    
    DECLARE
    BROWSER_LANG VARCHAR(2) := substr(NVL(owa_util.get_cgi_env('HTTP_ACCEPT_LANGUAGE'),'en'),1,2);
    BEGIN
        CASE 
            WHEN :FSP_LANGUAGE_PREFERENCE IS NULL AND :P9999_LANG IS NULL THEN
                :P9999_LANG := BROWSER_LANG;
                :FSP_LANGUAGE_PREFERENCE := BROWSER_LANG;
            ELSE
                NULL;
        END CASE;
    END;
    
    begin
        :FSP_LANGUAGE_PREFERENCE := :P9999_LANG;
    end;