- Constants
- RENDER Function
- VALIDATE Function
- OUTPUT_LANG_TAB Function
- GET_TL_VALUE Function
- SET_TL Function
- ADD_TL Function
- REMOVE_TL Function
Name | Code | Description |
---|---|---|
gc_scope_prefix | `gc_scope_prefix constant VARCHAR2(31) := lower($$PLSQL_UNIT) |
Render the item as a hidden and display combo.
Original concept for using JSON columns to store language: Bruno Mailloux
function render(
p_item in apex_plugin.t_page_item
, p_plugin in apex_plugin.t_plugin
, p_value in gt_string
, p_is_readonly in boolean
, p_is_printer_friendly in boolean
)
return apex_plugin.t_page_item_render_result
Name | Description |
---|---|
p_item |
Standard plugin parameters |
Perform validations on the submitted data:
- Ensure the data is JSON format
- Ensure the JSON format is of the expected form
function validate (
p_item in apex_plugin.t_page_item
, p_plugin in apex_plugin.t_plugin
, p_value in varchar2
)
return apex_plugin.t_page_item_validation_result
Name | Description |
---|---|
`` |
Convert a tab_lang_type
array to JSON format of the form:
[
{"l":"en","tl":"Name"},
{"l":"fr","tl":"Nom - Français"},
{"l":"es","tl":"Nombre - Español"}
]
function output_lang_tab(p_tab in out nocopy tab_lang_type)
return clob
Name | Description |
---|---|
p_tab |
tab_lang_type |
return | clob JSON object |
Given a JSON string (p_value) return the value of the language defined by code (p_l)
function get_tl_value(
p_value in varchar2
, p_l in lang_code default apex_application.g_flow_language
)
return varchar2
Name | Description |
---|---|
p_value |
JSON MLS structure |
p_l |
language code (ie. 'es', 'fr', ...) |
return | New value as varchar2 |
tk_jtl_plugin.get_tl_value(:P3_NAME_JTL, :SESSION_LANG) is not null
Given a JSON string (p_value) update the corresponding language code (p_l)
with a new translation (p_tl)
function set_tl(
p_value in varchar2
, p_l in lang_code default apex_application.g_flow_language
, p_tl in varchar2
)
return varchar2
Name | Description |
---|---|
p_value |
JSON MLS structure |
p_l |
language code (ie. 'es', 'fr', ...) |
p_tl |
New translated value |
return | New JSON MSL value |
update px_projects
set name_jtl = tk_jtl_plugin.set_tl(name_jtl, 'en', 'New value')
where id = 21;
Given a JSON string (p_value) add a new language as defined by code (p_l)
and translation (p_tl) at the end of the JSON MLS structure
function add_tl(
p_value in varchar2
, p_l in lang_code default apex_application.g_flow_language
, p_tl in varchar2
)
return varchar2
Name | Description |
---|---|
p_value |
JSON MLS structure |
p_l |
language code (ie. 'es', 'fr', ...) |
p_tl |
New translated value |
return | New JSON MSL value |
update px_projects
set name_jtl = tk_jtl_plugin.add_tl(name_jtl, 'en', 'New value')
where id = 21;
Given a JSON MLS string (p_value) remove a language as defined by code (p_l)
function remove_tl(
p_value in varchar2
, p_l in lang_code default apex_application.g_flow_language
)
return varchar2
Name | Description |
---|---|
p_value |
JSON MLS structure |
p_l |
language code (ie. 'es', 'fr', ...) |
return | New JSON MSL value |
update px_projects
set name_jtl = tk_jtl_plugin.remove_tl(name_jtl, 'en', 'New value')
where id = 21;