This topic explains how to localize the field labels for any GUI fields that are defined in a Parasoft extension.

You can externalize any field label for a custom extension displayed in the GUI to support different languages. This is done by providing property files for each language that needs to be supported. Based on the language of the user, the Java Runtime will search for the corresponding resource bundle using language identifiers. If a certain language identifier is not provided, the Java runtime will fall back to the next general resource bundle.

For example:

  • parasoft-extension.properties: default language file if nothing else is available
  • parasoft-extension_de.properties: used for German
  • parasoft-extension_en.properties: used for English
  • parasoft-extension_ja.properties: used for Japanese

Strings in the parasoft-extension.xml are externalized to these Property files using %key notation. For example, the form section of an XML file might look like this:

<form xmlns="urn:com/parasoft/extensibility-framework/gui">
	<section label="%section">
		<field id="key 1" label="%labelOne"/>
		<field id="key 2" label="%labelTwo"/>
	</section>
</form>

And the parasoft-extension_en.properites might look like this:

section=section name
labelOne=label one name
labelTwo=label two name

Properties files are encoded in ISO 8859-1 character encoding. Characters that cannot be directly represented in this encoding can be written using Unicode escapes as defined in section 3.3 of The Java Language Specification; only a single 'u' character is allowed in an escape sequence.

  • No labels