Marcin Gil
Marcin Gil

Reputation: 69535

Using KDE4 localization mechanisms in pure QT4 application

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!

Upvotes: 3

Views: 523

Answers (2)

Henrik Hartz
Henrik Hartz

Reputation: 3675

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

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

Upvotes: 2

Evan Teran
Evan Teran

Reputation: 90493

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.

Upvotes: 0

Related Questions