cancel
Showing results for 
Search instead for 
Did you mean: 

Internationalization is not working

Former Member
0 Kudos

Hi All

I have a web dynpro java application for which internationalization concept is implememted to support English and Canadian French languages.

All messages and texts are stored in message pool of the component.

xlf files are placed with proper naming convention AcceptanceCompMessagePool.wdmessagepool_fr_CA.xlf.

Source language in Header tab has also been changed to Canadian French.

Code written is as below:

IWDTextAccessor textAccessor;

textAccessor = wdComponentAPI.getTextAccessor();

String text_Acceptance = textAccessor.getText("Acceptance");

wdContext.currentContextElement().setDesc(text_Acceptance);

Expected output is -> Your profile has been accepted.

Actual output is -> message.Acceptance.

Situation does not improve even if we change the user language to English.

Does anyone have any idea on how to correct the problem?

Regards

Vineet Vikram

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi vineet vikram,

please reload and rebuild your application this solves normally this problem.

A other problem could be change the ending of the xlf file only to ....._fr.xlf. Try this also.

Regards

Gunter

Edited by: Gunter Werner on Jun 19, 2009 9:51 AM

Former Member
0 Kudos

Hello

Thanks for your response.

I tried both the options as suggested by you but it is still not working.

Any other idea?

Regards

Vineet Vikram

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

do you really have written a Message in the Message Pool.

If not please do this. The message key you must call with the textAccessor.

Regards Gunter

Former Member
0 Kudos

Use the generated constants instead of string literals:


String msg = textAccessor.getText(IMessage<ComponentName>.CONSTANT_FOR_MESSAGE_KEY);

Armin

Former Member
0 Kudos

Dear Armin

I tried the code suggested by you.

String text_Acceptance = textAccessor.getText(IMessageAcceptanceComp.Acceptance);

But I am getting an error with this code. I do not get my message key "Acceptance" after "IMessageAcceptanceComp." Infact, among the options available I am getting only 5 of my message keys whereas there are around 25 messages in the message pool.

Could you please suggest what is wrong with my code and what shall I do?

Regards

Vineet Vikram

Former Member
0 Kudos

Are there any pending errors in your project? Maybe the code generation has not yet created the constants.

Armin

Former Member
0 Kudos

Dear Armin

There are no pending errors in the code. I have successfully built and deployed it several times.

I have noticed that all the messages in the message pool are of type text.

If I change the message type to standard, then the I get the declared messages after "IMessageAcceptanceComp."

Code also works fine after that i.e. I get the desired output.

Could you please help me in understanding the reason behind this?

What difference does it make if I declare the messages with message type as text or as standard?

Former Member
0 Kudos

Hi

If I use the code as below I even need not to change the message type.

 String msg = wdComponentAPI.getTextAccessor().getText("KEY1"));

Regards

Vineet Vikram