on 2012 Apr 01 2:37 PM
Dear All,
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,
Patana
Request clarification before answering.
Patana
please close discussion
regards
yuval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Jun, I have just tested it and it works great.
1. Bind your textView to context attribute
2.In wdDoInit(). fill the context with values stored in the message pool
3. When button clicked, re-bind the context to language-specific message stored at the pool.
regards
yuval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun
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.
Easy
regards
yuval peery
Hi Jun
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"
regards
yuval
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
1. I assume you load your text when application starts ie. in wdDoInit().
2. If this is the case, you can put the same code in an action bound to your button, only this time
use the other language xlf you need to switch to.
regards
yuval peery
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 | |
30 | |
10 | |
8 | |
8 | |
7 | |
6 | |
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.