on ‎2020 Nov 25 5:41 PM
Hi
Do we anywhere in the oData Class interface have the language property of the used webbrowser.
i mean - if uger has default language DE in user master, but uses en-EN in the browser, Can i check this anywhere or do i need to build it into all the Entityˋs where i need to fetch data for specific languages?
I.ex i could build a material list and need the text returned based on browser setting.
What is best practice?
Request clarification before answering.
Maybe this helps you (https://github.com/SAP/openui5/issues/1137)?
Maybe you check also your supported locals:
"supportedLocales": ["dk", "en"],
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jakob,
OData build on top of HTTP which is why you can use the header accept-language. This question here might also be helpful in case you want to set a default language.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marius
Thanx - basically it works. BUT: when i set the default language in the Browser it is ok. But i have done a small "trick" in order to provide the user with the posibility to change language for this application only.
Simply by using this code on Button Press (just a switch between DK and EN):
var sCurrentLocale = sap.ui.getCore().getConfiguration().getLanguage();
if (sCurrentLocale === "en_EN"){
sCurrentLocale = "da_DK";
} else {
sCurrentLocale = "en_EN";
}
sap.ui.getCore().getConfiguration().setLanguage(sCurrentLocale);
But when switching in this way it seems like the accept-language is not changed?
Any ideas?
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.