-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
31 lines (26 loc) · 899 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
#include "MainWindow.hpp"
#include <QApplication>
#include <QTranslator>
#include <QMessageBox>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QString translationsPath = QDir::currentPath() + "/translations/";
QLocale locale = QLocale::system();
QTranslator qtTranslator;
if (qtTranslator.load(locale, "qt", "_", translationsPath)) {
app.installTranslator(&qtTranslator);
}
else {
QMessageBox::warning(nullptr, "Warning", "Qt translations file is not found.");
}
QTranslator translator;
if (translator.load(locale, "FSTreeInfo", "_", translationsPath)) {
app.installTranslator(&translator);
}
else {
QMessageBox::warning(nullptr, "Warning", "File with Russian translation is not found. English will be used as interface language.");
}
MainWindow w;
w.show();
return app.exec();
}