23 lines
577 B
C++
23 lines
577 B
C++
#include "mainwindow.h"
|
|
|
|
#include <QApplication>
|
|
#include <QLocale>
|
|
#include <QTranslator>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
QTranslator translator;
|
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
|
for (const QString &locale : uiLanguages) {
|
|
const QString baseName = "QuteSample_" + QLocale(locale).name();
|
|
if (translator.load(":/i18n/" + baseName)) {
|
|
app.installTranslator(&translator);
|
|
break;
|
|
}
|
|
}
|
|
MainWindow win;
|
|
win.show();
|
|
return app.exec();
|
|
}
|