Skip to Content
avatar image
Former Member

Web Dynpro Java Internationalization

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 09, 2010 at 04:21 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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..

  • avatar image
    Former Member
    Feb 09, 2010 at 06:11 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 09, 2010 at 03:21 PM

    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..

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2010 at 08:52 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 09, 2010 at 09:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2010 at 03:31 PM

    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 ?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 09, 2010 at 05:59 PM

    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!!!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.