Question

I'm writing an application that is currently a pure QT4 app. It is designed to run cleanly on both Linux and Windows.

However I plan to integrate it a bit into KDE in future and here come the problems with localization/translations.

QT4 uses its own tr()/tr().arg().arg() mechanism and .ts/.qm files. KDE4 uses gettext and i18n/i18np mechanism and .po files.

How, easily, can I use KDE4's mechanism in my QT4 application without having to closely integrate it with KDE now (apparently making it non-runnable on Windows)?

Is it at all possible?

Thanks!

Was it helpful?

Solution

Starting version 4.5, Qt will support both .po and .xliff;

http://doc.trolltech.com/4.5/qt4-5-intro.html#qt-linguist-improvements

OTHER TIPS

I think you will need to just pick one and go with it, if it is a cross platform app, I'd go with QT's method. The reason why is that KDE wraps it's internationalized string with i18*() macros and QT uses tr() macros, since a macro can't produce another macro, there is no way unless you have #ifdef's all over your code, or a massive string table...both of which suck.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top