on 10-01-2010 9:15 AM
Hi,
i have a webdynpro application in spanish and it is translated to english and portuguese too. I have two traductions
Translate 1 : views,simpletypes,messagePool (.xlf files)
Translate 2 : r3 data (descriptions, names...) I´m using RFCs to obtain data from R3 and i send the language in input parameters and R3 return me descriptions in the language passed.
My application has sap authentication, and i have the language from logged user.
But the problem is when the logged user has not a language predifined, then Translate 1 is in the first language in the preference of the browser (p.e. 'es'). i need this language to send it to R3 but i can not obtain it, i only can obtain the default Locale but i can not obtain the first language in the preferences of the browser.
i have used Locale class from Java, but it doesn´t help me.
Any idea?
Thank you
Hi everybody,
thank you for your answers.
Definitely i have tested with Poojith's code:
java.util.Locale sessionLocale = WDClientUser().getCurrentUser().getLocale();
and with Manoj code:
WDResourceHandler.getCurrentSessionLocale().getLanguage();
and both solved the problem. They return me the first language of the preferred list of the
browser, but i have a question:
-In this moment the user has not a language predefined in sap(UME) and i have not permissions to change it, if a user has predefined language, do these codes return me the sap language or browser preferred language?
Thank you for all
Edited by: Fernando Acevedo on Oct 4, 2010 9:56 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernando -
For you problem following would be the solution - I have done this in PAR file so I am sharing that thing.. if u wanted to do the same in WD java.. then some modification will come but the concedpt will be the same..
IUserContext usrContext = request.getUser(); // get the user logined
java.util.Locale loc = usrContext.getLocale();
String usrLang = loc.getLanguage();
usrLang will always be the BROWSER language.
Cheers!
Roshan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the following code:
WDResourceHandler.getCurrentSessionLocale().getLanguage();
The language preference is in the below order:
1. Logged in user language setting in the portal(UME).
2. From the browser Locale setting
3. JVM Locale
Hope it helps.
Regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Fernando,
I faced some problems when the user change the language because they don't want the user change it through Explorer.
If you want to controll that changes use SAP POrtal and Single Sign On to mantain the language setted in backend (ECC for example).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
To get the language from Browser or UME setting use the following code:
java.util.Locale sessionLocale = WDClientUser().getCurrentUser().getLocale();
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.