Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

internationalization clients plugins, generate properties

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

0 votes



2 answers

Permanent link
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

0 votes


Permanent link
I did not know that option ...

thanks for your answer

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,953

Question asked: Jun 09 '11, 11:20 a.m.

Question was seen: 5,293 times

Last updated: Jun 09 '11, 11:20 a.m.

Confirmation Cancel Confirm