diff options
author | Stiepen22 <stiepen22@gmx.de> | 2013-09-08 23:43:19 +0200 |
---|---|---|
committer | Stiepen22 <stiepen22@gmx.de> | 2013-09-08 23:43:19 +0200 |
commit | 3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2 (patch) | |
tree | c9305f1c365a8f6421dfc562e5f3887f1ecc445c /MultiMC.cpp | |
parent | 45a338a3cd17be47dd5fe64a62b8ae42a2e3b1ca (diff) | |
download | MultiMC-3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2.tar MultiMC-3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2.tar.gz MultiMC-3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2.tar.lz MultiMC-3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2.tar.xz MultiMC-3e1cb5798835917bd64f34dc52fa1ca44eb4c7b2.zip |
Filed attempt on making localization work
Diffstat (limited to 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp index c93701b8..9cbf4947 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -3,6 +3,8 @@ #include <iostream> #include <QDir> #include <QNetworkAccessManager> +#include <QTranslator> +#include <QLibraryInfo> #include "gui/mainwindow.h" #include "logic/lists/InstanceList.h" @@ -224,10 +226,22 @@ int main(int argc, char *argv[]) // initialize Qt MultiMC app(argc, argv); + std::cout << "Loading Language File for " << QLocale::system().name().toLocal8Bit().constData() << "..." << std::endl; + + QTranslator qtTranslator; + qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + app.installTranslator(&qtTranslator); + + QTranslator mmcTranslator; + mmcTranslator.load("mmc_" + QLocale::system().name()); + app.installTranslator(&mmcTranslator); + // show main window MainWindow mainWin; mainWin.show(); + + switch(app.status()) { case MultiMC::Initialized: |