Using Excel Tables to Facilitate Translation

As described in the previous chapters, internationalization can be done by editing or adding resource bundles. To make this process easier, you can use a tool for converting resource bundles into Excel spreadsheets. We provide a set of scripts that use the open-source excelbundle, released under the Apache License 2.0. The script adapts to the structure of Infinity Process Platform portal and modeler resource bundles and locations. You can download it here:

i18n-bundles.zip

The zip contains the scripts to create Excel Sheets and export the changed and added keys back to the bundles in the according plugins.

Setting up your Project

  1. Unzip i18n-bundles.zip to a location of your choice, e. g. to C:/i18n.
  2. Download the excelbundle.jar from an appropriate site, e.g. from http://mvnrepository.com/artifact/net.java.excelbundle/excelbundle and add it to the i18n-bundles/lib folder. Refer to the Excelbundle - Java.net project site for details on this project.
  3. Add the following libraries to the lib folder:
  4. Edit file i18n.properties and adjust the settings: Leave the other settings as provided.
    For example:
    # --- RUNTIME I18N ---
    
    # IPP version to translate
    ipp.jar.version=7.3.2-RC1-SNAPSHOT
    # xls file name for runtime i18n
    portal-xls-file=portal-messages.xls
    # temp folder for runtime resource bundles processing 
    bundles.dir=bundles
    
    # --- ECLIPSE MODELER I18N ---
    #Excat IPP build version (check file names in eclipse plugins folder)
    ipp.build-version=7.3.2.2-r71747
    # eclipse installation path 
    eclipse.home=C:/development/builds/IPP732
    # plugin installation path, typically: {eclipse.home}\\plugins
    plugin.home=C:/development/builds/IPP732/eclipse/plugins
    #XLS file name for eclipse modeler i18n
    eclipse-xls-file=eclipse-messages.xls
    # temp folder for eclipse plugin resource bundle processing 
    plugin.dir=plugins
    
    # --- GENERAL ---
    # -- Are you sure you need to change these?
    # locales to export from XLS
    export.locales=ja,zh_CN,zh_TW,de
    # locales to import into XLS
    import.locales=en,ja,zh_CN,zh_TW,de
    # Reference locale to use. This locale is used to identify which entries should exist.
    reflocale=en
    # folder for XLS files
    xls.dir=xls
    # folder for classpath libraries
    lib.dir=lib
    # folder for backups
    backup.dir=./backup

Backing up the original resources

Start backup.bat to create a backup of the original eclipse fragments. The original plugins are stored under folder backup. To later restore the original resources in your Infinity Process Platform build, call restore.bat, which will reintegrate the resources from the backup folder.

Creating Excel Sheets

To generate a new Excel sheet for translation based on the configured Eclipse installation and Infinity Process Platform version, use xls.bat. The Excel files will be created in the sub-folder xls, named modeler-messages.xls and portal-messages.xls respectively. In case these files exist already, the operation will automatically create backup copies of the pre-existing files. Per default, the batch file calls the targets update-xls and update-portal-xls, whereby:

set ANT_HOME=%CD%
call .\bin\ant.bat update-portal-xls
call .\bin\ant.bat plugins-to-xls
pause

In case you like to only translate modeler keys or Portal keys respectively, simply comment out the accordant other ant call.

Translating and Adding Keys

Edit the created eclipse-messages.xls and portal-messages.xls files. In the column containing the language you like to translate or edit, enter or change the according keys. If the language bundle already exists in your Infinity Process Platform build, the existing keys are merged and visible in the Excel sheet.


Figure: Example Excel Sheet with Translation

In case you added a locale for a new language, which does not have resource bundles yet, an empty column for this language bundle is created in the Excel sheet.


Figure: Example Excel Sheet with column for new language.

Fill in the translated keys accordingly.

Merging back the new Properties

Once you have completed editing, export the updates back into the resource bundles in the plugins of your Infinity Process Platform installation.

  1. Run EclipseImport.bat to copy the updated fragments and jars to your Infinity Process Platform Eclipse installation.
  2. To view the updates: