home contents changes options help

Internationalisation for CinePaint

The FilmGimp version of CinePaint uses Gnu Gettext and the Gtk1 toolkit.
This feature has been introduced since version 0.21-0.

Worth reading short introductions exist on the www:
http://en.wikipedia.org/wiki/Gettext

Translation activities are coordinated on the cinepaint-devel mailing list:
http://lists.sourceforge.net/lists/listinfo/cinepaint-developers

Users

Set your environment variable LANG to your language like:
# export LANG=de_DE
Start CinePaint. It should show translated strings in the user interface so far a translation has been provided.

Translators

Existing languages can be translated by editing the language.po files in the three po*/ directories

    po/
    po-plug-ins/
    po-script-fu/ 

Textdomains:
CinePaint uses currently
the cinepaint textdomain in the po/ directory and
the cinepaint-std-plugins textdomain translated in the po-plug-ins/ directory;
the cinepaint-script-fu textdomain in the po-script-fu/ directory is included in case someone activates script-fu.

New Languages:
To add a new language copy (in each po*/ directory) the template file cinepaint-xxx.pot to new_language.po (like de.po, fr.po, ...). The new language gets detected by doing a configure in the toplevel directory. Make sure that new_language.po files exist in all three po*/ directories.

Translation:
A virgin .po file consists of pairs

    msgid "english_text"
    msgstr ""
Replace the empty ("") msgstr string by your translation of the english text.

Take care about the fuzzy keyword. It is a sign that gettext has found by some internal rules a vague translation which needs a human review. Correct the translation if necessary and remove the fuzzy keyword. Only then the translation will be used.

Activate Changes:
After editing a .po file do a
# make
(either in the po*/ directory itself or in the toplevel directory) and the human readable .po file gets compiled into a binary .gmo file ready for installation. After a
# make install
the new translated strings should apear in CinePaint so far your environment variable LANG was set to your language.

Workflow:
A full `make install' takes some time and is overweighted if only a changed .po file is to reinstall. Since during a translation session this task may be needed more frequently, a reduction to the essential might be of interest. The following sample script updates for the cinepaint-std-plugins textdomain (directory po-plug-in/) the .gmo binary files and installs (copies) the german de.gmo file on its right place in the install directory.

#!/bin/sh
# 1) Updates (recreates) for the `cinepaint-std-plugins' textdomain the `.gmo' 
#  binary files from the human readable `.po' files by calling `make' in
#  the ${SOURCEROOT}/po-plug-ins/ source directory.
#
# 2) Installs the `de.gmo' binary file by copying into the directory 
#  ${PREFIX}/share/locale/LC_MESSAGES/de/ as `cinepaint-std-plugins.mo'
#  file, where ${PREFIX} is CinePaint's install directory as given in 
#  `configure --prefix=...' (default: PREFIX=/usr/local). 

# Adapt this for your directories: SOURCEROOT=~/Programme/cinepaint/cinepaint-0.21-1 PREFIX=/usr/local

# Adapt this for your language ("de" -> ...) cd ${SOURCEROOT}/po-plug-ins/ make cp de.gmo ${PREFIX}/share/locale/de/LC_MESSAGES/cinepaint-std-plugins.mo

# END OF SCRIPT

Programmers

Core Files:
In core files include the file "libgimp/gimpintl.h".

Plug-in Files:
In plug-in files include "libgimp/stdplugins-intl.h".
Put the statement

    INIT_I18N_UI(); 
somewhere before your first translateable string is used, possibly in run().

Marking of Strings:
The above include files provide the _() macro. Put strings, which shall be translated, in the _() macro. This macro will be substituded by gettext(), or by () if i18n support is disabled. Example:

    void f (const char* fname) {
      const char* str_abbort = _("Abbort");
      printf (_("Could not open file '%s'!\n"), fname); 
      puts (str_abbort);
    }

The strings "Abbort" and "Could not open file '%s'!\n" would appear then in the .po files.

File Registration:
Registrate source files, which contain marked strings, in po*/POTFILES.in. Only files registered there will be searched in the following step for translateable strings.

Activate Changes:
After adding or changing of marked strings, a search run is neseccary to transfer these strings into the associated .pot and .po files. To upgrade the cinepaint-xxx.pot file and all .po files in one of the po*/ directories, change into this directory, remove the cinepaint-xxx.pot file and type
# make update-po
This recreates cinepaint-xxx.pot and updates all .po files. To only recreate cinepaint-xxx.pot do a
# make cinepaint-xxx.pot

Now the translation work can be done by editing the .po files as described in the Translators section above.

Plug-ins:
Plug-ins have their own text domain, see above. Be carefully with menupaths. Despite the string "/File/Print/..." would appear in the appropriate .po file, it would not be translated by CinePaint. CinePaint splits menupaths by the / separator. To translate the above menupath put the menupath atoms as dummy strings like _("Print"); somewhere in your source code. (The string "File" should already be marked as translateable in the plug-ins textdomain.)
Test that not two menupaths exist like "/Filters/Fancy/My Filter" and "/Filters/Krass/Mein Filter".

External translations:
After using external translations, you can change back the textdomain by

    textdomain("cinepaint-std-plugins");

Languages

A list of available languages and their status:

catalan
ca_ES ; ?% ; ??
czech
cs_CZ ; ?% ; ??
danish
da_DK; ?% ; ??
dutch
nl_NL; 75% ; Hassan Khoshkhabar
greek
el_GR; ?% ; ??
spanish
es_ES; ?% ; ??
finnish
fi_FI; ?% ; ??
french
fr_FR; 99% ; Pascal LACROIX
irish
ga_IE ; ?% ; ??
galish
gl_ES; ?% ; ??
german
de_DE ; 98% ; Kai-Uwe Behrmann
croatian
hr_HR ; ?% ; ??
hungarian
hu_HU ; ?% ; ??
italian
it_IT ; ?% ; ??
japanese?
ja_JP ; ?% ; ??
korean?
ko_KR ; ?% ; ??
lithuanian
lt_LT ; ?% ; ??
norwegian
nn_NO ; ?% ; ??
norwegian
no_NO ; ?% ; ??
polish
pl_PL ; ?% ; ??
portugese brazil
pt_BR ; ?? ; ?%
portugese
pt_PT ; ?% ; ??
romanian
ro_RO ; ?% ; ??
russian
ru_RU ; ?% ; ??
slovak
sk_SK ; ?% ; ??
slovenian
sl_SI ; ?% ; ??
swedish
sv_SE ; ?% ; ??
turkish
tr_TR ; ?% ; ??
ukrainian?
uk_UA ; ?% ; ??
chinese?
zh_CN ; ?% ; ??
chinese?
zh_TW ; ?% ; ??

initially written on 8. april 2006, by Kai-Uwe Behrmann

updated on 17. July 2006, by Kai-Uwe Behrmann
updated on 26. April 2006, by Kai-Uwe Behrmann
reworked on 22. October 2006, by Hartmut Sbosny

back to CinePaintDocumentation