ranslation problems; possible solution

Lorenzo Cappelletti l_cappelletti at everyday.com
Fri Oct 24 19:48:20 CDT 2003


Christian Stimming <stimming at tuhh.de>, Wed 22 Oct 2003 15:28 +0200:

> also referenced in the recent gnome-i18n discussion 
> http://mail.gnome.org/archives/gnome-i18n/2003-October/msg00197.html . 
> The respective discussion on gnome-i18n some years ago came pretty much 
> to the same conclusion, 
> http://mail.gnome.org/archives/gnome-i18n/2001-April/msg00058.html : For 
> these short ambiguous messages, they prepend a *prefix* to the msgid, 
> separated by a the special character `|'. The translators only translate 
> the part after the special character. E.g. for de.po

I haven't read the messages you pointed out (sorry, I'm not on-line 
now), but I'd like to contribute with my 5 cents.

I do believe that the conclusions they came to are not correct.  The 
problem is not related to programming, rather translating.  I mean, you 
cannot provide a prefix for each (or even a few of) msgid.  This would 
require extra work for you and for the translators for who that msgid 
isn't abigous.

I know the solution I'm going to suggest you takes longer to be 
effective, but it might hopefully solve the issue once for all.

I typical msgid looks like:

#: src/app-utils/gnc-ui-util.c:973 src/gnome/glade/account.glade:864
#: src/gnome/glade/account.glade:1369 src/gnome/glade/account.glade:1414
#: src/gnome-utils/dialog-account.c:290 intl-scm/guile-strings.c:3767
msgid "Opening Balance"
msgstr ""

If a translator could wirte something like:

msgstr "generic translation"
msgstr-gnc-ui-util.c:973 "specific translation"
msgstr-guile-strings.c:3767 "specific translation"

or reference the place, where that specific taranslation should be used,
in some meaningfull and effective way (e.g., msgstr-1, msgstr-6...).

A translation has to be kept up with the programm releases. It this 
doesn't happen, gettext will use the "generic translation" when a 
correct reference cannot be found.


A similar approach has been successfully implement for the plural form.  
GmuCash itself makes use of it:

#: src/gnome/dialog-sxsincelast.c:385 src/gnome/window-main.c:619
#, c-format
msgid ""
"There are no Scheduled Transactions to be entered at this time.\n"
"(%d transaction automatically created)"
msgid_plural ""
"There are no Scheduled Transactions to be entered at this time.\n"
"(%d transactions automatically created)"
msgstr[0] ""
"Non ci sono movimenti pianificati da immettere in questo momento.\n"
"(%d movimento creato automaticamente)"
msgstr[1] ""
"Non ci sono movimenti pianificati da immettere in questo momento.\n"
"(%d movimenti creati automaticamente)"


So why not file a bug to gettext or even work on the gettext's code and 
provide a patch?

-- 
email: lorenzo.cappelletti at email.it
Jabber: lolo at linux.it
Fingerprint: 8CDD 3408 53B2 6122 99DA EE37 1523 68FC D906 4C08


More information about the gnucash-devel mailing list