on 04-16-2007 7:55 AM
Hi people,
I want to change dynamically the language of my webdynpro application. I followed the steps described in the thread
When I start a new browser window (IExplorer 6.0) and I enter the URL of my application with the url parameter sap-locale="de_DE" or sap-locale="en_US" the application starts in the desired language. Fine!
But if I terminate the application like described in the thread
final String locale = wdContext.currentContextElement().getDropDown();
try
{
final String url = WDURLGenerator.getApplicationURL(
wdComponentAPI.getApplication().getDeployableObjectPart(),Collections.singletonMap("sap-locale", locale));
WDClientUser.forceLogoffClientUser(url);
// IWDWindow w = wdComponentAPI.getWindowManager().createExternalWindow(url, "hjhj", false);
// w.open();
}
catch (final WDURLException ex)
{
wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(ex), false);
}
the application restarts, but without changing the language, even if the URL has the URL parameter sap-locale set.
Is this a bug of the browser (is the language cached?)? Any idea how the change the language of the appliaction, out of the application itselfe?
Thanks for your help!,
Thanks
Hi,
Check out this thread.
<a href="/people/abdulbasit.gulsen/blog/2007/02/21/multilingual-external-facing-portal-with-different-contents Capability</a>
Hope it ll b of help
Regards,
Anish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried setting your preferred language in the <i>browser</i> ?
<blockquote>
IExplorer: Tools>Internet Options>Languages
</blockquote>
I feel this method is the least intrusive for the user, as his/her language preference will usually be set not just for your app, but for any site he/she visits.
<p>
However, if you wish to change languages, you need to be aware of the fact that you might need to close your browser, modify your language preferences, and then start a new session .
<p>
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thomas,
There is another solution, but with a bigger impact. Did you think about change the user attribute language at the UME before close the application? This solution will work.
Regards,
Luciano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
You can get reference to IUser through WDClientUser.getCurrentUser().getSAPUser()
try
{
IUserFactory userFactory = UMFactory.getUserFactory();
IUser user = WDClientUser.getCurrentUser().getSAPUser();
IUserMaint userToChange = userFactory.getMutableUser(user.getUniqueID());
Locale newLocale = //get new locale;
userToChange.setLocale(newLocale);
userToChange.commit();
}
catch (Exception e)
{
//report
}
Best regards, Maksim Rashchynski.
Hi Thomas,
Have a look at the below code:
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user_wd = wdUser.getSAPUser();
String userId = user_wd.getUniqueID();
IUserFactory userFactory = UMFactory.getUserFactory();
IUserMaint user = userFactory.getMutableUser(userId);
String lang = "es";
user.setLocale(new Locale(lang,"",""));
user.save();
user.commit();
This code will change the user language attribute at the UME. The bigger impact is because this change will impact all applications over the landscape. I.E. If the web dynpro application change the user language at the UME, this change will be reflected at the Portal.
Regards,
Luciano
Thank you for your answers, but I have still the same problem. The recommendation of changing the sap-users language attribute doesn't work, because I'm working with an application without authententication.
I tried to exit the application with an exit-plug, passing the url http://<host>:<port>/webdynpro/dispatcher/local/TestLanguage/TestApp?sap-locale=en_US, without success.
If I start the application with this url in a new browser window, the application is starting in english. If I start the application in german and then call the same url through the exit-plug the application remains in german. This must be a browser problem, mustn't?
Any help appreciated,
Thomas
Hallo Thomas,
this is a known restriction in Web Dynpro. The locale of a running Web Dynpro application is associated with the Client Session. And client session is associated with the client window. This means starting a new client window (adressing the same WD application with another sap-locale-URL-parameter value) will not affect the session locale of the adresses application.
The only workaround is to start a new Web Dynpro application (requiring <b>no</b> authentication) by "running the browser programm from scratch", this means not keeping the existing browser window open and then selecting menu item "new window" or opening the target application in a new external window. You must either close the window with the running application and then start a new browser window or you must open a new browser program via a task bar icon or the start menu (i.e. run <browser program>.exe again).
<b>Consequence (NW04 / NW04s)</b>
<i>For your specific requirement "restarting a running Web Dynpro application without authentication in another session locale" can only be achieved by running the <browser program>.exe again. Running another window instance in the same client session will not affect the initial session locale.</i>
Regards, Bertram
No idea where the problem may be?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.