Translating texts from the kernel / Soundcard control names in KMix

Christian Esken esken at kde.org
Tue Aug 18 21:47:19 BST 2009


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





More information about the kde-core-devel mailing list