cancel
Showing results for 
Search instead for 
Did you mean: 

webdynpro Internationalization i18

Former Member
0 Kudos

If my application have multiple views

how do i call the ResourceBundle to convert the language

how do i set the label, textview in the properties file


Locale currentLocale;
ResourceBundle messages;
currentLocale=new Locale("en","US","");

messages=ResourceBundle.getBundle("MessageBundle",currentLocale);

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

U have to load the resource bundle like this only,

IWDResourceHandler rq = WDResourceHandler.createResourceHandlerForCurrentSession();

IWDResourceHandler ra = WDResourceHandler.createResourceHandlerForCurrentSession();

rq.loadResourceBundle("welcome.resource.question",this.getClass().getClassLoader());

ra.loadResourceBundle("welcome.resource.answer",this.getClass().getClassLoader());

Sample applications,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20jav...

Former Member
0 Kudos

if follow the tutorial in sap Internationalization Web Dynpro Application

it talks about modifying the xlf and changing the application properties of DefaultLocale,

after we set the DefaultLocale in webdynpro it will follow for eg EN, DE

how do we switch between this by click a button or menu inside the webdynpro

pls advice

Message was edited by:

yzme yzme

Former Member
0 Kudos

Hi,

See the below link,if u do the below application u can get clear idea.....

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4a417a90-0201-0010-f499-8d41fc78...

Former Member
0 Kudos

what i want is really simple which is implemented on many of the application

when i click a button, i will switch my language AT RUNTIME

Can i able to do this ?

ENGLISH and Chinese

default locale

[ENGLISH] ---> [Chinese]

former_member751941
Active Contributor
0 Kudos

Hi yzme,

Try this to set Default Locale for "CHINESE"

Locale newLocale=new Locale("ZN","CHINESE");

Locale.setDefault(newLocale);

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Locale.html

http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html

Regards,

Mithu

Former Member
0 Kudos

i have problem...with internationalization,

if i convert it in germany DE ...NO PROBLEM

BUT IF I CONVERT TO CHINESE ...ZH ..the conversion doesn't occur

Former Member
0 Kudos

now, i already successfully convert to chinese character....

but problem come again...

my requirement is to choose a button to switch the between english and chinese

what should i put in my coding that will reflect the changes ...

how do i set the application level locale so as to reflect the language selected

public void onActionChooseLanguage(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent ){

Locale newLocale=new Locale("en","US");

Locale.setDefault(newLocale);

wdThis.wdFirePlugRefreshOutBound();

//@@end

}

former_member751941
Active Contributor
0 Kudos

Hi,

Take Two Buttons("English" and "CHINESE") and Create Two actions("InEnglish" and "InChinese") and associate the actions with the Buttons .

Then use the code

public void onActionInEnglish(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionInEnglish(ServerEvent)

Locale newLocale=new Locale("en","US");

Locale.setDefault(newLocale);

wdThis.wdFirePlugRefreshOutBound();

//@@end

}

public void onActionInChinese(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionInChinese(ServerEvent)

Locale newLocale=new Locale("ZH","CHINESE");

Locale.setDefault(newLocale);

wdThis.wdFirePlugRefreshOutBound();

//@@end

}

Regards,

Mithu

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

i understand my problem clearer now,

if i go to ume and change my setting to DE -German and set my xlf file to de_xlf

when i logged in it reflected perfectly,

but when i change my setting to zh - Chinese and set my xlf to zh-CN_xlf,

i have no way to get chinese character , but english.

i go to the index.html ume, the language for choose the Chinese(China) is disabled

and when i login to R3 SU01 modify the user , the user selection doesn't have Chinese zh-CN but Chinese zh

what should i do

Former Member
0 Kudos

Hi,

Check the Blog below

/people/prashant.patalay/blog/2006/12/20/internationalization--i18n-of-webdynpro-java-application

regards

Anil

Former Member
0 Kudos