Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Adding additional subtitle

...

XMLUI specific localization

Message catalog

XMLUI supports multiple languages through the use of internationalization catalogues as defined by the Cocoon Internationalization Transformer. Each catalog contains the translation of all user-displayed strings into a particular language or variant. Each catalog is a single xml file whose name is based upon the language it is designated for, thus:

...

JSPUI specific localization

Message catalog

The Java Standard Tag Library v1.0 is used to specify messages in the JSPs like this:

Code Block
<H1><fmt:message key="jsp.search.results.title"/></H1>

This message can be changed using the config/language-packs/Messages.properties file. This must be done at build-time: Messages.properties is placed in the dspace.war Web application file.

Code Block
jsp.search.results.title = Search Results

Phrases may have parameters to be passed in, to make the job of translating easier, reduce the number of 'keys' and to allow translators to make the translated text flow more appropriately for the target language. Here is an example of a phrase in which two parameters are passed in:

Code Block
jsp.search.results.text = Results {0}-{1} of {2} 

Multiple Messages.properties can be created for different languages. See ResourceBundle.getBundle. e.g. you can add German and Canadian French translations:

Code Block
Messages_de.properties
Messages_fr_CA.properties

The end user's browser settings determine which language is used by default. The user can change the language by clicking a link in the UI. These links are visible if more than one language is configured in DSpace. The English language file Messages.properties (or the default server locale) will be used as a fallback if there's no language bundle for the end user's preferred language. Note that the English file is not called Messages_en.properties. This is because it is always available as a fallback, regardless of server configuration.

Localization of input-forms.xml and license.default

The display labels for input-forms.xml and the text in the default submission license (license.default) are currently not managed in the messages catalogs. To localize these files, you can create versions of these files in the same folders, appending _COUNTRY at the end of the filename, before the extension. For example, input-forms_de.xml can be used to translate the submission form labels in German.

Latest language files

The JSPUI language files are updated and released separately from the DSpace core project. Visit the dspace-api-lang project on Github.