Child pages
  • Alternate Translation Tools
Skip to end of metadata
Go to start of metadata

WARNING: This page describes alternatives to the recommended tools and processes in How To Translate Sakai for historical purposes (in other words, use at your own risk)

MS Excel and unix scripts:

  1. Ingest properties files into Microsoft Excel Spreadsheets (remove the '=' character separating keywords from text, and ingest as type 'text' not 'general').
  2. Translate the english text in the second column (replacing or removing the original english text column). The spreadsheet should now have two columns: the first is the original keyword, the second is the translated text
  3. Export XLS (Microsoft Excel) into Unicode UTF-16 representation.
  4. Run the utf16_to_utf8_properties script to convert UTF-16 into an ascii-encodedrepresentation of UTF-8.
    This script and its dependent classes are available at https://source.sakaiproject.org/contrib/tools/i18n/.

Other tools:

  1. Eclipse ResourceBundle Editor Plugin
    http://resourcebundleeditor.com/ess/rbe/home.do
  2. Properties Editor (stand-alone tool, Eclipse plugin, or JBuildier plugin)
    http://propedit.sourceforge.jp/index_en.html

The text-based Resource Bundles can be found in the sakai source. The next release will be Sakai 2.2, which will have a re-structured project tree (relative to previous releases).

Identifying Changes and Updating Translations

There are two unix-based scripts for keeping translated bundles up-to-date:

  • prop_update is a one step process, resulting with a properties file mixed with english and translations, needing to be updated
  • translateSakaiFirstStep and translateSakaiSecondStep is a two step process, resulting with an intermediary file to translate and provide as input to the second script

These scripts are intended for translators who may have done a previous translation (e.g. Sakai 2.0) and now wish to update that translation to the current release (e.g. Sakai 2.1.2). If the translator does not know when the previous translation was done, looking at the SVN tags should reveal this.

prop_update.pl

This perl script is available at: https://source.sakaiproject.org/contrib/tools/i18n/prop_update.pl

It takes four command-line parameters, as follows:

$ prop_update

prop_update prop_en_old prop_en_new prop_i18n_old prop_i18n_new

inputs:

  • prop_en_old original english property file
  • prop_en_new updated english property file
  • prop_i18n_old original translated property file

output:

  • prop_i18n_new translated property file with changes

Examples

The following example uses the prop_update script to update the calendar_nl.properties file from Sakai 2.1.0 to the current trunk version.

$ prop_update $SAKAI_2_1_0/calendar.properties $SAKAI_TRUNK/calendar.properties $SAKAI_2_1_0/calendar_nl.properties $SAKAI_TRUNK/calendar_nl.properties

Here's an editted selection of the differences between the original and new calendar_nl.properties bundle:

$ diff $SAKAI_2_1_0/calendar_nl.properties $SAKAI_TRUNK/calendar_nl.properties

Example 1: the keyword remains, but the english text is different:

< java.theend = De eindatum is eerder dan de begindatum. Verander dit.
> java.theend = The end date you have specified on the Frequency page is earlier than the start date. Change it please.

Example 2: a new keyword/value pair has been added:

> java.alert.ifyes = ? If yes, click 'Save Field Changes' to continue.

Example 3: If a keyword pair has been removed from the english text, it will also be removed from the translated bundle

Comments/thanks/rants should be directed to: beth.kirschner at umich.edu

translateSakaiFirstStep.pl & translateSakaiSecondStep.pl

These perl secripts are available at:

https://source.sakaiproject.org/contrib/tools/i18n/translateSakaiFirstStep.pl
https://source.sakaiproject.org/contrib/tools/i18n/translateSakaiSecondStep.pl

The first Step takes

  • a directory containing and old version of sakai
  • a directory containing a new version
  • a directory to create result files

The output consists on one file for each updated file, containing only updated properties.

This files must be translated.
Once translated, second step takes:

  • the directory containing updated&translated files
  • the locale string to use (ca,es,nl)
  • the prefix to create merged files (NEW, ...)
  • the directory containing old sakai and where result files are created

The output consists on new files created merging old files with the updates.

Examples

./translateSakaiFirstStep
/tmp/sakai-2.0.1-production/sakai-src/legacy/bundle/src/bundle/
/tmp/sakai-trunk/legacy/bundle/src/bundle/
/tmp/testTranslate/

Then translate all the files in testTranslate and

./translateSakaiSecondStep
/tmp/testTranslate/
ca
NEW
/tmp/sakai-2.0.1-production/sakai-src/legacy/bundle/src/bundle/

Generates NEW_foo_ca.properties on
/tmp/sakai-2.0.1-production/sakai-src/legacy/bundle/src/bundle/

Comments/thanks/rants should be directed to: david at asic.udl.es

  • No labels