ResourceEditor Tool

Resource Editor SchemaProf supports internationalization and is delivered in the languages English, German, French and Dutch thanks to the support of our TELCERT project partners. To support the internationalization process, a small ResourceEditor tool has been developed.

First the user must open a reference file (that will be provided by the SchemaProf authors). The reference file will be used as a template for the user resource file, showing the resource key value and the resource value from the reference file in the left and centre columns of the program window.

Then an existing user resource file can be opened or a new one can be created. The values of the user resource file are displayed in the right column of the window. Only those values may be modified.

Before saving the new or modified user resource file, please make sure to check for the correct setting of the language abbreviation, the character encoding (UTF8 is strongly recommended) and whether to use the new file as default file. Then save the file.

Advanced Features

Updating a resource file:

For the common situation that a resource file must be updated for a new version of the software, the ResourceEditor provides the button 'Next free entry' that will place the input cursor into the next input field where no value is specified. This will usually be where a new value is introduced in the reference file and the user resource file must be updated.

Extracting a reference file from the SchemaProf JAR file:

To extract a reference language file that is contained in the latest SchemaProf release, download the JAR file into a directory and extract the files using the Java provided command line tool:

   jar xf SchemaProf-3.2.1.jar telcert/schemaprof/resources/lang/gui_en.xml
   jar xf SchemaProf-3.2.1.jar telcert/schemaprof/resources/lang/datamodel_en.xml

The gui_en.xml file contains the language values for the user interface; the files datamodel_en.xml and constraints_en.xml contain the values for the datamodel. Both files are in English ('en'). Those files can be used as reference files to edit or create further resource files. This is possible by manually editing the xml files or by using the Resource Editor (see the corresponding section above).

Integrating new languages into SchemaProf:

From version 4.x on, it is possible to define a directory which contains updated and/or additional resource files. This is done on the "Plugin and Proxy" tab of the properties dialog. The new languages and updated languages are immediately available. Eventually the properties dialog has to be closed with OK and reopened if additional languages were added. Older versions of SchemaProf (< 4.x) doesn't support dynamically adding updated resource files.

If you have updated or created resource files which should be shipped with SchemaProf or which should be made available over the SchemaProf homepage, you can send them to schemaprof@uni-koblenz.de and they will be made available for download on the SchemaProf homepage as well as they will be included in the next release of SchemaProf.

Resource File XML Format

The resource files are XML files with the root element <language>. All subelements are of the type <phrase> and contain two attributes: the resource key and the resource value. Example:

  <language name="en" isDefault="true">
    <phrase key="error.common.wrongbasemodel" value="An ''{0}''-element must have a SchemaProfile as its owner. Found ''{1}''."/>
    <phrase key="error.BaseElementImpl.wrongprofile" value="The parent of this element is owned by another profile."/>
    <phrase key="error.UseModificationImpl.optionalnodedefault" value="Couldn't set a default value. Change the use to OPTIONAL first!"/>
  </language> 

The root element attributes are

  • name defines the resource language abbreviation and should refer to the ISO language code.
  • isDefault is set to 'true' if the current language should be the default, or set to 'false' otherwise.

The phrase element attributes are:

  • key is the internal key used to find and identify the resource and should occur only once in a language resource file.
  • value is the actual string value to be display at the position of this key. Some key may contain parameters like file names or values generated from third party libraries. In that case {1} denotes the first parameter, {2} the second parameter and so on.

Further Information

The ResourceEditor and Schemaprof are based on the Java ResourceBundle class for the i18n internationalization. That means that this file format can easily be used for other software and the ResourceEditor can be used to edit the resource files.

Further information on the ResourceBundle class can be found on the Java web pages from Sun, like The Java Tutorial's section on Isolating Locale-Specific Data and the Java 2 API Specification's section on Class Resource Bundle.

Download

The Resource Editor is available in the tools subsection of the SchemaProf download area.

It may be used free of any charge and is provided as open source.