From 31fa5e47cc234d2784dd6c571c9cd3eddf871f08 Mon Sep 17 00:00:00 2001 From: Elias Date: Wed, 16 Jan 2019 19:54:22 +0100 Subject: [PATCH] Replace hardcoded language with dynamic one --- ScreenPlay/qml/Create/CreateImport.qml | 2 +- ScreenPlay/qml/Create/CreateUpload.qml | 3 - ScreenPlay/qml/Installed/Installed.qml | 1 - ScreenPlay/settings.json | 10 +- ScreenPlay/src/settings.cpp | 40 +- ScreenPlay/src/settings.h | 13 +- ScreenPlay/translations/ScreenPlay_de.ts | 503 ++++++++++---------- ScreenPlay/translations/ScreenPlay_en.ts | 497 +++++++++++--------- ScreenPlay/translations/ScreenPlay_ru.ts | 564 +++++++++++++++++++++++ 9 files changed, 1146 insertions(+), 487 deletions(-) create mode 100644 ScreenPlay/translations/ScreenPlay_ru.ts diff --git a/ScreenPlay/qml/Create/CreateImport.qml b/ScreenPlay/qml/Create/CreateImport.qml index 8e3f03bb..db2d3905 100644 --- a/ScreenPlay/qml/Create/CreateImport.qml +++ b/ScreenPlay/qml/Create/CreateImport.qml @@ -134,7 +134,7 @@ Item { height: 60 width: parent.width selectByMouse: true - text: qsTr("") + text: qsTr("Title") placeholderText: "Title" } } diff --git a/ScreenPlay/qml/Create/CreateUpload.qml b/ScreenPlay/qml/Create/CreateUpload.qml index 91eeb4c8..284a578d 100644 --- a/ScreenPlay/qml/Create/CreateUpload.qml +++ b/ScreenPlay/qml/Create/CreateUpload.qml @@ -216,7 +216,6 @@ Item { height: 60 Layout.preferredWidth: parent.width selectByMouse: true - text: qsTr("") placeholderText: "Title" } TextField { @@ -224,7 +223,6 @@ Item { height: 60 Layout.preferredWidth: parent.width selectByMouse: true - text: qsTr("") placeholderText: "Description" } @@ -233,7 +231,6 @@ Item { height: 60 Layout.preferredWidth: parent.width selectByMouse: true - text: qsTr("") placeholderText: "Youtube Preview URL" } Row { diff --git a/ScreenPlay/qml/Installed/Installed.qml b/ScreenPlay/qml/Installed/Installed.qml index 9b40ddbc..632abc46 100644 --- a/ScreenPlay/qml/Installed/Installed.qml +++ b/ScreenPlay/qml/Installed/Installed.qml @@ -326,7 +326,6 @@ Item { } selectByMouse: true - text: qsTr("") placeholderText: qsTr("Search for Wallpaper & Widgets") } } diff --git a/ScreenPlay/settings.json b/ScreenPlay/settings.json index fabbdba0..fabc340f 100644 --- a/ScreenPlay/settings.json +++ b/ScreenPlay/settings.json @@ -4,11 +4,7 @@ "highPriorityStart" : false, "sendStatistics" : false, "absoluteStoragePath": "", - "renderer": { - "renderer-value": 0, - "renderer-enum" : ["CUDA","FFmpeg", "D3D11", "DXVA", "VAAPI"] - }, - "profiles":[ - { "monitorID": "","profile": "" } - ] + "profiles":[ + { "monitorID": "","profile": "" } + ] } diff --git a/ScreenPlay/src/settings.cpp b/ScreenPlay/src/settings.cpp index dd1f88a8..de074198 100644 --- a/ScreenPlay/src/settings.cpp +++ b/ScreenPlay/src/settings.cpp @@ -1,15 +1,43 @@ #include "settings.h" #include #include + Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, QGuiApplication* app, QObject* parent) : QObject(parent) + , m_qSettings(QSettings(QSettings::NativeFormat, QSettings::Scope::UserScope, app->organizationName(), app->applicationName())) { m_plm = plm; m_mlm = mlm; m_ilm = ilm; m_sdkc = sdkc; - m_qGuiApplication = app; + m_app = app; + + if (m_qSettings.value("language").isNull()) { + auto locale = QLocale::system().uiLanguages(); + auto localeSplits = locale.at(0).split("-"); + + // Only install a translator if one exsists + QFile tsFile; + qDebug() << ":/translations/ScreenPlay_" + localeSplits.at(0) + ".qm"; + if (tsFile.exists(":/translations/ScreenPlay_" + localeSplits.at(0) + ".qm")) { + m_translator.load(":/translations/ScreenPlay_" + localeSplits.at(0) + ".qm"); + m_qSettings.setValue("language", QVariant(localeSplits.at(0))); + m_qSettings.sync(); + app->installTranslator(&m_translator); + } + } else { + QFile tsFile; + if (tsFile.exists(":/translations/ScreenPlay_" + m_qSettings.value("language").toString() + ".qm")) { + m_translator.load(":/translations/ScreenPlay_" + m_qSettings.value("language").toString() + ".qm"); + app->installTranslator(&m_translator); + } + } + + if (m_qSettings.value("ScreenPlayExecutable").isNull()) { + m_qSettings.setValue("ScreenPlayExecutable", QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); + m_qSettings.sync(); + } QFile configTmp; QString appConfigLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation); @@ -233,6 +261,16 @@ void Settings::requestAllLDataProtection() }); } +void Settings::saveWallpaper(int monitorIndex, QUrl absoluteStoragePath, QStringList properties, QString type) +{ +} + +void Settings::setqSetting(const QString &key, const QString &value) +{ + m_qSettings.setValue(key, value); + m_qSettings.sync(); +} + void Settings::setMuteAll(bool isMuted) { diff --git a/ScreenPlay/src/settings.h b/ScreenPlay/src/settings.h index 30feaa30..55aec3a9 100644 --- a/ScreenPlay/src/settings.h +++ b/ScreenPlay/src/settings.h @@ -148,6 +148,8 @@ public slots: void writeSingleSettingConfig(QString name, QVariant value); void requestAllLicenses(); void requestAllLDataProtection(); + void saveWallpaper(int monitorIndex, QUrl absoluteStoragePath, QStringList properties, QString type); + void setqSetting(const QString& key, const QString& value); bool autostart() const { @@ -176,15 +178,10 @@ public slots: if (autostart) { #ifdef Q_OS_WIN -#ifdef QT_DEBUG + QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); settings.setValue("ScreenPlay", QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + " -silent"); settings.sync(); -#else - QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat); - settings.setValue("ScreenPlay", QDir::toNativeSeparators("C:/Program Files (x86)/Steam/steamapps/common/ScreenPlay/ScreenPlay/ScreenPlay.exe") + " -silent"); - settings.sync(); -#endif #endif } else { #ifdef Q_OS_WIN @@ -303,6 +300,8 @@ private: void createDefaultConfig(); Version m_version; + QSettings m_qSettings; + QTranslator m_translator; ProfileListModel* m_plm; InstalledListModel* m_ilm; MonitorListModel* m_mlm; @@ -324,7 +323,7 @@ private: QString m_decoder; int m_activeWallpaperCounter = 0; - QGuiApplication* m_qGuiApplication; + QGuiApplication* m_app; bool m_offlineMode = true; }; diff --git a/ScreenPlay/translations/ScreenPlay_de.ts b/ScreenPlay/translations/ScreenPlay_de.ts index 5498d9fc..4b78f8d1 100644 --- a/ScreenPlay/translations/ScreenPlay_de.ts +++ b/ScreenPlay/translations/ScreenPlay_de.ts @@ -4,94 +4,85 @@ Community - + We use Stomt because it provides quick and easy feedback via I like/I wish. So you can easily give us feedback and speak your mind. We will read these wishes on a daily basis! - Wir verwenden Stomt, weil es schnelles und einfaches Feedback über I like/I wish liefert. So kannst du uns leicht Feedback geben. Wir werden eure Wünsche und Vorschläge täglich lesen! + - + Open ScreenPlay Stomt page - ScreenPlay Stomt Seite öffnen + - - News & Patchnotes - - - - + Forums - Forum + - + Blog - Documentation - Dokumentation + + Source Code + - - Github - - - - + Workshop - + Create - + Create wallpapers and widgets for local usage or the steam workshop! - Erstellen Wallpaper und Widgets für dich oder stelle deine Werke auf Steam für andere zur Verfügung! + - + QML Quickstart Guide - + - + Documentation - Dokumentation + - + Forums - Forum + - + Workshop - + CreateImport - + Select Image Manually - Bild manuell auswählen + - + + Title + + + + - - Choose Folder - Ordner auswählen - - - + Import Video - Video importieren + @@ -99,79 +90,104 @@ Create another Wallpaper - Ein weiteres Wallpaper erstellen + Upload Wallpaper to Steam - Ein weiteres Wallpaper erstellen + CreateUpload - + - - Upload to Steam - Auf Steam hochladen + + Videos + - + + Scenes + + + + + Widgets + + + + + AppDrawer + + + + + Upload to Steam + + + + Creating Workshop Item - Workshop Item erstellen + CreateWallpaper - + Import Video Wallpaper - Video importieren + - - Select File - Datei auswählen + + Import video + - + + Convert Video + + + + Upload Exsisting Project to Steam - Vorhandenes Projekt auf Steam hochladen + CreateWidget - + Create Widgets and Scenes - Erstelle Widgets und Scenes + - + Create Emtpy Widget - Erstelle neues leeres Widget + - - Examples Widgets - Beispiel Widget + + Examples Widgets and Scenes + - + Simple clock widget - Einfaches Uhr Widget + - + Musik scene wallpaper visualizer - Musik Wallpaper Visualizer + - + Changing scene wallpaper via unsplash.com @@ -186,90 +202,96 @@ Installed - - - Refreshing! - - - + Refreshing! + + + + + Pull to refresh! - + - + Get more Wallpaper & Widgets via the Steam workshop! - Mehr Wallpaper & Widgets über den Steam Workshop! + - + All - + - + Videos - + Scenes - - - - - Widgets - + - Search for Wallpaper & Widgets - Durchsuche deine Wallpaper & Widgets + Widgets + - + + + + Search for Wallpaper & Widgets + + InstalledUserHelper Make your desktop more: - Mache deinen Desktop mehr: + DISTINCT - EINZIGARTIG + Get free Widgets and Wallpaper - Kostenlose Widgets und Wallpaper herunterladen + Monitors - + Wallpaper Configuration - Wallpaper Einstellungen + - + Remove all wallpaper - Beende alle aktiven Wallpaper + + + + + Volume + + + + + Playback rate + NavigationWallpaperConfiguration - - Wallpaper Configuration - Wallpaper Einstellung - Configurate active Wallpaper @@ -277,157 +299,195 @@ - ScreenPlayItem + NextButton - - Open containing folder - Öffne Ordner + + Next + - + + Finish + + + + + Creating + + + + + ScreenPlayItem + + + Open containing folder + + + + Open workshop Page - Öffne Workshop Seite + Settings - + General - Allgemein + - + Autostart - + - + ScreenPlay will start with Windows and will setup your Desktop every time for you. - ScreenPlay startet mit Windows + - + High priority Autostart - Hohe Autostart Priorität + - + This options grants ScreenPlay a higher autostart priority than other apps. - Diese Option gewährt ScreenPlay eine höhere Autostart-Priorität als andere Anwendungen. + - - Set save location - Setze den Speicherort für deine Wallpaper und Widgets - - - + Send anonymous crash reports and statistics - Anonyme Absturzberichte und Statistiken senden + - + Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! - Helfen Sie uns, ScreenPlay schneller und stabiler zu machen. Alle gesammelten Daten sind rein anonym und werden ausschließlich zu Entwicklungszwecken verwendet! + - + + Set save location + + + + Set location - Speicherort auswählen + - + + Important: Changing this directory has no effect on the workshop download path. ScreenPlay only supports having one content folder! + + + + + Language + + + + + Set the ScreenPlay UI Language + + + + Performance - Leistung - - - - Pause wallpaper when ingame - Wallpaper im Spiel anhalten - - - - To maximise your framerates ingame, you can enable this setting to pause all active wallpapers! - Um Ihre Frameraten im Spiel zu maximieren, kannst du diese Einstellung aktivieren. Dies bewirkt, dass alle aktiven Wallpaper pausiert werden solange du dich im Spiel befindest! - - - - Default decoder - Standard-Decoder - - - - ScreenPlay supports different encoders for different hardware requirements. - ScreenPlay unterstützt verschiedene Encoder für unterschiedliche Hardwareanforderungen. - - - - Default Fill Mode - Standard-Füllmodus + + Pause wallpaper when ingame + + + + + To maximise your framerates ingame, you can enable this setting to pause all active wallpapers! + + + + + Default Fill Mode + + + + Set this property to define how the video is scaled to fit the target area. - Diese legt die Skalierung des Video global fest. + - + About - Über uns + - + Third Party Software - + - + ScreenPlay would not be possible without the work of others. A big thank you to: - ScreenPlay wäre ohne die Arbeit anderer nicht möglich. Ein großes Dankeschön an: + - + Licenses - Lizenzen + + + + + Data Protection + + + + + We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others! + + + + + Privacy + Sidebar - - Set Widget - Erstelle Widget - - - - Set Wallpaper - Erstelle Wallpaper - - - + Headline - + - + Select a Monitor to display the content - Wähle einen Monitor aus, um das Wallpaper anzuzeigen. + - + Volume - Lautstärke + - + Fill Mode - + Set wallpaper - Erstelle Wallpaper + + + + + Set Wallpaper + + + + + Set Widget + @@ -440,101 +500,70 @@ Could not connect to Steam :( - ScreenPlay konnte sich nicht mit Steam verbinden :( + To use ScreenPlay with all its features you have to have Steam running! - Um ScreenPlay mit all seinen Funktionen nutzen zu können, muss Steam im Hintergrund aktiv sein! + Close ScreenPlay - ScreenPlay schließen + Continue using ScreenPlay offline - ScreenPlay offline weiterverwenden + Seek help in our greate community! - Suchen Sie Hilfe in unserer großen Community! + - Workshop + XMLNewsfeed - - Download now! - - - - - Downloading... - - - - - Trendig Today - Trendig heute - - - - WorkshopAlertBanner - - - Oh No! Looks like there a only a few wallpapers and widgets! Help us by creating your own wallpapers and Widgets :) - Oh Nein! Sieht aus, als gäbe es nur ein paar Wallpaper und Widgets! Helfe uns, indem du deine eigenen Wallpaper und Widgets erstellst und anderen zur Verfügung stellst:) - - - - WorkshopItem - - - Download - - - - - Downloading Workshop content shortly! - Download Workshop-Inhalte in Kürze! + + News & Patchnotes + main - + Open ScreenPlay - Öffne ScreenPlay + - - + + Mute all - Alle stummschalten + - + Unmute all - Stummschaltung aufheben + - - + + Pause all - Alle pausieren + - + Play all - Alle abspielen + - + Quit - Beenden + diff --git a/ScreenPlay/translations/ScreenPlay_en.ts b/ScreenPlay/translations/ScreenPlay_en.ts index 57b024c6..5ba02b01 100644 --- a/ScreenPlay/translations/ScreenPlay_en.ts +++ b/ScreenPlay/translations/ScreenPlay_en.ts @@ -4,65 +4,60 @@ Community - + We use Stomt because it provides quick and easy feedback via I like/I wish. So you can easily give us feedback and speak your mind. We will read these wishes on a daily basis! - + - + Open ScreenPlay Stomt page - + - - News & Patchnotes - - - - + Forums - + - + Blog - - Github - + + Source Code + - + Workshop - + Create - + Create wallpapers and widgets for local usage or the steam workshop! - + - + QML Quickstart Guide - + - + Documentation - + - + Forums - + Workshop @@ -70,24 +65,24 @@ CreateImport - + Select Image Manually - + - + + Title + + + + - - Choose Folder - - - - + Import Video - + @@ -95,81 +90,106 @@ Create another Wallpaper - + Upload Wallpaper to Steam - + CreateUpload - + - - Upload to Steam - + + Videos + - + + Scenes + + + + + Widgets + + + + + AppDrawer + + + + + Upload to Steam + + + + Creating Workshop Item - + CreateWallpaper - + Import Video Wallpaper - + - - Select File - + + Import video + - + + Convert Video + + + + Upload Exsisting Project to Steam - + CreateWidget - + Create Widgets and Scenes - + - + Create Emtpy Widget - + - - Examples Widgets - + + Examples Widgets and Scenes + - + Simple clock widget - + - + Musik scene wallpaper visualizer - + - + Changing scene wallpaper via unsplash.com - + @@ -177,87 +197,97 @@ Bad File!! - + Installed - - - Refreshing! - - - + Refreshing! + + + + + Pull to refresh! - + - + Get more Wallpaper & Widgets via the Steam workshop! - + - + All - + - + Videos - + Scenes - - - - - Widgets - - - - - Search for Wallpaper & Widgets - + + Widgets + + + + + + + Search for Wallpaper & Widgets + + InstalledUserHelper Make your desktop more: - + DISTINCT - + Get free Widgets and Wallpaper - + Monitors - + Wallpaper Configuration - + - + Remove all wallpaper - + + + + + Volume + + + + + Playback rate + @@ -269,157 +299,195 @@ - ScreenPlayItem + NextButton - - Open containing folder - + + Next + - + + Finish + + + + + Creating + + + + + ScreenPlayItem + + + Open containing folder + + + + Open workshop Page - + Settings - + General - + - + Autostart - + - + ScreenPlay will start with Windows and will setup your Desktop every time for you. - + - + High priority Autostart - + - + This options grants ScreenPlay a higher autostart priority than other apps. - + - - Set save location - - - - + Send anonymous crash reports and statistics - + - + Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! - + - + + Set save location + + + + Set location - + + Important: Changing this directory has no effect on the workshop download path. ScreenPlay only supports having one content folder! + + + + + Language + + + + + Set the ScreenPlay UI Language + + + + Performance - - - - - Pause wallpaper when ingame - - - - - To maximise your framerates ingame, you can enable this setting to pause all active wallpapers! - - - - - Default decoder - - - - - ScreenPlay supports different encoders for different hardware requirements. - - - - - Default Fill Mode - + + Pause wallpaper when ingame + + + + + To maximise your framerates ingame, you can enable this setting to pause all active wallpapers! + + + + + Default Fill Mode + + + + Set this property to define how the video is scaled to fit the target area. - + - + About - + - + Third Party Software - + - + ScreenPlay would not be possible without the work of others. A big thank you to: - + - + Licenses - + + + + + Data Protection + + + + + We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others! + + + + + Privacy + Sidebar - - Set Widget - - - - - Set Wallpaper - - - - + Headline - + - + Select a Monitor to display the content - + - + Volume - + - + Fill Mode - + Set wallpaper - + + + + + Set Wallpaper + + + + + Set Widget + @@ -432,101 +500,70 @@ Could not connect to Steam :( - + To use ScreenPlay with all its features you have to have Steam running! - + Close ScreenPlay - + Continue using ScreenPlay offline - + Seek help in our greate community! - + - Workshop + XMLNewsfeed - - Download now! - - - - - Downloading... - - - - - Trendig Today - - - - - WorkshopAlertBanner - - - Oh No! Looks like there a only a few wallpapers and widgets! Help us by creating your own wallpapers and Widgets :) - - - - - WorkshopItem - - - Download - - - - - Downloading Workshop content shortly! - + + News & Patchnotes + main - + Open ScreenPlay - + - - + + Mute all - + - + Unmute all - + - - + + Pause all - + - + Play all - + - + Quit - + diff --git a/ScreenPlay/translations/ScreenPlay_ru.ts b/ScreenPlay/translations/ScreenPlay_ru.ts new file mode 100644 index 00000000..057953ac --- /dev/null +++ b/ScreenPlay/translations/ScreenPlay_ru.ts @@ -0,0 +1,564 @@ + + + + + Community + + + We use Stomt because it provides quick and easy feedback via I like/I wish. So you can easily give us feedback and speak your mind. We will read these wishes on a daily basis! + + + + + Open ScreenPlay Stomt page + + + + + Forums + + + + + Blog + + + + + Source Code + + + + + Workshop + + + + + Create + + + Create wallpapers and widgets for local usage or the steam workshop! + + + + + QML Quickstart Guide + + + + + Documentation + + + + + Forums + + + + + Workshop + + + + + CreateImport + + + Select Image Manually + + + + + + + + + + Import Video + + + + + CreateImportStatus + + + Create another Wallpaper + + + + + Upload Wallpaper to Steam + + + + + CreateUpload + + + + + + + + + + + + + + + + + + Videos + + + + + Scenes + + + + + Widgets + + + + + AppDrawer + + + + + Upload to Steam + + + + + Creating Workshop Item + + + + + CreateWallpaper + + + Import Video Wallpaper + + + + + Import video + + + + + Convert Video + + + + + Upload Exsisting Project to Steam + + + + + CreateWidget + + + Create Widgets and Scenes + + + + + Create Emtpy Widget + + + + + Examples Widgets and Scenes + + + + + Simple clock widget + + + + + Musik scene wallpaper visualizer + + + + + Changing scene wallpaper via unsplash.com + + + + + FileDropper + + + Bad File!! + + + + + Installed + + + Refreshing! + + + + + + Pull to refresh! + + + + + Get more Wallpaper & Widgets via the Steam workshop! + + + + + All + + + + + Videos + + + + + Scenes + + + + + Widgets + + + + + + + + + + Search for Wallpaper & Widgets + + + + + InstalledUserHelper + + + Make your desktop more: + + + + + DISTINCT + + + + + Get free Widgets and Wallpaper + + + + + Monitors + + + Wallpaper Configuration + + + + + Remove all wallpaper + + + + + Volume + + + + + Playback rate + + + + + NavigationWallpaperConfiguration + + + Configurate active Wallpaper + + + + + NextButton + + + Next + + + + + Finish + + + + + Creating + + + + + ScreenPlayItem + + + Open containing folder + + + + + Open workshop Page + + + + + Settings + + + General + + + + + Autostart + + + + + ScreenPlay will start with Windows and will setup your Desktop every time for you. + + + + + High priority Autostart + + + + + This options grants ScreenPlay a higher autostart priority than other apps. + + + + + Send anonymous crash reports and statistics + + + + + Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes! + + + + + Set save location + + + + + Set location + + + + + Important: Changing this directory has no effect on the workshop download path. ScreenPlay only supports having one content folder! + + + + + Performance + + + + + Pause wallpaper when ingame + + + + + To maximise your framerates ingame, you can enable this setting to pause all active wallpapers! + + + + + Default Fill Mode + + + + + Set this property to define how the video is scaled to fit the target area. + + + + + About + + + + + Third Party Software + + + + + ScreenPlay would not be possible without the work of others. A big thank you to: + + + + + Licenses + + + + + Data Protection + + + + + We use you data very carefully to improve ScreenPlay. We do not sell or share this (anonymous) information with others! + + + + + Privacy + + + + + Sidebar + + + Headline + + + + + Select a Monitor to display the content + + + + + Volume + + + + + Fill Mode + + + + + Set wallpaper + + + + + Set Wallpaper + + + + + Set Widget + + + + + Set Scene + + + + + StartupErrorWindow + + + Could not connect to Steam :( + + + + + To use ScreenPlay with all its features you have to have Steam running! + + + + + Close ScreenPlay + + + + + Continue using ScreenPlay offline + + + + + Seek help in our greate community! + + + + + XMLNewsfeed + + + News & Patchnotes + + + + + main + + + Open ScreenPlay + + + + + + Mute all + + + + + Unmute all + + + + + + Pause all + + + + + Play all + + + + + Quit + + + +