Localisation

From wiki.gpii
Jump to: navigation, search

Resource Blender Extension (RBX) is a web-based localisation and internalisation tool available at webdemo.singularlogic.eu/RBX/.

If you need an account, please contact Thanos Karantjias (SiLO).

Key features:

  • Export resources to .NET .resx files, Java .properties, GNU .po / gettext, XHTML entities and more
  • Import / export translation data as XML spreadsheets to make editing more convenient
  • Use of a translations database to keep localisations in-sync (i.e. translation memory)
    • Select auto translation to get a list of translations that have been used for this term in other applications.
  • Use "Bundles" to group translation for different sub-components of your application.
  • Migrate from existing .resx or .properties files with an import wizard


Projects that use JSON for localisation files can also benefit from RBX. If the localisation files can be expressed as .properties files, they can be imported into RBX, and after translation they can be exported again as Java .properties files. Then you can use Nicholas Zakas' props2js script to convert the properties files into JSON, JSONP (JSON with padding) or plain JavaScript (in which the JSON content is assigned to a variable).


Ant users can also create Ant targets to automate the conversion from Java properties to JSON etc, like the following tasks which are adapted from the smart house build script.

<target name="buildTranslationJSON" description="Convert localisation data (a Java properties file) into JSON.">
  <apply executable="java" failonerror="true" parallel="true">
    <fileset dir="${src.dir.translations}" />
    <arg line="-jar" />
    <arg path="${props2js}" /><!-- path to the JAR file -->
    <arg line="--to json" /><!-- output format (json, jsonp or js) -->
    <arg line="--output ${l10n.json}" /><!-- output file, defined in the file build.properties -->
    <arg line="${l10n.properties}" /><!-- input file, defined in the file build.properties -->
  </apply>
</target>

<target name="buildTranslationJSONP" description="Convert localisation data (a Java properties file) into JSONP (JSON with padding).">
  <apply executable="java" failonerror="true" parallel="true">
    <fileset dir="${src.dir.javascript}" />
    <arg line="-jar" />
    <arg path="${props2js}" />
    <arg line="--to jsonp" />
    <arg line="--name ${l10n.func}" /><!-- name of the function that wraps the translations, defined in the file build.properties -->
    <arg line="--output ${l10n.json}" />
    <arg line="${l10n.properties}" />
  </apply>
</target>

<target name="buildTranslationJS" description="Convert localisation data (a Java properties file) into plain JavaScript.">
  <apply executable="java" failonerror="true" parallel="true">
    <fileset dir="${src.dir.translations}" />
    <arg line="-jar" />
    <arg path="${props2js}" />
    <arg line="--to js" />
    <arg line="--name ${l10n.func}" /><!-- name of the variable that wraps the translations, defined in the file build.properties -->
    <arg line="--output ${l10n.js}" /><!-- output file, defined in the file build.properties -->
    <arg line="${l10n.properties}" />
  </apply>
</target>