on 06-19-2009 8:41 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the generated constants instead of string literals:
String msg = textAccessor.getText(IMessage<ComponentName>.CONSTANT_FOR_MESSAGE_KEY);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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?
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.