[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Plural translations for qt-libified kdesdk/kcachegrind
From:       Josef Weidendorfer <Josef.Weidendorfer () gmx ! de>
Date:       2009-01-22 13:01:47
Message-ID: 200901221401.47773.Josef.Weidendorfer () gmx ! de
[Download RAW message or body]

On Wednesday 21 January 2009, Chusslove Illich wrote:
> So far as one is willing to forego Qt's native i18n (which is what is done
> when QTranslator::translate() is reiplemented, etc.) and wants to use PO
> catalogs at runtime, might just as well drop tr() calls alltogether and use
> standard Gettext (thus retaining support from xgettext as it is):
> 
>   #define PODOMAIN "my_qt_lib"
>   #define _(msg) QString::fromUtf8(dgettext(PODOMAIN, msg))
>   #define n_(sing, plur, n) QString::fromUtf8(dngettext(PODOMAIN, sing, plur, n))
>   #define p_(ctxt, msg) ...
>   #define np_(ctxt, sing, plur) ...
> 
>   ...

Wow. I totally missed the preprocessor.

> > [...] From the Qt documentation, Qt seems to better handle languages with
> > more than 2 plural forms (?).
> 
> No. At best, it handles it equally good as Gettext. The downpoints compared
> to Gettext, where they apply, are:
> 
> * Non-translated app suffers unless someone provides US English translation
>   for plural messages, which is what a Qt article on plurals suggested (and
>   who's gonna do that, in general?)
> 
> * A language with non-standardized specification of plural forms cannot
>   provide plural forms per catalog/project, since they're hardcoded in Qt
>   (e.g. for my language, Serbian, there are two specifications in collation
>   currently -- Qt is using the obsolete one).
> 
> * For processing purposes, third-party tools have no place where to get the
>   plural specification from, except by keeping close track of a certain Qt
>   source file where these are hardcoded (and what happens when plural
>   specification for a language changes between versions of Qt?)

Thanks for this background information.
Did you also bug the Qt developers about this?

Josef
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic