Localization - Scilab Wiki

Localization

Mailing lists

Localization in English

Localisation en Français

中文(繁體)本土化(Chinese Traditional)

Developers

Update of the localization files

If any change has been made on any string in the source, localization files must be updated.

To facilitate this, we developed a script to do this :
tools/localization/updateLocalizationModule.sh

Using this script is straightforward.

export SCI=/path/to/scilab/source/tree/
sh tools/localization/updateLocalizationModule.sh <module_name> 

If module_name is process_all, it will regenerate all localization files of Scilab.

Thanks to gettext tools, this script is intelligent. It will detect if a string has been changed (it will then update the line in all the .po files of a module), added (it will add it) or removed.

Localization files

Localization files are stored in :

# SCI/modules/<module>/locales/<locale>/messages.po

For example, the French localization files of the interpolation module is modules/interpolation/locales/fr_FR/messages.po

There are one localization files per module and per language. At the moment, we have English (en_US) and French (fr_FR).

Java localization

gettext is generating java classes (called ResourceBundle) which contain the localized strings. In the root Makefile.am of Scilab, we generate this class with the command: \$(MSGFMT) \$(MSGFMT_OPTS) --statistics --locale \$\$LOCALE -r org.scilab.modules.localization.Messages --java2 -d \$(top_builddir)/modules/localization/build/classes/ \$\$POFILE; which is going to generate classes into SCI/modules/localization/build/classes/org/scilab/modules/localization/Messages*class

To manage the localization, we created the class (modules/localization/src/java/org/scilab/modules/localization/Messages.java) which is in charge of:

To translate a string, it is straightforward:

import org.scilab.modules.localization.Messages;
[...}
Messages.gettext("My own string");

Most of the message of the GUI are located into XML files (like modules/gui/etc/main_menubar.xml). These files are processed by 2 pass:

Synchronize Launchpad => Scilab

When a language has been translated under Launchpad/Rosetta and there is the need to synchronize Scilab source tree with the latest version of the localization files.

  1. Request a full download of the localization files

  2. Unpack the archive
  3. Under Linux:
    1. export SCI=/path/to/your/source/tree
    2. sh \$SCI/tools/localization/dispatchLocalizationFile.sh /path/to/the/unpack/archive/

All localization files should be dispatched into the Scilab source tree.

Encoding

Work completed to update modules

Localization: Module list update

Localization (last edited 2008-08-19 13:02:56 by Sylvestre Ledru)