Skip to content

xxDear KDE Developersxx

November 28, 2010
xxAre you sure you want to read this article?xx
    xxYesxx                      xxNoxx

Are you confused? Do you ask yourself, what the ‘x’s are all about?
Then you should definitely click Yes, err, read ahead.

There are some technical references, but I am not going into too much detail because every one of which could fill an article by itself (and maybe will, sometime).

KDE aims at an as wide user base as possible. In order to achive this goal, we translate our software. As translators (I am one of the German language jugglers) we translate what is given to us by the wonderful and glorious Scripty. Scripty is a little Daemon[1] that extracts Strings from the UI every day and hands them over to the translators in form of easy-to-handle PO files. These PO files are then opened with Lokalize (which seems to be horribly broken with Qt 4.7.1, but that is another story) and translated string by string. The PO file can be tested by converting it to the MO format and moving it to the LC_MESSAGES folder of your language, e.g.:
msgfmt kannasaver.po -o $KDEDIR/share/locale/de/LC_MESSAGES/kannasaver.mo

If the PO file was at 100%, your application is now fully translated, congratulations.[2]

But wait. What is that? Is it a bird? Is it a plane? No! Is an untranslated string!

It is pretty common for us to find untranslated strings although the translation for the application in question is at 100%.
How is that possible?

There are several possible reasons. Some of which are

  • missing i18n() calls in the sources,
  • defective Messages.sh files or
  • strings actually coming from another catalogue (e.g. kdelibs), that is not fully translated.

The latter is rather easy to spot in most cases, since the strings appear in general dialogues or on standard buttons. But what about the other two?

For translators it does not come natural to browse the code looking for the problem. On the other hand, developers have their heads wrapped around the code structure and tend to forget about i18n issues.[3] So these days there are a few mighty heroes spotting these strings and fixing the issues. But they do not fight with their bare hands. They have a powerful tool to to assist them. Its name is …

Wait, I want to stop here for a second to remind you that it is a good deed to help people in need, like old people who have trouble crossing the street or people who obviously carry something too heavy for them. :)

So, where was I? Ah right, … Its name is x-text! Pretty cool name, eh? So what is the secret power of x-test?
It is a language. A language which holds the original strings with prepended and appended “xx” (Kannasaver for example).

If you are actively developing using the x-test language, you can spot some i18n issues early in the process and avoid last-minute fixes found by one of the translators or users of the translation. It even assists you to some extent spotting design issues of you application.

For example, if you have a button with an English label that fits perfectly, you might feel safe. But then there is this translation where the proper word for the label is longer than the original text and it is cut-off due to the fixed width of your button. The four extra ‘x’s can help here in some cases.

But that is just an extra. Untranslatable strings found and fixed by the developers themselves take quite a workload off the translation folks while not generating more work for or standing in the way of the developer.

If you are using kdesrc-build, you just need to add x-test to the kde-languages line of your .kdesrc-buildrc file, e.g.
kde-languages de x-test
and you are done. Well, almost …

I think there is an issue in the way kdesrc-build builds translations. It fails if PO files are (re)moved or added. I did not investigate that further yet but it helps to remove the language’s build folder to fix it. Please comment, if you know more about this.

Alright, that’s it for today, enjoy your Sunday … and install x-test. :)

xxRegardsxx

[1] For me, Scripty is the Daemon + the people around it (mainly Albert, Pino and Burkhard, who maintain its operation state and do all the other manual maintenance work needed)
[2] Boldly simplified for the sake of the actual topic. :)
[3] Yes, I am guilty as well. If I code, I make i18n mistakes even though I should know very well about them after almost five years of translating.


Flattr this

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: