Add language selection option in settings

Fixes #501
This commit is contained in:
Cameron Gutman
2021-01-30 12:14:31 -06:00
parent 1cd66419d4
commit 69b6022afe
4 changed files with 163 additions and 6 deletions

View File

@@ -451,9 +451,9 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QTranslator translator;
qDebug() << "Translation loaded:" << translator.load(QString(":/languages/qml_") + QLocale::system().name());
app.installTranslator(&translator);
// Apply the initial translation based on user preference
StreamingPreferences prefs;
prefs.retranslate();
// After the QGuiApplication is created, the platform stuff will be initialized
// and we can set the SDL video driver to match Qt.
@@ -525,8 +525,8 @@ int main(int argc, char *argv[])
});
qmlRegisterSingletonType<StreamingPreferences>("StreamingPreferences", 1, 0,
"StreamingPreferences",
[](QQmlEngine*, QJSEngine*) -> QObject* {
return new StreamingPreferences();
[](QQmlEngine* qmlEngine, QJSEngine*) -> QObject* {
return new StreamingPreferences(qmlEngine);
});
// Create the identity manager on the main thread