Is there a way to use the translations from qt library combined with that from user's application?
-
You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.
@Chris-Kawa After trying, I find it out.
EachQTranslator
can only hold the translations itload()
at last.
But oneQCoreApplication
caninstallTranslator()
for many times and use all of them for translating😂So, the solution is creating one
QTranslator
forQt
, and one for your app, finally, install them all to your app. -
If your app has its own translation files(
myapp.ts
) and it supplies aAbout Qt
dialog viaQMessageBox::aboutQt()
, then, the message shown byaboutQt()
will not be translated!
What's the solution? Or there is no solution?You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.
-
You need to deploy Qt modules translation files located in your Qt installation directory along with translation files of your app. See the documentation.
@Chris-Kawa After trying, I find it out.
EachQTranslator
can only hold the translations itload()
at last.
But oneQCoreApplication
caninstallTranslator()
for many times and use all of them for translating😂So, the solution is creating one
QTranslator
forQt
, and one for your app, finally, install them all to your app. -
-
@Chris-Kawa After trying, I find it out.
EachQTranslator
can only hold the translations itload()
at last.
But oneQCoreApplication
caninstallTranslator()
for many times and use all of them for translating😂So, the solution is creating one
QTranslator
forQt
, and one for your app, finally, install them all to your app.@Sauntor Or, like the documentation I linked suggests, merge all translations into one file using
lconvert
.