New i18n interface for KDE 4

Chusslove Illich caslav.ilic at gmx.net
Sat Sep 10 17:58:42 BST 2005


> [: Michael Olbrich :]
> No implicit conversion. That just asks for trouble. You don't know
> whether the QString stored in the QVariant is before or after the
> arguments are passed. If its before you would loose KI18n's
> functionality without any warning.

Ah, but this holds for any implicit conversion. Thinking along those lines, 
we would have to have a special method to finalize the translation, like:

i18n("Error while parsing line %1: %2").arg(lnum).arg(error).t()

...t() standing for "please translate and give me my QString".

This we also talked about on kde-i18n-doc, but the feeling was that it 
would be a too big departure from current practices, and not that 
necessary. Again, there is an argument that nothing would stop someone 
from first calling the t(), and an arg() afterwards.

I also think that here we can allow this silent loss of functionality, 
because of specific usage pattern: very few messages would have to be 
scripted, and the translators would be keen on seeing them work. So this 
kind of programming error would be promptly corrected.

> On that note, it would be a good idea to add debug code to check for
> missing argument when converting from KI18n to QString.

True, this would also not be possible with inherited KI18n, easy otherwise.

-- 
Chusslove Illich (Часлав Илић)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050910/296547c3/attachment.sig>


More information about the kde-core-devel mailing list