Saturday, October 5, 2013

Easier collaboration to internationalize UDIG

Easier collaboration to internationalize UDIG

During the FOSS4G conference Andrea Antonello and myself we'd the chance to improve Internationalization workflows for users and developers. It was a goal to migrate all User Interface (UI) labels and messages to Transifex translation platform.

Background

In UDIG several UI labels, dialog titles, and messages are externalized from the core Java code and are stored in properties (*.properties) files. Each file has keys on the left to access messages. The message text is separated from the key by an equal sign, e.g.:

OpenFileDialog.dialogTitle = Open File Dialog

In the origin file, which is named messages.properties the messages for all UI elements are stored in English. To translate UI elements its only required to have a new message properties files for a specific language, e.g. messages_de.properties for German translations. For more details about Java internals have a look at the Java properties files tutorial.

About Transifex

Transifex provides a platform for translation teams to add, modify, and review text strings. Its possible to set up resources in a way that changes in a public accessible Source Code Repository can be pulled. In addition to this translated properties files can be synchronized back into a working copy with a Python based client tool. A client executable for Windows environments is also available (Python isn't required). However, if you don't want to install a tool you can use Transifex' REST API to achieve the same results.

A neat feature is the translation memory for each project. Translators can add words or phrases and can comment the translations. The web front-end looks like this, where you can see suggestions from already translated strings and underlined words already defined in translation memory.

Current State

Transifex project

After half an hour sed coding with Andrea a project has been created and configured at Transifex for all UI elements of the current code base. We identified two different type of properties files, plugin.properties and messages.properties. For all bundles we found 110 resources and pushed these and its already available translations:

To join a Translation Team you have to create a Transifex account or use your Social Account such as Twitter, Facebook, Google+ or even LinkedIn. Go to the main page and choose LOG IN top right.

Origin Resources will be synchronized in a daily manner from our Github repository to keep up-to-date with added, changed or even deleted text strings for UI elements.

Transifex client tool configuration

The client tool needs a configuration on client side. Its a simple text file which should be stored in a .tx folder of your working copy. Its name is config and contains configurations for each resource - where to find it in the workspace and how the resource is accessible from Transifex (project slug and resource slug).