New i18n interface for KDE 4

Nicolas Goutte nicolasg at snafu.de
Thu Sep 8 11:03:35 BST 2005


>List:       kde-core-devel
> Subject:    Re: New i18n interface for KDE 4
> From:       Tom Albers <tomalbers () kde ! nl>
>Date:       2005-09-07 19:39:28
>Message-ID: 200509072139.28938.tomalbers () kde ! nl

>Hi,

>Op maandag 5 september 2005 15:41, schreef Chusslove Illich:
>> On kde-i18n-doc there has been some discussion about how to provide more
>> power to KDE translators, especially for translating into mid to highly
>> inflected languages.
>>
>> For example, one of the problems is that sometimes an argument in a
>> message, like "Open with %1", in some languages requires form (case)
>> different than the basic one, so that it is in agreement with sentence
>> structure. A very thorough demonstration of this kind of problem (as well
>> as a lot of talk regarding how we can solve it with new interface) can be
>> found in, what I believe to be quite infamous, thread on kde-i18n-doc:
>> http://lists.kde.org/?t=112300742000007&r=1&w=2

> A bit large to read through...

Yes, but there was much to discuss too.

>> The idea is to allow translators to somehow operate on arguments at
>> runtime, what I refer to as "translation scripting". 

>Can you give some examples of how this will look like? How does it look like 
>from a developers point of view, do we need to do something different then 
>the i18n() calls we do now, other the making them capitals ;-)? 

The goal is that it does not look different than the current i18n() and the 
use of QString::arg. The difference is only that instead of working on 
QString it would work on a I18n class, which would give more control to the 
translators.

The main change is that you cannot write code like:

QString msg = i18n("Error when reading file: %1");
KMessageBox::error( msg.arg(i18n("No permission"));

But you would need:

KI18n msg= i18n("Error when reading file: %1");
KMessageBox::error( msg.arg(i18n("No permission"));

(Of course they are other border cases.)

>And how does 
>this work in the po-files?

The script is part of the translation with a magic to tell that there is a 
script. (A "dull" translation is given too, if the user does not allow 
translation scripting.) There will be probably the need of some sort of 
"include" files.

> Are we going to ask translators to script there 
>translations with if;then;else;fi constructions, or? 

It is not "asking", it is giving the possibility.

Tom Albers





More information about the kde-core-devel mailing list