Unsolved Qt id based translation
-
Is it possible to use id based translation for non-qt classes?
-
Hi @Valerian,
You should be able to use QCoreApplication::translate directly to translate for any "context" (eg class name), regardless of whether or not its a Qt-based class. Though I'm not sure how that would work with Qt Linguist tools such as
lupdate
.Cheers.
-
Thanks @Paul
Is there a way to use qtTrId() to translate string? -
Is there a way to use qtTrId() to translate string?
I don't see any reason why not, but I'm not at all familiar with Qt Linguist's Text ID Based Translations.
I did notice this though:
Note: You must use only plain-text-based or only text-ID-based functions in one application. If you mix them, you will end up with an incomplete set of texts to be translated.
Cheers.
-
@Paul Thanks for the inputs.
One more query, so when I change the language do I have to manually reset all the text in the application?
-
@Valerian
Hi
Yes for all Widgets not inserted via UI file,
you must make a function that sets the texts again.
Sadly its not live :) -
How to refresh the QML files on installing a new translator using qsTrId()?
-
@Wieland any advice regarding updating the qml files on switching translators when using qsTrId approach?