HomeDownloadsUser GuideDevelopment

Architecture: I18N

Internationalization

This document gives an overview of I18N in the context of this project.

Core

The core itself is kept language neutral. Except for debug log messages all output intended for users of the core is provided in form of parametrized objects or exceptions. It is up to the user of the core to provide appropriate I18N if required.

Editor

The editor relies on the Swing Application Framework to provide the translation to the current locale of the user that has started the editor.

The translation files itself are stored as resource bundle property files (see Backing a ResourceBundle with Properties Files ).

The resource bundle property files are stored in the resource folder of the editor:

/editor/src/main/resources/**/*.properties

The main application resource bundle that contains the menu and toolbar resources as well as generic translations is stored as:

/editor/src/main/resources/org/openpermis/editor/policy/Application.properties

For each editor view there are separate property files that contain the translations for the various user interface elements of the corresponding view.

/editor/src/main/resources/org/openpermis/editor/policy/view/resource/*.properties

Example

To add a german translation for the main application resource bundle simply copy the Application.properties file and store the copy as Application_de.properties:

$ cd editor/src/main/resources/org/openpermis/editor/policy
$ cp Application.properties Application_de.properties
$ vi Application_de.properties

Then open the newly created Application_de.properties and replace all I18N specific entries with a german translation.

Note:

Only include the resource keys that require a translation in the language specific property file. The language neutral resources will be picked up from the default property file.