make application translatable (was Re: menu item properties)


I am just fixing I18N issues for SuSE Linux 10.1. There is my summary,
what needs to be done:

Define _ macro as gettext call, not as identity. GNOME includes do it
for you, but you have to define ENABLE_NLS (see below).

Define GETTEXT_PACKAGE and include needed rules to

Set needed defines - include config.h before all other includes, not
after them (to have defined ENABLE_NLS and GETTEXT_PACKAGE).

Properly pass GNOMELOCALEDIR (or different variable name depending on
your initialization sequence) in

All files to translation must be in

Properly initialize I18N support using bindtextdomain(),
bind_textdomain_codeset() and textdomain() with proper arguments before

Properly mark all strings you want to translate by _("string").

Check, whether strings marked by N_("string") identity macro are
translated during use.

Translate all xml, desktop files, soundlists etc. by intltool - you can
use nice INTLTOOL_xxx_RULE in and you must use _keyword for
keys you want to translate.

Properly handle localized plurals, numbers and dates.

Check, whether machine readable files are written in proper format
(check, whether you use C decimal point etc.).

Check, whether code does not expect fixed length of string.

To verify:

Create pot file and verify, that all strings you want to translate are
really there.

Compile your package with prefix different than /usr. Package must use
locales from prefix/share/locale.

Verify, that your package uses local in desktop files, gconf editor,
bonobo component name, soundlists etc.

Strace your package. If package searches for, it is broken.

Try with UTF-8 and non UTF-8 locales. If you see pango warnings during
use, your package is broken.

Try with locale with ',' as decimal point and multi-character thousands
separator (e. g. cs_CZ.UTF-8). Package must correctly export text files
and correctly display and interpret numbers.

Best Regards / S pozdravem,

Stanislav Brabec
software developer
SuSE CR, s. r. o.                             e-mail: sbrabec suse cz
Drahobejlova 27                               tel: +420 296 542 382
190 00 Praha 9                                fax: +420 296 542 374
Czech Republic                      

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]