From kde-core-devel Tue Aug 18 20:47:19 2009 From: Christian Esken Date: Tue, 18 Aug 2009 20:47:19 +0000 To: kde-core-devel Subject: Translating texts from the kernel / Soundcard control names in KMix Message-Id: <200908182247.19599.esken () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=125062847124890 Hello, I am currenlty adding WhatsThis help to the KMix controls. This is kind of special i18n usage, as the message ID's cannot be extraacted from the source, but are coming directly from the kernel (e.g. "Master", or "PCM Path Out & Mute"). I'd like some comments about the concept: 1) Is it a good idea to use a separate message/po file for that? As we have 2 different sources, it sounds reasonable to me. 2) Implementation (revision 1013107) After reading the docs, i came up with the following code: // Locale created once (static). Used below by whatsthisControlLocale() s_whatsthisLocale = new KLocale("kmix-controls"); // ... QString w; QString whatsthis (md->readableName()); char* whatsThisChar = whatsthis.toUtf8().data(); w = ki18n(whatsThisChar).toString(MixerToolBox::whatsthisControlLocale() ); setWhatsThis(w); Is that OK? I have a problem that the first translated message is garbage / contains random characters. The rest is OK, even when using the same message id as the garbage message. 3) How would this be integrated in the build/installation process? I have placed a l10n/ directory with the message files below kmix/. Is it good there or should that be moved somewhere else. Greetings, Christian