Externalizing strings in plugin.xml for Eclipse plugin

前端 未结 2 582
萌比男神i
萌比男神i 2020-12-30 09:38

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.

2条回答
  •  长情又很酷
    2020-12-30 09:56

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

提交回复
热议问题