change language in programm
-
Hello, I need to translate the text on the StandardButtons in my programm into German, but I don´t know how to do it.
I only need the file from qt. -
Hello, I need to translate the text on the StandardButtons in my programm into German, but I don´t know how to do it.
I only need the file from qt.@Michelle02283
you should be able to find the apropriate *.qm files on your system:
Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations -
@Michelle02283
you should be able to find the apropriate *.qm files on your system:
Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations@J.Hilk I found them but which one do I need?
-
@Michelle02283
you should be able to find the apropriate *.qm files on your system:
Path/to/Qt/installation/Qt/Version(e.g.5.10.1)/Libary(e.g.mingw53_32)/translations@J.Hilk and how can I use them in my programm?
-
@J.Hilk and how can I use them in my programm?
@Michelle02283
really depends on what part of qt you're using.The core part of the library should be with
qt_(ISO 639-1-languagecode).qmcovered, if you added a module in your pro file, fro exampleQT += serialportthan you should also add theqtserialport_(ISO 639-1-languagecode).qm -
@Michelle02283 look at documentation here and examples here and here. You can translate your application's strings and you can use Qt's provided translations for the framework's strings.
-
@J.Hilk and how can I use them in my programm?
@Michelle02283 with
QTranslatorof coursefor example:
myTranslator = new QTranslator(this); qtTranslator= new QTranslator(this); myTranslator->load("myTranslation_de", myTranslationPathString); qtTranslator->load("qt_de", qtTranslationPathString); qApp->installTranslator(myTranslator); qApp->installTranslator(qtTranslator); -
@Michelle02283 with
QTranslatorof coursefor example:
myTranslator = new QTranslator(this); qtTranslator= new QTranslator(this); myTranslator->load("myTranslation_de", myTranslationPathString); qtTranslator->load("qt_de", qtTranslationPathString); qApp->installTranslator(myTranslator); qApp->installTranslator(qtTranslator);@J.Hilk I added this lines to my main.cpp. If I open a QMainWindow the StandardButton are not translated. Do I have to add some code into this class also?
-
@J.Hilk I added this lines to my main.cpp. If I open a QMainWindow the StandardButton are not translated. Do I have to add some code into this class also?
@Michelle02283 you should really read through the links @Pablo-J-Rogina gave you. My example is incomplete.
For example you'll have to signal the UI to retranslate, if you apply the QTranslator after the ui-setup
-
Please download this
https://www.linux-apps.com/p/1127666
and have a look at the end of the file .pro, at the file mail.cpp and then in qtcreator tools -> external -> linguistics.