Mathieu,
In this specific case, the text for the resulting action is obtained from
the Workbench's message catalog.
The code for ActionFactory.UNDO does: WorkbenchMessages.getString(
"Workbench.undo"), which looks up the string in the messages.properties
file in package org.eclipse.ui.internal in the Workbench plugin
(org.eclipse.ui.workbench).
As Tod describes, string translations are shipped as separate fragments
corresponding to the plugins containing the externalized string. This
string in particular would be found in the NL fragments for the Workbench,
not your plug-in. NL fragments for Eclipse 2.1.2 at the bottom of the
downloads page. The 3.0 translations will not be done until we approach
the end of 3.0.
If you want, you can provide your own text for the retargetable actions,
and therefore your own translations using:
IAction undoAction = ActionFactory.UNDO.create(window);
undoAction.setText(Messages.getString("Undo"));
menu.add(undoAction);
For more on internalization, see the following articles available off of
the Articles page:
"How to Internationalize your Eclipse Plug-In":
http://eclipse.org/articles/Article-Internationalization/how2I18n.html
"How to Test Your Internationalized Eclipse Plug-In"
http://eclipse.org/articles/Article-TVT/how2TestI18n.html
Regards,
Nick
Tod Creasey/Ottawa/IBM@IBMCA
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/23/2004 08:01 AM
Please respond to
platform-ui-dev
To
platform-ui-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-ui-dev] Internationalize global actions?
Mathieu
This is a forum for news on the development of the Eclipse UI rather than
a support group - you post these ypes of questions to the Eclipse
newsgroup.
The way you do this is by creating fragments for each plug-in you have
translated for with the extension.nl and then create message files for
each language in the jar for the frgament. See the Eclipse downloads for
an example.
Tod
Mathieu Fougeray <mathieu.fougeray@xxxxxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/23/2004 06:02 AM
Please respond to platform-ui-dev
To: platform-ui-dev@xxxxxxxxxxx
cc:
Subject: [platform-ui-dev] Internationalize global actions?
Hi all,
I developped some plugin with edition global actions, CUT, COPY, etc.
I create them in a WorkbenchAdvisor, this way :
MenuManager menu = new MenuManager(Messages.getString("Edit"),
//$NON-NLS-1$
IWorkbenchActionConstants.M_EDIT);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
menu.add(ActionFactory.UNDO.create(window));
The fact is I would like to have all these actions internationalized, so
if anybody could help me on how to do it... is there a way to make it from
my plugin.xml via <extension> ? Or via a property file?
Thanks for help!
Mathieu Fougeray.
_______________________________________________ platform-ui-dev mailing
list platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev