How to do l10n for dynamic strings in KDE4 ?
Nicolas Goutte
nicolasg at snafu.de
Sat Mar 4 12:12:24 GMT 2006
On Saturday 04 March 2006 12:53, Christian Esken wrote:
> Hello,
>
> I am currently working on adding more l10n to KMix. l10n is there in most
> places, but there is on challenge left, namely dynamic string translation.
> For example:
>
> QString controlName = i18n( mixercontrol->getName() ); // When using the
> ALSA-backend, control names come straight from the kernel
>
> While many control names are well-known (like Master, Surround, CD or PCM),
> there are a LOT of non-standard names. New controlo names show up with each
> new sound card or ALSA driver version. How could such a l10n task be
> accomplished?
There is no choice but to have pre-determined translations. There is not
something like automatic translations (what I suppose you mean by "dynamic").
>
> My current idea is to ship KMix with a set of standard names (e.g. as a lot
> of I18_NOOP() in an otherwise unused file). The non-standard names would
> come from an XML file, that can also ship extra translations, like
> "name_de" below:
>
> <control id="Optical/Coaxial_SPDIF_Input:0" controls="*" tab="Sound
> Routing" name_de="Optischer/Coaxialer Digital-Eingang" />
If you have translations in a XML file, I would use them in priority. If the
string is not translated, then pass it to i18n() and use what is returned by
the call (...which might be untranslated).
However if the XML is KDE-secific then it should remain untranslated but the
strings should be extracted (currently manually by extractrc). In that cae
you always have to call i18n().
Also if you have plenty of generic names, which a high potential conflict risk
with existing messages, please consider use a content for all these strings.
For example, "Master" for sound might not be a "Master" for something else
non-sound (i.e. in Elnglish the name might be the same, but not in all
translations).
>
> Christian
Have a nice day!
>
> PS: The same goes for the Tooltips, that explain the controls
More information about the kde-core-devel
mailing list