I need some help to solve a session language problem (on APEX 20.2).
I have a translated application (primary language and one translation). Application Language Derived From is set to Session. So, I use the p_lang URL parameter to set session language.
The problem I am facing is to get the current language using APEX_UTIL.GET_SESSION_LANG.
The value that is returned is always one page refresh or submit behind the actual language. So, the first time the p_lang parameter changes, I see the previous language returned by APEX_UTIL.GET_SESSION_LANG. Only after a page refresh do I see the correct language.
This is so weird. The app immediately changes to the correct language when changing p_lang, but APEX_UTIL.GET_SESSION_LANG does not.
I've checked this behaviour with an item on the page that gets its value from an After Header computation with source
return APEX_UTIL.GET_SESSION_LANG;
So, is there a way to get the current language immediately after changing p_lang?