mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 15:53:57 +08:00
* move translation files to assets.qrc
* cleanup
* add main_en
* dynamically add
* not sure if required
* revert to master
* move translations above assets
* add translations to qrc file
* comment
* now add translations_assets_src to assets sources
* this is built
* add to .gitignore
* consistent name
---------
Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: 17bfff8e10
31 lines
802 B
C++
31 lines
802 B
C++
#include <sys/resource.h>
|
|
|
|
#include <QApplication>
|
|
#include <QTranslator>
|
|
|
|
#include "system/hardware/hw.h"
|
|
#include "selfdrive/ui/qt/qt_window.h"
|
|
#include "selfdrive/ui/qt/util.h"
|
|
#include "selfdrive/ui/qt/window.h"
|
|
|
|
int main(int argc, char *argv[]) {
|
|
setpriority(PRIO_PROCESS, 0, -20);
|
|
|
|
qInstallMessageHandler(swagLogMessageHandler);
|
|
initApp(argc, argv);
|
|
|
|
QTranslator translator;
|
|
QString translation_file = QString::fromStdString(Params().get("LanguageSetting"));
|
|
if (!translator.load(QString(":/%1").arg(translation_file)) && translation_file.length()) {
|
|
qCritical() << "Failed to load translation file:" << translation_file;
|
|
}
|
|
|
|
QApplication a(argc, argv);
|
|
a.installTranslator(&translator);
|
|
|
|
MainWindow w;
|
|
setMainWindow(&w);
|
|
a.installEventFilter(&w);
|
|
return a.exec();
|
|
}
|