/* * Created by PyramIDE. * User: フランスのトトロ aka (David RENÉ) * Date: 17/04/2020 * Time: 15:00 * © David RENÉ */ read locale/L3.anubis read xlib/web/CXM_web_session.anubis read app/app_loggers.anubis public define String default_language = "en". public define (String symbolic_name) -> String make_translate_function ( WEB_Session _session ) = with lang = _session.language, app_dictionnary = get_String(_session.fields, "AWS_CURRENT_DICTIONARY", ""), if l3_load_base(app_dictionnary) is { failure then logError(debug_log,"Can't load translation dictionnary for '"+app_dictionnary+"'"); (String symbolic_name) |-> "<" + symbolic_name + ">", success(L3 local) then //now we set the current language with _l3_object = l3_set_current(local, lang), l3_object = l3_set_default(_l3_object, default_language), if lang = "symb" then (String symbolic_name) |-> "[" + l3_get_text(l3_object, symbolic_name) + "]" else (String symbolic_name) |-> l3_get_text(l3_object, symbolic_name) } .