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

List:       kde-core-devel
Subject:    Re: New i18n interface for KDE 4, second try
From:       Ingo =?iso-8859-15?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2005-10-28 23:01:59
Message-ID: 200510290101.59785 () erwin ! ingo-kloecker ! de
[Download RAW message or body]


On Tuesday 25 October 2005 16:25, Chusslove Illich wrote:
> After some more toying with the code, here is the summary.
>
> Just a reminder: the new interface is needed if we want to capture
> arguments which replace the %NN placeholders in an i18n call, and
> that is needed because we want to employ translator-side scripting of
> some grammar-wise nasty messages.
>
> Basic idea was to make a new class derived from QString, which has
> overridden arg() methods. This was discussed a lot, and while it
> would make least impact on existing i18n practices, almost preserving
> source compatibility, it had a need for some hacks (because QString
> was not designed for inheritance). However, due to its
> non-intrusivity, I feel this still to be an option, so I mention it
> here.
>
> The other feasible idea was to make a new class, say named KTrString,
> but not derived from QString and without any implicit conversions to
> QString, and therefore with a special method to finalize translation,
> i.e. like:
>
> i18n("Blah, blah: %1 %2").arg(foo).arg(bar).toString();

I don't really want to comment on those proposals. Instead I just want 
to point out that sometimes it's important to make several replacements 
at once (like the multi-argument variant of QString::arg()). Why? 
Because sometimes it's impossible to guarantee that a replacement 
string doesn't contain "%1".

So whatever solution you choose please make sure that it's possible to 
make several replacements in one pass. We need this in KMail.

Regards,
Ingo

[Attachment #3 (application/pgp-signature)]

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

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