cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro Java Internationalization

Former Member
0 Kudos

Hello,

I am trying to implement a very simple Web Dynpro Internationalization project.

I have created a Web Dynpro app, comp & view.

To the root container in view, I added a new transparent container and to this I added a textview (say "Hello World").

I then switched to Navigator view. Under src -> Packages, I copy pasted the <>.xlf file to <>_de.xlf file. I translated the "Hello World" text into German and saved the <>_de.xlf file. I ensured that the Source Language in <>_de.xlf (S2X document editor) is set to German.

I then set the browser language to German.

I deployed the app and the text still shows up in English ("Hello World").

I tried this using Message Pool as well. Used the messageType "text" and then IWDTextAccessor to extract in wdDoInit() method of the view. But still I get the text in English and not German.

In both the above cases I ensured that the Source Language in <>_de.xlf is set to German. But no luck.

Can someone help me with this?

Regards,

Aditya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for quick replies.

I closed all browser windows, deleted the temp files and opened a new browser session. But no luck.

I also tried this on my colleagues machine and it still shows up in English.

Note: I have not written any code for internationalization. I expect the Web Dynpro framework to handle this given a language specific xlf file.

asif_hirani
Active Participant
0 Kudos

you are correct..It's web dynpro framework and language preference which decide's which .XLF file to be picked..

one more thing you can try now is ..right click project ..select RELOAD+REBUILD your project generate new archive and deploy and run your application with browser language preference as de...

if is still doesn't work try testing with some other language copy paste your .xlf again with _fr.xlf and setting browser language to french..

Answers (6)

Answers (6)

Former Member
0 Kudos

Asif,

I tried the options and changed to _fr.xlf file. But still text is shown in English.

This is the simplest possible language translation scenario and I am stuck!!!

Former Member
0 Kudos

Hi aditya,

It is strange, As you mentioned it is simple & should display in german. Go through the below 2 points, might be this was the issue.....

1) After giving german text in _de.xlf & after building the project.Did u make any changes to the UI elements of the iview ?

If the path & Id is modified & build, then the changes will reflect only in the ___.xlf file but not in _de.xlf or _fr.xlf.

Check the resource name of the UI element both in .xlf & _de.xlf file, make sure they are same. i.e Resource name in __.xlf & __de.xlf sholud be same.

2) From the portal header, you will find a link "personalization". Check the language of the portal user in the personalization. If the language is in english, then modify it to German & test.

Regards

Mahaboob Hussain

Former Member
0 Kudos

Hi Aditya,

As Asif rightly said, you need to RELOAD+ REBUILD for your changes to be reflected. Also, the application to be displayed in German needs to have its application property set as sap.locale=<loc>.

Also, you need to start a new session (new browser) for locale changes to be effective.

For testing your application if it has been internationalized correctly, you could follow one of the below procedures:

1. Try appending sap-locale=<loc> (in your case sap-locale=de) to the end of your application URL and check if it works fine.

URL based locale has higher precedence over browser locale

2. Try assigning the application (encapsulated in an iView -> ROLE) to a user whose locale is set to de .

3. Try removing all languages from the Language settings of your browser and then try running your application (This procedure is purely for TESTING PURPOSE and not to be used in practical applications)

Hope this helps.

Regards,

Gaurav.

Former Member
0 Kudos

I have set German as the top priority language in the browser. But still doesn't work.

Also I checked the language preference for the logged in user in User Administration and it is not set. But at the same time the browser language is set to German as indicated above.

Any ideas/tips ?

siarhei_pisarenka3
Active Contributor
0 Kudos

Small note:

Just make sure that you open a new IE instance and perform a new user logon procedure while testing a new locale.

BR, Siarhei

asif_hirani
Active Participant
0 Kudos

This problem could be specific to browser / machine you are using...

try testing the application from another machine..

asif_hirani
Active Participant
0 Kudos

Hi Aditya..

1) by setting default language of your browser to german (Tools --> options --> language) application should use _de.xlf from your webdynpro and show the text in German language

2) else in your Web Dynpro Application properties tab.. click new and set predefined Application propety DefaulLocale to de value so that by default the application is displayed in german language..

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi

Check locale of the user with whom you are logging into the application. If the locale is <undefined> then check browser's locale.

BR, Siarhei

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Aditya,

Are you giving german language as first language in browser?

Use move up and set german{de) language as first language thn refresh ur page .

If it still does not wrk thn close session n open new session .

hope it hlps you

Regards

Khushboo