Externalizing strings in plugin.xml for Eclipse plugin

If your working set have plugin projects in it, the Externalize Strings wizard to help externalize strings in your Manifest and plugin.xml files should be available.
Externalizing manifest files extracts translatable strings and stores them in a properties file for multi-language support.

The wizard is available under the PDE Tools menu in the context menu of a PDE project's MANIFEST.MF or plugin.xml files.

alt text
(source: eclipse.org)

Be aware that there were some bugs related to detecting all non-externalized attributes/values of the <extension-point> and <extension> elements, or showing up un-externalized names of extension(-point), which are only solved in 3.4 or very recent 3.5M4.

However, if the "Externalize Strings" menu does not show up at all on your plugin projects, may be its "project nature" is corrupted somehow, may be your former Java project is not properly converted to a PDE project ?

So two suggestions:

  • try with a fresh install of an eclipse3.5M4
  • import your plugin project and check its nature

And then tell us if that menu is still unavailable.


As you mention in your own answer, the externalization process is declared by the string

Bundle-Localization: plugin

in the MANIFEST.MF file, as mentioned in this message.

A bug has been created, but:

  • The localization is not something specific to PDE but instead the OSGI specification
  • that line is not always in the MANIFEST:

    Prior to 3.3, we created all our manifests by creating a plugin.xml and then converting it. The converter always added "Bundle-Localization: plugin" to the Manifest, since that is the default location if the plug-in has no Manifest.
    If a plug-in had no translations files, this header was unnecessary bloat.
    In 3.3, we created plug-in projects by creating Manifest directly, which means we decided to create only the headers necessary for project creation.

  • it is likely to be an issue for those that have created bundles with externalization < 3.2, and then not being able to see them when running in 3.3.


I finally figured out how to manually externalize the plugin.

Eclipse, it turns out, externalizes plugin.xml this way:

  • In the plugin manifest (META-INF/MANIFEST.MF), add the following line

    Bundle-Localization: plugin
    

    where you intend to store the externalized strings in a file called "plugin.properties" (Turns out this was the missing piece).

  • Add the externalized string key-value pairs in plugin.properties.

  • Replace the actual strings in plugin.xml with the keys from plugin.properties (prefixed with %).