cancel
Showing results for 
Search instead for 
Did you mean: 

Can not get nw7.3 standalone WDJ app to run forced language/locale

Former Member
0 Kudos

Hi, we are in a situation where we are migrating a portal consisting of several wdj-applications run inside a portal. We have stoped running the apps in the portal, and instead run them as stand-alone (with our own menu etc). We have a custom theme that needs to be kept.

<tldr>Cant force locale, users config in browsers override the settings</tldr>

The apps get lauched through a http://<server>:xxxxxx/webdynpro/resources/<Vendor>/<DC>/<WDApp>?sap-cssurl=http://<server>:xxxxxx/com.sap.portal.design.portaldesigndata/themes/portal/our-theme and its working fine for most of our users. However, some users have specified en_US as their language/locale rather then Swedish, which is the language this app is run in. The language itself isnt a problem (only login page reflects the language change), but date formating is incorrect.

I have tried the suggestions made here http://service.sap.com/sap/support/notes/947081 realized that prtDefault.properties thats talked about there doesnt exists, but changed that in Java System Properties as of here Lookup of Resource Bundle - Portal - SAP Library .

I have got the "old" version, still running inside of the portal to actually be forced into a language/locale, but when running standalone it will not change.

I have tried the &sap-locale= without success.

The users are ~40000 external users, and changing and setting all these in the SAP backend to swedish language is not an option.

As a side note, some people set Arabic as their language, and even though there is no translation, the texts gets changed to right-to-left, and there is no formating on the page. Looking at the error console on the browser there is a missing rl css-file which I think is causing this problem.

What am I missing here.

Running 7.30 SP13 .

/Björn

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Um, well thats not correct. (also thats 7.4 documentation)

I am able to change the users language, with both request.mandatorylanguage in Java System Properties, and with users changing their language settings in their browser.

The problem is that I can only use the request.mandatorylanguage-method when runing inside a portal (and can not do this when running the app in standalone mode).

I basically want to run the app in standalone mode, and tell the server that it should ignore all language/locale setting and just serv up the content in Swedish.

/Björn

former_member191044
Active Contributor
0 Kudos

Well i guess there is no difference between 7.3 and 7.4 in this case. And browser settings will only work if your user does not have any ume language. I have english in my dev portal even though my browser is set to german. You can check it for your users if you don't believe me. As you found out, request.mandatorylanguage only works with portal runtime and you asked for standalone. So the link i posted should be correct. You could change all for your users language via API if you really want only Swedish.

BR,

Tobias

Former Member
0 Kudos

But it doesnt make sense.

Scenario 1.

User A logs in with English in browser setting, to portal. Content displayed with Swedish locale. (default and only lanauge specified is Swedish)

Scenario 2.

User A logs in with English in browser setting, to standalong app. Content displayed with English locale (default and only lanauge specified is Swedish). Only English is in built in datepicker etc.

Both scenarios deals with logged in users. If a user did not have ume set up that would affect both scenario 1 and 2.

We have a login module that does the login, and I guess I might be able to force a user into a specific locale there. Any idea on what kind of API-calls I need to do to change this? IUser only has a bunch of getters, no setters.

former_member191044
Active Contributor
0 Kudos

you can use this:

IUserFactory userFactory = UMFactory.getUserFactory();
IUser iUser = userFactory.getUserByUniqueName("yourUser");
IUserMaint mUser = userFactory.getMutableUser(iUser.getUniqueID());
mUser.setLocale(Locale.GERMAN);
mUser.commit();
Former Member
0 Kudos

Thanks for the reply. It still irks me that I can't controll this better then this. I feel there must be some settings somewhere I have missed that does this. And I doubt that I am the only one that have happened on this kind of problem.

/Björn

former_member191044
Active Contributor
0 Kudos

Well there may be some "hack" to do so. I can't tell for 100% sure that it is impossible ofc. But i don't know how fast you need a solution and also you would need to code that "hack" in all of your WD apps. This is not quite nice either. If every user needs that Swedish language, it would be the cleanest way to set it on user object. But anyway, keep us updated if you find a other way.

BR,

Tobias

former_member191044
Active Contributor
0 Kudos

Seems like for authenticated user you have no way to overwrite with app properties:

Sequence of Language Display - Developing Java Web Dynpro Applications - SAP Library

User local seems to have the highest priority. Sorry.

Regards,

Tobias