PATCH: i18nc not working under windows

Patrick Spendrin ps_ml at gmx.de
Tue Nov 11 23:18:02 GMT 2008


Chusslove Illich schrieb:
>> [: Patrick Spendrin :]
>> [...] On Windows the dcgettext call doesn't work because LC_MESSAGES is
>> not defined correctly. The attached patch replaces the dcgettext calls
>> with dgettext ones [...]
> 
> I'm not happy about introducing extra code to work around a problem that
> should be handled on a more basic level, so it would be nice if this
> (temporary?) code would be well compartmentalized (dpngettext_expr is used
> by i18ncp(), so I guess it needs replacement too). For example:
> 
>   #ifndef Q_OS_WIN32
>   #define DPGETTEXT_LOCAL dpgettext_expr
>   #define DNPGETTEXT_LOCAL dnpgettext_expr
>   #else
>   static const char *dpgettext_expr_win32 (...)
>   {
>       ...
>   }
>   static const char *dnpgettext_expr_win32 (...)
>   {
>       ...
>   }
>   #define DPGETTEXT_LOCAL dpgettext_expr_win32
>   #define DNPGETTEXT_LOCAL dnpgettext_expr_win32
>   #endif
> 
>   ...
> 
>   QString KCatalog::translate (...)
>   {
>       ...
>       return QString::fromUtf8(DPGETTEXT_LOCAL(d->name, msgctxt, msgid));
>   }
I will use this solution for 4.1.4 and trunk if I haven't found any 
better way of fixing that until then.
> 
> Also, if the nature of "LC_MESSAGES is not defined correctly" is serious
> enough, perhaps it would warrant support in the Gettext itself (gettext.h is
> copied over from Gettext package)? Because, as it is now, any context-using
> gettextized app would have to introduce similar workaround. The port of call
> for that is bug-gnu-gettext at gnu.org.
Yes, I am not sure where our libintl/gettext packages come from - I am 
still investigating this into several directions.
> 
regards & thanks,
Patrick


-- 
web:                 http://windows.kde.org
mailing list:        kde-windows at kde.org
irc:                 #kde-windows (irc.freenode.net)




More information about the kde-core-devel mailing list