在 Eclipse 插件的 plugin.xml 中外部化字符串

2023-08-21Java开发问题
2

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

问题描述

如何在我的 Eclipse 插件的 plugin.xml 中外部化字符串?

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

右键单击插件项目 > PDE 工具 > 外部化字符串不会显示我的插件.

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

我现在正在尝试手动执行此操作.我在 plugin.properties 中添加了条目,并将 plugin.xml 中的等效字符串替换为 % 符号,后跟字符串键.但这似乎不起作用.我在这里错过了什么?

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 以这种方式将 plugin.xml 外部化:

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

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

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

Bundle-Localization: plugin

您打算将外部化字符串存储在名为plugin.properties"的文件中(原来这是缺少的部分).

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

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

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

将 plugin.xml 中的实际字符串替换为 plugin.properties 中的键(以 % 为前缀).

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

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

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

Eclipse 在尝试启动 Android 应用程序时卡住了
Eclipse gets stuck when trying to launch Android app(Eclipse 在尝试启动 Android 应用程序时卡住了)...
2024-08-25 Java开发问题
14

Java 代表?
Java Delegates?(Java 代表?)...
2024-08-25 Java开发问题
15

Eclipse:无法初始化监视器线程:无法建立环回连接
Eclipse: Failed to initialize Monitor Thread: Unable to establish loopback connection(Eclipse:无法初始化监视器线程:无法建立环回连接)...
2024-08-25 Java开发问题
4

Eclipse-找不到JDK
Eclipse- JDK not found(Eclipse-找不到JDK)...
2024-08-25 Java开发问题
6