cancel
Showing results for 
Search instead for 
Did you mean: 

internationalization problem - default language of wd in portal

RolfC
Explorer
0 Kudos

Hi experts,

I have an wd application developed in american english. I translated it to german.

Now I have <...>.xlf, <...>_de.xlf and <...>_en.xlf resources.

The application is running with user authentication.

If I logon to Portal with en or de browser settings, it works fine.

If I logon to Portal with (fr) french browser settings (Portal User Indicator is set to browser settings),

the application comes with german resources. All Portal Resources are in french, the iView/Page texts of my WD iView are in english (default).

How can I set the default WD language to english? I thought, if no resources found for a language, the project language (american english) is used.

Setting DefaultLocale (normally used for anonymous logon) of the application to english doesn't work.

I am using NW04 SP13.

Thanks

Carsten

Accepted Solutions (1)

Accepted Solutions (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Carsten,

there are two fallback-sequences being processed:

A) session locale

B) property-resource-bundle locale

In your case the session locale is fr. Now the second fallback starts for finding the right property resource bundle. And here comes the problem. You as a developer cannot really influence this fallback, because it is also based on the JVM-locale of the running SAP Web AS. Assume this JVM default locale is 'de'. In this case the <...>_de.xlf is used because it matches the JVM default locale. In case the JVM default locale is set to 'fr' the search ends with the no-locale <...>.xlf file as desired.

At the moment I do not know how to configure the JVM default locale of a SAP Web AS.

Based on this problem we recommend the following approach:

<i><b>1.)</b> The no-locale.xlf (project language) file should contain those texts to be displayed when no <...>_<locale>.xlf can be found. This means it should contain texts in the default-language which is displayed instead of all supported langages.

<b>2.)</b> The no-locale.xlf is only read in case the JVM Default Locale is itself set to either an unsupported language (this means the fallback cannot stop with a <...>_<locale>.xlf file of a supported language) or to the default-language like 'en'.

<b>3.)</b> The no-locale.xlf should contain texts in the default language. This means do not enter german texts there in case you want to display english default texts.</i>

Regards, Bertram

Former Member
0 Kudos

Hello Bertram,

thank you for your fast answer!

The described scenario is excactly what happens in my case. The session locale is e.g. fr, a non-supported language. And probably my JVM default is de. That is why always german will be displayed.

Now following your approach. This doesn't help me solving the problem. I already changed all the texts of my no-locale xlf-files to english.

Anyway, german will be still displayed. I think, it is because the <...>_de.xlf is still used (following the described scenario above...)

Do you know another way how to solve this problem?

We have a quite large project with more than 2000 users worldwide.

Thank you very much!

Best Regards

Matthias Müller

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Matthias,

You can analyze the resource-bundle determination process of the Web Dynpro Runtime within the <i>Web Dynpro Content Administrator</i>

<b>Using the WD Content Admin to simulate different Session Locales</b>

  • Open the WD Content Admin

  • Navigate to your deployed WD DC/Project

  • Open the Applications node and select your application

  • In the work area select the tab <i>Language Resources</i>

In the first group you see the <i>Current Session Infos</i>: Current session locale and the <i>Default VM locale</i>

  • Check the default VM locale

  • The first table displays the deployed resource bundles and the available locales.

  • Above the second table you can analyze/simulate the text-retrieval for a certain session locale by selecting a locale with the listbox 'Select a Language'

  • The second table lists the following texts for a given key and for the selected locale:

  • Value: if a <...>_<locale>-bundle exists for the selected language the corresponding displaytext is displayed.

  • Default Value: displaytext within the <...>-bundle/default-bundle (without a locale suffix) is displayed

  • <b>Value Loaded by the WDResourceHandler</b>: that's the final text being displayed on the UI. If there is a resource bundle for the default JVM locale this displaytext is taken but not the default-displaytext.

<b>How to change the JVM Default Locale</b>

In your case you should change the JVM Default Locale from 'de_DE' to 'en_US'. This can be done with the follwowing procedure:

  • Open the <u>J2EE Engine Configtool</u>: <i>C:\usr\sap\J2E\JC00\j2ee\configtool\configtool.bat</i>

  • Open the node cluster-data -> instance_IDXX -> server_IDXX

  • Open tab 'General'

  • Add the following two parameters within the <i>Java parameters</i> text box

  • <b>-Duser.language=en</b>

  • <b>-Duser.country=US</b>

  • Restart your SAP J2EE Engine

I assume that this is the solution for your undesired de-fallback issue.

Best regards, Bertram

Former Member
0 Kudos

Hello Bertram,

thank you for your reply.

I just tried out what you wrote me and it seams as if it is working.

Especially the analyzing of the Session I didn't know!

The parameter setting for the user language in the Config tool is working fine. I tried this out before but it didn'T work. I obviously used the wrong parameter name:

Instead

-Duser.

country

=US I used -Duser.

region

=US.

Best Regards,

Matthias Müller

pankaj001
Participant
0 Kudos

Hi Bertram,

I am also facing similar kind of issue in Internationalization.

I have created <filename>_<language_id>.xlf and <filename>_<language_id>_<country_id>.xlf (like for "tr" and "tr-TR") but after running the application with browser language "tr-TR" ,it is selecting text from "tr" only.

The application does not require any log-in.It is accessed through an URL.

After checking ear file I found that resource bundle properties file for "tr-TR" is not there in .ear.How to get this property file in ear?

Do you have any idea?

Thnks.

Regards,

Pankaj

Answers (1)

Answers (1)

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos
RolfC
Explorer
0 Kudos

Hallo Bertram,

I know this SAP Online Help, but maybe - I don't understand.

For an authenticated user, the resource bundle is searched with this priority:

1) Language indicator of the user  (Example: Language not set in portal)
2) Language preference of the browser (Example: fr - Resource doesn't exists)
3) Language indicator of the Web Dynpro Application (Example: ?? - where could I find/set this Application property?)
4) Language preference of the system (Example: ?? - where could i find this preference)
5) Language preference of the JVM  (Example: Default VM locale - de_DE)

I thought the "Language indicator of the Web Dynpro Application" is the web dynpro project language. So it has to be (american) english!?

Regards, Carsten

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Rolf,

the "language indicator of the Web Dynpro Application" is not the project language, which is specified when creating a new Web Dynpro project. This project language is only specified for design time purposes (translation) but it is not relevant for the Web Dynpro Runtime environment.

The application's language indicator is defined as an application property: see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/09/a4d6a674bc1d4a9e74abf81bed3ef6/frameset.htm">SAP NW Online Help - Configuring a Web Dynpro Application</a>

Regards, Bertram

RolfC
Explorer
0 Kudos

Hallo Bertram,

the fog is lifting!

My first test with the DefaultLocale / sap.locale property doesn't work. But it could be an other error. So, I'll try it again... And I got german?

Thanks,

Carsten

Former Member
0 Kudos

Hello,

I have a similar language problem.

My WD application is developed in German.

I have translation of the xlf-files (.._en.xlf, .._fr.xlf).

The application is running with user authentication.

Now it may happen that portal user language is not set in portal --> language of browser is e.g set to albanian.

For albanian there are no .xlf-resources customized.

The displayed language is now always German (Language indicator of the Web Dynpro Application).

How can I change this language to English?

I tried to set the sap_locale in application properties, but this doesn't help me.

Thanky you.

Matthias