Localizing XML Refactoring Operations
Oxygen XML Editor includes localization support for the XML refactoring operations.
The translation keys for the built-in refactoring operations are located in [OXYGEN_INSTALL_DIR]/refactoring/i18n/translation.xml.
The localization support is also
available for custom refactoring operations. The following information can be translated:
- The operation
name
,description
, andcategory
. - The
<description>
of the<parameters>
element. - The
label
,description
, andpossibleValues
for eachparameter
.
Translated refactoring information
uses the following
form:
${i18n(translation_key)}
Oxygen XML Editor scans the
following locations to find the translation.xml files that are used to
load the translation keys:
- A refactoring/i18n folder, created inside a directory that is associated to a customized framework.
- A i18n folder, created inside a directory that is associated to a customized framework.
- An i18n folder inside any specified folder. In this case, you need to open the Preferences dialog box , go to , and specify the folder in the Load additional refactoring operations from text box.
- An i18n folder located in directories specified through the XML Refactoring Operations Plugin Extension.
- The refactoring/i18n folder from the Oxygen XML Editor installation directory ([OXYGEN_INSTALL_DIR]/refactoring/i18n).
Example: Refactoring
Operation Descriptor File with i18n
Support
<?xml version="1.0" encoding="UTF-8"?>
<refactoringOperationDescriptor
xmlns="http://www.oxygenxml.com/ns/xmlRefactoring" id="remove_text_content"
name="${i18n(Remove_text_content)}">
<description>${i18n(Remove_text_content_description)}</description>
<script type="XQUERY_UPDATE" href="remove_text_content.xq"/>
<parameters>
<description>${i18n(parameters_description)}</description>
<parameter label="${i18n(Element_name)}" name="element_localName"
type="NC_NAME">
<description>${i18n(Element_name_descriptor)}</description>
<possibleValues>
<value default="true" name="value1">${i18n(value_1)}</value>
<value name="value2">${i18n(value_2)}</value>
</possibleValues>
</parameter>
</parameters>
</refactoringOperationDescriptor>