我們可以透過在 plugin.xml 檔案中以一個索引鍵(例如 %pluginName)取代字串,並且以下列格式在 plugin.properties 檔案中建立一個項目來外部化字串:
pluginName = "Online Help Sample Plugin"
使用類似方法來外部化提供的 XML 檔。 執行外部化
<topic id="plainTasks" label="Plain Stuff">
我們以索引鍵 %plainStuff 取代它的標籤。 我們的 topic 現在如下:
<topic id="plainTasks" label="%plainStuff">
我們在 doc.properties 檔建立一個項目:
plainStuff = Plain Stuff
查閱由線上說明構成要素外部化的字串時,此說明系統會使用 document.properties。