forked from trolley813/OpenFool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
35 lines (27 loc) · 953 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "mainwindow.h"
#include <QApplication>
#include <QTranslator>
#include <QLibraryInfo>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setQuitOnLastWindowClosed(true);
QSettings s(QSettings::IniFormat, QSettings::UserScope, "hyst329",
"OpenFool");
QString language = s.value("general/language",
QLocale::system().name().left(2)).toString();
s.setValue("general/language", language);
QTranslator qtTranslator;
qtTranslator.load("qt_" + language,
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator);
QTranslator openFoolTranslator;
openFoolTranslator.load(
"OpenFool_" + language,
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&openFoolTranslator);
MainWindow w;
w.show();
return a.exec();
}