on 10-11-2005 11:41 AM
Dear all,
I want to set thwo languages for my webdynpro application.
<b>EN</b> and <b>TH</b>. Can anybody suggest how to go about it??
Regds,
Anup.
Hi Nibu
i needed a help from u .
I'm trying to change the language of a webdynpro depending on value selected in the dropdown.
I have a dropdown in the first page and have made the required .xlf files.In the second view,
i need to display the labels in the language selected in the dropdown.
can u help me in this matter.
Thanks in Advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It depends if your Webdynpro applications is running through portal or not.
When running through EP, the screens are displayed using the defined/connected portal user's language. Setup by the portal user or admin.
Also, if the data content comes through JCO and RFC calls to R/3, the data language is defined by the data dictionnary through the "R/3 user" language. In this case, you have to setup the JCO language definition on the J2EE server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anup,
The only way to achieve this functionality is to forcefully log-off the user & relogin with the selected locale. But if used for an authenticated application, the user needs to enter his credentials again. In case of anonymous users, this works perfectly.
First, follow the tutorial https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/in... of web dynpro applications.pdf and create the required .xlf files. Test the applicatin in both languages by changing the browser's language priority. (But note that this has no effect for authenticated users). And in most cases, you need to close & open the project for the changes to take effect in the xlf files.
Now provide a dropdownbox or any selectable UI element for language slection, with key values as 'en_US' and 'th_TH'. Let the attribute bound to the dropdown be 'selected_language'. Now in the action handler for the 'onSelect' of the dropdown write this code :
final String locale = wdContext.currentContextElement().getLanguage_selection();
try
{
final String url = WDURLGenerator.getApplicationURL(
wdComponentAPI.getApplication().getDeployableObjectPart(),Collections.singletonMap("sap-locale", locale));
WDClientUser.forceLogoffClientUser(url);
}
catch (final WDURLException ex)
{
wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(ex), false);
}
After this, when you select "TH" from the dropdown, the application will be reloaded with that language.
Hope this helps,
Best Regards,
Nibu.
Hi Prakash,
This doesn't do the <b>translation of any data </b> at runtime. Instead we create and store the translated text at design time, and at run time, depending on the locale selected, the corresponding texts are retrieved and shown. So there is no scope for converting the data retrieved from R/3. What you can do is, modify your RFC so that it accepts the language as an input parameter and returns language specific values.
Best Regards,
Nibu.
Hi,
First approach
1. Set the all the translatable texts for each UI element in the view.
2. copy the automatically generated *.xlf files and
save them under a new name in the same directory. The
new name must meet the following convention:
<old name>_<language key>.xlf
3. open this file and then enter ur text. Based on the language setting in the browser particular language text will be displayed
Second approach
Using the java resource bundle. I havent try this.
Have a look at this link.
http://help.sap.com/saphelp_erp2004/helpdata/en/2d/e7381138a8d2458f1f4fac32614f71/content.htm
Thanks
Saravanan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.