* Fixed an issue with translations
[colorful-apps:puzzle-master.git] / main.cpp
1 #include <QtGui>
2 #include "mainwindow.h"
3 #include "util.h"
4
5 QSettings *settings;
6
7 int main(int argc, char *argv[])
8 {
9     QApplication app(argc, argv);
10
11     QApplication::addLibraryPath("./plugins");
12     QApplication::setApplicationName("Puzzle Master");
13     QApplication::setOrganizationName("Venemo");
14     QApplication::setApplicationVersion(QString(APP_VERSION));
15
16     QString langCode;
17     langCode = getenv("LANG");
18     if (langCode.isEmpty() || langCode == "C")
19         langCode = QLocale::system().name();
20
21     //    qDebug() << langCode;
22
23     QTranslator tQt, tApp;
24     tQt.load("qt_" + langCode, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
25     tApp.load("puzzle-master_" + langCode, ":/translations");
26     QApplication::installTranslator(&tQt);
27     QApplication::installTranslator(&tApp);
28
29     qsrand((uint)QTime::currentTime().msec());
30     settings = new QSettings();
31
32     MainWindow w;
33 #if defined(Q_OS_SYMBIAN)
34     w.showFullScreen();
35 #elif defined(MOBILE)
36     w.showMaximized();
37 #else
38     w.show();
39 #endif
40
41     return app.exec();
42 }