We have a Web Dynpro Java application (CE 7.1 SP11), where we have internationalization (defined using xlf) which is working fine (for EN and DE language) when we pass a URL parameter sap-locale (sap-locale=EN or sap-locale=DE) in Web dynpro application url.
Now, when the application is loaded with English language, we have button in Web dynpro view (button "Change Language"), on click of the Button it has to load in German (DE) language.
Please suggest how we can achiev this.
Thanks and regards,
Basically you're right. Language is taken from the web browser... Unless you override it in your code
Let me give you an example: my web browser language is set to Hebrew.
In my app. I decided that when loaded the text will be shown is English ("Good Morning"), which it does.
When I press the button, I load a new message from the message pool, this time the text is in German and it says "Guten Morgen". The new text in German shows on the screen.
1. language is not just determined by browser, there are many cases, url locale, user profile jvm.... and this is not the point concerning the question raised in the first post.
2. if there are hundreds UI element to be internationalized, i guess you won't go with your customized code......
1. You are right.
2. The customization code I suggested is not a pefect solution, I agree, but it works. It depends
on the size of the application, of course.
3. And yet as you know :
OSS Answer : SAP Note #947081
"WebDynpro Java has a known limitation also described in the SAP Note #947081 (Point 9. Change of locale in Web Dynpro iView).
The Limitation is,
There is one locale assigned per login (user) session. This is done for the first Web Dynpro Java application or Web Dynpro Java iView started in the login session. After detecting the locale, this locale is assigned to the login session and all Web Dynpro applications and all Web Dynpro iViews are started in the same login session. The reason why it has to be this way is that Web Dynpro uses backend connection caches which are associated to the login session and they are locale sensitive"