Reputation: 2974
Is there a way to add specific phrases from Qt frameworks's internal .ts files to my application's translation files? I only need to translate several phrases for QMessageBox and friends.
EDIT:
I also want to:
lupdate
There's always an alternative to subclass QMessageBox, but I'd like to try a perfectionist solution first.
EDIT #2:
I've solved the problem the ugly way by shipping a .qm file with my application from the Qt distribution. I'll keep this question open in case somebody comes up with a more elegant solution.
Upvotes: 1
Views: 381
Reputation: 1974
EDITED: For custom translation of internal Qt phrases you only need to do some steps:
qt_lang.ts
in translation
folder inside Qt SDK directory. I strongly recommend you to use Qt linguist for this purpose.qt_lang.ts
to produce .qm file.translations
folder, but you can change this dir by using custom qt.conf.So when you change app language you'll get needed (translated by you) phrases.
For example, if you want to achieve custom translation for russian friends you need to open qt_ru.ts
in Qt Linguist
, locate there QMessageBox
context and translate all needed phrases. Then follow described above instruction.
Upvotes: 1
Reputation: 3138
In Qt you can load various ts files for your application, i would try not to extract the needed phrases but load the qt ts files along with your own translation
Upvotes: 0