Language Translations

There is code in Control to be able to translate various words phrases.

While the translation does have some intelligence, it is somewhat limited. Eg. It is able to detect whether the original phrase is upper or lower case and adjust the translated text accordingly. However, it is not able to deal with mixed case text.

The translation tables have to be manually entered and compiled.

The Files

All translation files are stored in the $CCDIR/lang_ts folder. There are two types of files:

Each set of translations will need to be placed in a separate set of .ts/.qm files. That is, Chinese translations are to be placed in files separate to the US English files. Also, the Sri Lankan English files are are to be separate from the US English files.

Using the Translations

To use the translation files,

  1. Copy the appropriate .qm file into <CCDIR>/lang_ts/. Eg.

    > cp my_translations.qm /u/cc/lang_ts/
  2. Set the CCLANG environment variable to the name of the .qm file. Do not use the directory name. Eg.
    > export CCLANG=my_translations.qm
  3. Run Control.

Editing the Translation Table

To edit the translation table,

  1. Go to the lang_ts folder
    > cd $CCDIR/lang_ts/
  2. Open the appropriate .ts file with a text editor. Eg:
    > vi my_translations.ts
  3. On the line immediately after the last </message> tag, insert

    <message>
            <source>the_original_phrase</source>
            <translation>the_translated_phrase</translation>
    </message>

    The text inside the <source> tag MUST be lower case.

  4. Convert the .ts file into a .qm file
    > $CCDIR/std/qtx11-3.3.5b/bin/lrelease my_translations.ts
  5. Test to ensure that it works