mirror of
https://github.com/JasonYANG170/IOTConnect-PC.git
synced 2024-11-23 12:16:49 +00:00
26 lines
562 B
C++
26 lines
562 B
C++
|
|
||
|
#include "mainwindow.h"
|
||
|
|
||
|
#include <QApplication>
|
||
|
|
||
|
#include <QLocale>
|
||
|
#include <QTranslator>
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
QApplication a(argc, argv);
|
||
|
|
||
|
QTranslator translator;
|
||
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
||
|
for (const QString &locale : uiLanguages) {
|
||
|
const QString baseName = "IOT_" + QLocale(locale).name();
|
||
|
if (translator.load(":/i18n/" + baseName)) {
|
||
|
a.installTranslator(&translator);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
MainWindow w;
|
||
|
w.show();
|
||
|
return a.exec();
|
||
|
}
|