It's all about the answers!

Ask a question

internationalization clients plugins, generate properties


Paulino Alonso (381215) | asked Jun 09 '11, 11:20 a.m.
Hello,

I'm working on the internationalization of plugins, which is to monitor the error messages in different languages depending on the language that you start the eclipse.
I use RTC 3.0.
For the server plugins I have no problem. Briefly detail as I do:

I have implemented a class that used by other advisors Messages.java, where I pass the properties of messages
private static final String BUNDLE_NAME = "com.ibm.team.server.process.messages";

Into the advisor, when I generate a message add the following lines:
IAdvisorInfo info= collector.createProblemInfo(getSummary(d.getName()), getDescription(state,d.getName()), ID);
info.setProblemObject(workItem.getItemHandle());
collector.addInfo(info);

These lines are what generated the error and also call getSummary and getDescription methods, I have implemented as follows
private String getSummary(String descriptor) {
return NLS.bind(Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_SUMMARY"),descriptor);
}
private String getDescription(String descriptor, String state) {
return NLS.bind(Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_DESCRIPTION"),state,descriptor);
}
in line:
Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_DESCRIPTION"),state,descriptor);
we can pass the strings you want separated by commas, in this case appears state and descriptor.
These String are then identified in the message as if they were command line parameters
RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_SUMMARY=Para pasar al estado ''{0}'' es necesario validar la aprobacin tipo ''{1}''.

Now my problem is to make the internationalization clients plugins , and are not in the same way ...because it needs to import different packages ...
Somebody has worked or know this?any reference or example?
Would appreciate your help ...

Thank you very much

Paulino

2 answers



permanent link
Paulino Alonso (381215) | answered Jun 14 '11, 6:19 a.m.
I did not know that option ...

thanks for your answer

permanent link
Jared Burns (4.5k29) | answered Jun 10 '11, 2:55 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hello,

I'm working on the internationalization of plugins, which is to monitor the error messages in different languages depending on the language that you start the eclipse.
I use RTC 3.0.
For the server plugins I have no problem. Briefly detail as I do:

I have implemented a class that used by other advisors Messages.java, where I pass the properties of messages
private static final String BUNDLE_NAME = "com.ibm.team.server.process.messages";

Into the advisor, when I generate a message add the following lines:
IAdvisorInfo info= collector.createProblemInfo(getSummary(d.getName()), getDescription(state,d.getName()), ID);
info.setProblemObject(workItem.getItemHandle());
collector.addInfo(info);

These lines are what generated the error and also call getSummary and getDescription methods, I have implemented as follows
private String getSummary(String descriptor) {
return NLS.bind(Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_SUMMARY"),descriptor);
}
private String getDescription(String descriptor, String state) {
return NLS.bind(Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_DESCRIPTION"),state,descriptor);
}
in line:
Messages.getString("RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_DESCRIPTION"),state,descriptor);
we can pass the strings you want separated by commas, in this case appears state and descriptor.
These String are then identified in the message as if they were command line parameters
RequiredApprovalsAdvisor.ATTRIBUTE_NOT_SET_SUMMARY=Para pasar al estado ''{0}'' es necesario validar la aprobacin tipo ''{1}''.

Now my problem is to make the internationalization clients plugins , and are not in the same way ...because it needs to import different packages ...
Somebody has worked or know this?any reference or example?
Would appreciate your help ...

Thank you very much

Paulino


In the RTC client, we just use the normal Eclipse string externalization method. If you're using Eclipse to write your Java code, you can find a menu option under the Source menu to externalize strings which does all the work for you.

One tip for your server-side messages - If you want the messages coming from the server to be translated into the client's locale (which is the normal case), you should use com.ibm.team.repository.service.ClientMessages.

- Jared

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.