Further on the road to new i18n API for KDE4

Chusslove Illich caslav.ilic at gmx.net
Wed Mar 15 20:07:01 GMT 2006

> [: Nicolas Goutte :]
> As I suppose that you know my position from previous discussions (and 
> therefore do not need it re-iterated), here just a few comments on
> details.

Indeed 'tis true that I know your stances, but I am kind of afraid that not 
many other comments came up (both now and before). I suppose that the 
change in i18n API is going to hit just about everybody, and there are 
many little things that can be done this or that way. Like:

>> [: Chusslove Illich :]
>> ki18n("%1, %2...").argf("foo%1").argf(10).toString()
> [: Nicolas Goutte :]
> What happens when the developer uses arg() and not argf(). I expect that
> this will be done quite a number of times.

In short, a compile time error, as KLocalizedString is not inherited from 
QString. But the intent here is more important: I want to discourage 
general use of this form (thus the new names, ki18n and argf), to limit it 
only to (rare) special situations. For general use, I intend the short 
(template) forms:

i18n("%1, %2...", "foo", "bar") // ordinary
i18nc("Dear Translator...", "%1, %2...", "foo", "bar") // context
i18np("%1 image out of %1", "%n images out of %1", sel, tot) // plural

If we drop the short forms, thus making toString() call necessary for 
*every* i18n'd message, then the names ki18n and argf might as well revert 
to i18n and arg. But I think forcing people to use toString() all the time 
is too much (is it? that's one question to which I didn't get a clear 
answer so far).

> In which time would you be ready to put it in trunk/KDE?

Coding is the smallest issue here, I could quite quickly implement whatever 
is agreed upon (and convert kdelibs to new API); also piece up transition 
instructions, including how to use the conversion script. But I would 
really like to get more people agreeing on the new API.

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

More information about the kde-core-devel mailing list