As far as I know, UI5 determines the wanted localization based on browser's HTTP header accept-language
with respect of supportedLocales
and fallbackLocale
values of the manifest.json
app descriptor.
In my case, however, initially user sees an authorization dialog in English and after authorization I would like set an app localization based on a user config, loaded upon successful authorization.
Based on Language switch in SAPUI5, I've tried to apply:
sap.ui.getCore().getConfiguration().setLanguage("fr");
in the view onInit()
but instead I get a blinked view in the desired localization and then an empty window.
Since sap.ui.getCore().setLanguage()
does not guarantee that already created, language dependent objects will be updated by this call, I've tried location.reload();
to trigger a complete page reloading and rebuilding all UI5 elements but it doesn't help.