Contents
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:
- loading the bundle (if a switch back to english if not available in the user language)
manage the translation of a string through the getText(String) method
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:
with a sed script, extract messages from the label tag and create a fake C file which will be processed by the updateLocalizationModule.sh script among the rest of the files.
- extract gettext("my message") from the instructions
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.
- Unpack the archive
- Under Linux:
- export SCI=/path/to/your/source/tree
- sh \$SCI/tools/localization/dispatchLocalizationFile.sh /path/to/the/unpack/archive/
All localization files should be dispatched into the Scilab source tree.
Encoding
- English : ASCII / ISO-8859
- French : ISO-8859-15
