29.3 CREATE_LANGUAGE_MAPPING Procedure

Use this procedure to create the language mapping for the translation of an application. Translated applications are published as new applications, but are not directly editable in the App Builder.

Note:

This procedure is available in Application Express release 4.2.3 and later.

Syntax

APEX_LANG.CREATE_LANGUAGE_MAPPING (
  p_application_id IN NUMBER,
  p_language IN VARCHAR2,
  p_translation_application_id IN NUMBER )

Parameters

Table 29-3 CREATE_LANGUAGE_MAPPING Parameters

Parameter Description

p_application_id

The ID of the application for which you want to create the language mapping. This is the ID of the primary language application.

p_language

The IANA language code for the mapping. Examples include en-us, fr-ca, ja, he.

p_translation_application_id

Unique integer value for the ID of the underlying translated application. This number cannot end in 0.

Example

The following example demonstrates the creation of the language mapping for an existing Application Express application.

begin
    --
    -- If running from SQL*Plus, we need to set the environment
    -- for the Application Express workspace associated with this schema. The
    -- call to apex_util.set_security_group_id is not necessary if
    -- you're running within the context of the App Builder
    -- or an Application Express application.
    --
    for c1 in (select workspace_id
                 from apex_workspaces) loop
        apex_util.set_security_group_id( c1.workspace_id );
        exit;
    end loop;

    -- Now, actually create the language mapping
    apex_lang.create_language_mapping(
        p_application_id => 63969,
        p_language => 'ja',
        p_translation_application_id => 778899 );
    commit;
    --
    -- Print what we just created to confirm
    --
    for c1 in (select *
                 from apex_application_trans_map
                where primary_application_id = 63969) loop
        dbms_output.put_line( 'translated_application_id: ' || c1.translated_application_id );
        dbms_output.put_line( 'translated_app_language: ' || c1.translated_app_language );
    end loop;
end;
/