views:

1055

answers:

2

How do I externalize strings in my Eclipse plugin's plugin.xml?

Right-clicking on the plugin project > PDE Tools > Externalize Strings does not show up my plugin.

I'm trying to do this manually now. I added entries in plugin.properties and replaced the equivalent string in plugin.xml with a % sign followed by the string key. But that does not seem to work. What am I missing here?

+2  A: 
VonC
For some reason, the Externalize String wizard shows up other plugins but not the required plugin. I did manage to fix the problem though. I've added it as a new answer here.
Nocturne
+1 For a complete solution that I didn't know that existed. I normally internationalized all these strings by hand.
Mario Ortegón
+5  A: 

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 %).

Nocturne
Thank you for this feedback. +1. I have added some links related to that "Bundle-Localization" issue in my answer below.
VonC