-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (27 loc) · 896 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
#include "views/mainwindow.h"
#include <QApplication>
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSettings settings;
QTranslator t;
QString language = settings.value("language").toString();
QString lang;
//If this is the first time the user opens the app, let them choose the language
if(language.isEmpty()){
QStringList languages;
languages << "Français" << "English";
lang = QInputDialog::getItem(NULL, "Select language", "Language", languages);
settings.setValue("language", lang);
}else{
lang = settings.value("language").toString();
}
if(lang == "English"){
t.load(":/translations/AIS_en.qm"); //TEMPORARY : Load from QSettings
}
a.installTranslator(&t);
MainWindow w;
w.show();
return a.exec();
}