外部化插件插件plugin.xml中的字符串 [英] Externalizing strings in plugin.xml for Eclipse plugin

查看:116
本文介绍了外部化插件插件plugin.xml中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



右键单击插件项目> PDE工具> Externalize Strings不显示我的插件。



我现在手动要这样做。我在plugin.properties中添加了条目,并用一个%符号替换了plugin.xml中的等效字符串,后跟字符串键。但这似乎不起作用我在这里缺少什么?

解决方案

我终于想出了如何手动外部化插件。



Eclipse,事实证明,通过这种方式外部化plugin.xml:




  • 在插件清单META-INF / MANIFEST.MF),添加以下行

     捆绑本地化:插件


  • 在plugin.properties中添加外部化的字符串键值对。


  • 使用plugin.properties(前缀为%)的键插入plugin.xml中的字符串。



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?

解决方案

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

这篇关于外部化插件插件plugin.xml中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆