diff options
| author | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2017-11-23 01:42:49 +0100 |
|---|---|---|
| committer | Alexis Jeandet <alexis.jeandet@member.fsf.org> | 2017-11-23 07:09:07 +0100 |
| commit | 5c5eac357199092a1766bc43ce46bd7483451e74 (patch) | |
| tree | c2d2cb035ab0d5e720ecec06623e2567b53bbb5a /test cases/frameworks/4 qt/q5core.cpp | |
| parent | 1fd743e6adbb04fc0d75ac21908a108c3483dc80 (diff) | |
| download | meson-5c5eac357199092a1766bc43ce46bd7483451e74.tar.gz | |
[Qt module] Added translation files compilation method
- Added a new compile_translations method since preprocess was already quite
full and translations compilation is quite different from ui, qrc, cpp files
preprocessing.
- Updated translation.
- Updated test case.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Diffstat (limited to 'test cases/frameworks/4 qt/q5core.cpp')
| -rw-r--r-- | test cases/frameworks/4 qt/q5core.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test cases/frameworks/4 qt/q5core.cpp b/test cases/frameworks/4 qt/q5core.cpp index 706e4dc87..25b80b8e3 100644 --- a/test cases/frameworks/4 qt/q5core.cpp +++ b/test cases/frameworks/4 qt/q5core.cpp @@ -1,8 +1,26 @@ #include <QCoreApplication> +#include <QtGlobal> +#include <QString> +#include <QTranslator> +#include <QLocale> +#include <QLibraryInfo> +#include <QDebug> int main(int argc, char **argv) { QCoreApplication app(argc, argv); + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + app.installTranslator(&qtTranslator); + + QTranslator myappTranslator; + if(!myappTranslator.load("qt5core_fr") ) + return 1; + + app.installTranslator(&myappTranslator); + + qDebug() << QObject::tr("Translate me!"); // Don't actually start the main loop so this // can be run as a unit test. //return app.exec(); |
