jochen-z
12/29/2017 - 11:24 AM

Translate & Deploy multi language app

APEX multi language app

declare
 c_release constant varchar2(20) := '171113';
begin

for c1 in (select workspace_id from apex_workspaces where workspace = 'DQS') 
loop
        apex_util.set_security_group_id( c1.workspace_id );
        exit;
end loop;

-- Seed the translation repository
 apex_lang.seed_translations(
        p_application_id => 2000,
        p_language => 'fr-ch' );

 apex_lang.seed_translations(
        p_application_id => 2000,
        p_language => 'it-ch' );	
commit;

-- APEX Repository aktualisieren für DQS

for r1 in (select de, fr, it from transl_repos where release = c_release)
loop
for t1 in (select id
                 from apex_application_trans_repos
                where application_id = 2000
                  and dbms_lob.compare(from_string, to_nclob(r1.de)) = 0
                  and language_code = 'fr-ch') 
				loop
						apex_lang.update_translated_string(
							p_id => t1.id,
							p_language => 'fr-ch',
							p_string => r1.fr);
				end loop;

				
end loop;
commit;


for r2 in (select de, fr, it from transl_repos where release = c_release)
loop
update APEX_050000.wwv_flow_translatable_text$ set TRANSLATE_TO_TEXT = r2.it
where TO_CHAR(SUBSTR(TRANSLATE_FROM_TEXT, 1, 4000)) = r2.de
and translated_flow_id = 2002;

end loop;

commit;

apex_lang.publish_application(
        p_application_id => 2000,
        p_language => 'fr-ch' );	

apex_lang.publish_application(
        p_application_id => 2000,
        p_language => 'it-ch' );	
		
commit;
end;


-- APEX_LANG
-- https://docs.oracle.com/cd/E59726_01/doc.50/e39149/apex_lang.htm#CHDBGCDI