diff --git a/blueROCK.pro b/blueROCK.pro index 718c049..d830ff9 100644 --- a/blueROCK.pro +++ b/blueROCK.pro @@ -36,8 +36,11 @@ HEADERS += \ RESOURCES += resources/qml/qml.qrc \ resources/shared/shared.qrc \ #resources/shared/icons/bluerock/index.theme \ - #$$files(resources/shared/icons/*.png, true) + \ #$$files(resources/shared/icons/*.png, true) + resources/translations/translations.qrc +TRANSLATIONS += resources/translations/en.ts \ + resources/translations/de.ts # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = diff --git a/headers/shareUtils/androidshareutils.h b/headers/shareUtils/androidshareutils.h index 5a3d81a..b74fd86 100755 --- a/headers/shareUtils/androidshareutils.h +++ b/headers/shareUtils/androidshareutils.h @@ -12,6 +12,7 @@ class AndroidShareUtils : public PlatformShareUtils, public QAndroidActivityResultReceiver { + Q_OBJECT public: AndroidShareUtils(QObject* parent = nullptr); bool checkMimeTypeView(const QString &mimeType) override; diff --git a/resources/qml/Components/QrCodeScanPopup.qml b/resources/qml/Components/QrCodeScanPopup.qml index f394fea..12469a3 100644 --- a/resources/qml/Components/QrCodeScanPopup.qml +++ b/resources/qml/Components/QrCodeScanPopup.qml @@ -24,7 +24,7 @@ Dialog { modal: true //% "Scan QR-Code" - title: qsTrId("scanQrCode") + title: qsTrId("#scanQrCode") standardButtons: Dialog.Cancel @@ -38,7 +38,7 @@ Dialog { function setDefaultStatusText() { //% "Place the Code in the center" - _statusText = qsTrId("placeQrCodeInCenter") + _statusText = qsTrId("#placeQrCodeInCenter") _statusColor = Material.primaryTextColor } @@ -180,13 +180,13 @@ Dialog { control._freezeScanning = true //% "Plase wait" - control._statusText = qsTrId("pleaseWait") + "..." + control._statusText = qsTrId("#pleaseWait") + "..." if(app.openWidgetFromUrl(tag)) control.close() else { //% "Invalid QR-Code" - control._statusText = qsTrId("invalidQrCode") + control._statusText = qsTrId("#invalidQrCode") control._statusColor = Material.color(Material.Red) statusTextResetTimer.start() control._freezeScanning = false diff --git a/resources/qml/Components/SharePopup.qml b/resources/qml/Components/SharePopup.qml index 818748d..4a512df 100644 --- a/resources/qml/Components/SharePopup.qml +++ b/resources/qml/Components/SharePopup.qml @@ -16,7 +16,8 @@ Dialog { y: (parent.height - height) * 0.5 modal: true - title: "Share these results" + //% "Share these results" + title: qsTrId("#shareResultsHeadline") onClosed: { shareComponentLoader.sourceComponent = null @@ -40,12 +41,15 @@ Dialog { Repeater { id: buttonRepeater property var buttons: [ - ["\uf0c1", "Link", serverConn.shareResultsAsUrl], - ["\uf029", "QR-code", function() { + //% "Link" + ["\uf0c1", qsTrId("#shareByLink"), serverConn.shareResultsAsUrl], + //% "QR-Code" + ["\uf029", qsTrId("#shareByQrCode"), function() { stackLayout.currentIndex = 1 } ], - ["\uf1c1", "Poster", serverConn.shareResultsAsPoster], + //% "Poster" + ["\uf1c1", qsTrId("#shareByPoster"), serverConn.shareResultsAsPoster], ] model: buttons diff --git a/resources/qml/Components/SpeedFlowChartLocker.qml b/resources/qml/Components/SpeedFlowChartLocker.qml index 10f2b43..27acda2 100644 --- a/resources/qml/Components/SpeedFlowChartLocker.qml +++ b/resources/qml/Components/SpeedFlowChartLocker.qml @@ -17,7 +17,7 @@ Rectangle { function onPurchaseFailed() { //% "Purchase failed" - purchaseBt.text = qsTrId("purchaseFailed") + purchaseBt.text = qsTrId("#purchaseFailed") purchaseBt.enabled = false buttonTextResetTimer.start() } @@ -31,9 +31,9 @@ Rectangle { onTriggered: { purchaseBt.text = (speedFlowChartProduct.status === Product.Registered //% "Buy now for" - ? qsTrId("buyNowFor") + " " + speedFlowChartProduct.price + ? qsTrId("#buyNowFor") + " " + speedFlowChartProduct.price //% "This item is currently unavailable" - : qsTrId("itemUnavailable")) + : qsTrId("#itemIsUnavailable")) purchaseBt.enabled = true } } @@ -57,7 +57,7 @@ Rectangle { height: parent.height * 0.015 //% "This is a premium feature." - text: qsTrId("thisIsAPremiumFeature") + text: qsTrId("#thisIsAPremiumFeature") font.bold: true font.pixelSize: height @@ -87,9 +87,8 @@ Rectangle { Layout.alignment: Layout.Center enabled: speedFlowChartProduct.status === Product.Registered text: speedFlowChartProduct.status === Product.Registered - ? "\uf218 "+ qsTrId("buyNowFor") +" " + speedFlowChartProduct.price - //% "This item is currently unavailable" - : qsTrId("itemIsUnavailable") + ? "\uf218 "+ qsTrId("#buyNowFor") +" " + speedFlowChartProduct.price + : qsTrId("#itemIsUnavailable") font.family: fa5solid.name onClicked: speedFlowChartProduct.purchase() } @@ -105,7 +104,7 @@ Rectangle { flat: true //% "Restore purchase" - text: qsTrId("restorePurchase") + text: qsTrId("#restorePurchase") onClicked: inAppProductStore.restorePurchases() } @@ -116,7 +115,7 @@ Rectangle { flat: true //% "contact support" - text: qsTrId("contact support") + text: qsTrId("#contact support") onClicked: Qt.openUrlExternally("mailto:contact@itsblue.de") } diff --git a/resources/qml/Pages/StartPage.qml b/resources/qml/Pages/StartPage.qml index 4181ca5..ebc6a09 100644 --- a/resources/qml/Pages/StartPage.qml +++ b/resources/qml/Pages/StartPage.qml @@ -105,20 +105,19 @@ Page { id: buttonRepeater property var buttons: [ //% "IFSC results" - ["\uf059", qsTrId("ifscResults"), ifscDisclaimerDialog.open], + ["\uf059", qsTrId("#ifscResults"), ifscDisclaimerDialog.open], [ "\uf042", Material.theme === Material.Light ? //% "Dark mode" - qsTrId("darkMode"): + qsTrId("#darkMode"): //% "Light mode" - qsTrId("lightMode"), + qsTrId("#lightMode"), app.toggleDarkMode ], //% "About blueROCK" - ["\uf05a", qsTrId("aboutBluerock"), aboutBluerockDisclaimerDialog.open], - //% "Scan QR code" - ["\uf029", qsTrId("scanQrCode"), qrCodeScanPopup.open], + ["\uf05a", qsTrId("#aboutBluerock"), aboutBluerockDisclaimerDialog.open], + ["\uf029", qsTrId("#scanQrCode"), qrCodeScanPopup.open], ] model: buttons @@ -160,22 +159,18 @@ Page { DisclaimerDialog { id: ifscDisclaimerDialog Material.theme: root.Material.theme - title: "Where are the IFSC results?" - content: "Unfortunately, the IFSC has restricted the access to their data and is not willing to share results with blueROCK anymore. " + - "Because of this, blueROCK is no longer able to access and display IFSC results.

" + - "You can find current IFSC results over here and on their website." + //% "Where are the IFSC results?" + title: qsTrId("#ifscDisclaimerTitle") + //% "Unfortunately, the IFSC has restricted the access to their data and is not willing to share results with blueROCK anymore. Because of this, blueROCK is no longer able to access and display IFSC results.

You can find current IFSC results over here and on their website." + content: qsTrId("#ifscDisclaimer") } DisclaimerDialog { id: aboutBluerockDisclaimerDialog Material.theme: root.Material.theme title: "blueROCK v" + APP_VERSION + "
By Itsblue Development" - content: "This app was built using the Qt Framework " + - "licensed under the GNU lgplV3 license.

"+ - - "This app is open source and licensed under the GNU agplV3 license," + - "the source code can be found here.

" + - "Resultservice and rankings provided by digital ROCK." + //% "This app was built using the Qt Framework licensed under the GNU lgplV3 license.

This app is open source and licensed under the GNU agplV3 license, the source code can be found here.

Resultservice and rankings provided by digital ROCK." + content: qsTrId("#aboutBluerockDisclaimer") } QrCodeScanPopup { diff --git a/resources/qml/Widgets/CalendarWidget.qml b/resources/qml/Widgets/CalendarWidget.qml index 2a82889..10140fa 100644 --- a/resources/qml/Widgets/CalendarWidget.qml +++ b/resources/qml/Widgets/CalendarWidget.qml @@ -29,7 +29,7 @@ DataListView { property bool ready //% "calendar" - property string title: (params.nation === "ICC" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTrId("calendar") + " " + control.year + property string title: (params.nation === "ICC" ? "IFSC":params.nation === "GER" ? "DAV":"SAC") + " " + qsTrId("#calendar") + " " + control.year property Component headerComponent: RowLayout { @@ -65,14 +65,14 @@ DataListView { } //% "Favorites" - compCats.push( {"text": qsTrId("favorites"), "data": {"sort_rank":0, "cat_id":[-1]}} ) + compCats.push( {"text": qsTrId("#favorites"), "data": {"sort_rank":0, "cat_id":[-1]}} ) compCats.sort(function(a, b) { return a['data']['sort_rank'] - b['data']['sort_rank']; }); //% "Select filters" - filterSelectPu.appear(compCats, qsTrId("selectFilters"), "") + filterSelectPu.appear(compCats, qsTrId("#selectFilters"), "") } text: "\uf0b0" @@ -206,17 +206,17 @@ DataListView { var infosheet = ""; if(infoUrls.length >= 1) //% "Infosheet" - infosheet += ("" + qsTrId('infosheet') + "") + infosheet += ("" + qsTrId("#infosheet") + "") if(infoUrls.length === 2) //% "Further infos" - infosheet += (", " + qsTrId('furtherInfos') + "") + infosheet += (", " + qsTrId("#furtherInfos") + "") console.log("Infosheet: " + infosheet) var eventWebsite = control.widgetData["competitions"][compIndex]["homepage"] !== undefined ? //% "Event website" - ("" + qsTrId('eventWebsite') + ""):"" + ("" + qsTrId("#eventWebsite") + ""):"" selector.appear(selectOptions, control.widgetData["competitions"][compIndex]['name'], eventWebsite + ((eventWebsite !== "" && infosheet !== "") ? ", ":"") + infosheet ) } @@ -233,7 +233,7 @@ DataListView { } //% "Select year" - selector.appear(selectOptions, qsTrId("selectYear")) + selector.appear(selectOptions, qsTrId("#selectYear")) } function openCup(state, data) { @@ -246,7 +246,7 @@ DataListView { if(state === undefined){ // opened for the first time -> select cup //% "Select cup" - selectTitle = qsTrId("selectCup") + selectTitle = qsTrId("#selectCup") cups.sort(function(a, b) { return parseInt(b["SerId"]) - parseInt(a["SerId"]); @@ -275,7 +275,7 @@ DataListView { } //% "Select category" - selectTitle = cup['name'] + ": " + qsTrId("selectCategory") + selectTitle = cup['name'] + ": " + qsTrId("#selectCategory") // build a list with all cat in the cup out of the cat keys (rkey) given in the cup.cats for(prop in cup['cats']){ diff --git a/resources/qml/Widgets/ProfileWidget.qml b/resources/qml/Widgets/ProfileWidget.qml index 76869b1..fc7d442 100644 --- a/resources/qml/Widgets/ProfileWidget.qml +++ b/resources/qml/Widgets/ProfileWidget.qml @@ -191,7 +191,7 @@ Page { horizontalAlignment: Text.AlignHCenter //% "Age" - text: qsTrId("age") + ": " + widgetData["age"] + text: qsTrId("#age") + ": " + widgetData["age"] } Label { @@ -208,7 +208,7 @@ Page { horizontalAlignment: Text.AlignHCenter //% "Year of birth" - text: qsTrId("yearOfBirth") + ": " + widgetData["birthdate"] + text: qsTrId("#yearOfBirth") + ": " + widgetData["birthdate"] } Label { @@ -225,7 +225,7 @@ Page { horizontalAlignment: Text.AlignHCenter //% "City" - text: qsTrId("city") + ": " + widgetData["city"] + text: qsTrId("#city") + ": " + widgetData["city"] } } @@ -268,9 +268,9 @@ Page { text: bestResultsRep.showAllResults ? //% "Show best results" - qsTrId("showBestResults"): + qsTrId("#showBestResults"): //% "Show all results" - qsTrId("showAllResults") + qsTrId("#showAllResults") onClicked: { bestResultsRep.showAllResults = !bestResultsRep.showAllResults diff --git a/resources/qml/Widgets/RankingWidget.qml b/resources/qml/Widgets/RankingWidget.qml index 5bdbc1c..a294491 100644 --- a/resources/qml/Widgets/RankingWidget.qml +++ b/resources/qml/Widgets/RankingWidget.qml @@ -28,7 +28,7 @@ DataListView { property string title: control.widgetData['comp_name'] //% "(Ranking)" - property string subTitle: qsTrId("rankingHeadline") + " after " + control.widgetData['route_name'] + property string subTitle: qsTrId("#rankingHeadline") + " after " + control.widgetData['route_name'] property bool titleIsPageTitle: true property var widgetData: currentWidgetData diff --git a/resources/qml/Widgets/RegistrationWidget.qml b/resources/qml/Widgets/RegistrationWidget.qml index 8d29df2..2c024e3 100644 --- a/resources/qml/Widgets/RegistrationWidget.qml +++ b/resources/qml/Widgets/RegistrationWidget.qml @@ -58,7 +58,7 @@ DataListView { } //% "(Registration)" - var addition = qsTrId("registrationHeadline") + var addition = qsTrId("#registrationHeadline") if(titleString !== undefined){ return addition + " " + titleString @@ -109,7 +109,7 @@ DataListView { } } - selector.appear(selectOptions, qsTrId("selectCategory")) + selector.appear(selectOptions, qsTrId("#selectCategory")) } function filterAthletes(athletes) { diff --git a/resources/qml/Widgets/ResultWidget.qml b/resources/qml/Widgets/ResultWidget.qml index 33bc4ec..7246e3c 100644 --- a/resources/qml/Widgets/ResultWidget.qml +++ b/resources/qml/Widgets/ResultWidget.qml @@ -133,7 +133,7 @@ DataListView { } } //% "(Results)" - var addition = qsTrId("resultsHeadline") + var addition = qsTrId("#resultsHeadline") if(titleString !== undefined){ return addition + " " + titleString @@ -166,7 +166,7 @@ DataListView { } } - selector.appear(selectOptions, qsTrId("selectCategory")) + selector.appear(selectOptions, qsTrId("#selectCategory")) } Connections { diff --git a/resources/qml/Widgets/StartlistWidget.qml b/resources/qml/Widgets/StartlistWidget.qml index fe1e23f..585b51b 100644 --- a/resources/qml/Widgets/StartlistWidget.qml +++ b/resources/qml/Widgets/StartlistWidget.qml @@ -53,7 +53,7 @@ DataListView { } //% "(Startlist)" - var addition = qsTrId("startlistHeadline") + var addition = qsTrId("#startlistHeadline") return addition + " " + titleString } @@ -79,7 +79,7 @@ DataListView { } } - selector.appear(selectOptions, qsTrId("startlistHeadline")) + selector.appear(selectOptions, qsTrId("#startlistHeadline")) } Connections { diff --git a/resources/qml/main.qml b/resources/qml/main.qml index 356c2d0..fb74f84 100644 --- a/resources/qml/main.qml +++ b/resources/qml/main.qml @@ -547,7 +547,8 @@ Window { font.bold: true color: "white" - text: "loading..." + //% "Loading" + text: qsTrId("#loading") + "..." } } @@ -661,28 +662,28 @@ Window { case 0: infoLevel = 2 //% "No connection to server" - errorString = qsTrId("noConnectionError") + errorString = qsTrId("#noConnectionError") break case 404: infoLevel = 2 //% "Not found" - errorString = qsTrId("notFoundError") + errorString = qsTrId("#notFoundError") break case 901: infoLevel = 1 //% "No Data" - errorString = qsTrId("noDataError") + errorString = qsTrId("#noDataError") break case 906: infoLevel = 2 //% "Invalid Request" - errorString = qsTrId("invalidRequestError") + errorString = qsTrId("#invalidRequestError") errorDescription = "Invalid Request" break default: infoLevel = 2 //% "Unexpected error" - errorString = qsTrId("unexpectedError") + " ("+errorCode+")" + errorString = qsTrId("#unexpectedError") + " ("+errorCode+")" } return([infoLevel, errorString]) diff --git a/resources/translations/de.qm b/resources/translations/de.qm new file mode 100644 index 0000000..df728ad Binary files /dev/null and b/resources/translations/de.qm differ diff --git a/resources/translations/de.ts b/resources/translations/de.ts new file mode 100644 index 0000000..7928105 --- /dev/null +++ b/resources/translations/de.ts @@ -0,0 +1,274 @@ + + + + + + + + Scan QR-Code + QR-Code scannen + + + + Place the Code in the center + Positioniere den Code in der Mitte + + + + Plase wait + Bitte warten + + + + Invalid QR-Code + Ungültiger QR-Code + + + + Share these results + Teile diese Ergebnisse + + + + Link + Link + + + + QR-Code + QR-Code + + + + Poster + Poster + + + + Purchase failed + Kauf fehlgeschlagen + + + + + Buy now for + Jetzt kaufen für + + + + This item is currently unavailable + Diese Produkt ist nicht verfügbar + + + + This is a premium feature. + Das ist eine premium Funktion. + + + + This item is currently unavailable + Diese Produkt ist nicht verfügbar + + + + Restore purchase + Kauf wiederherstellen + + + + contact support + Support kontaktieren + + + + IFSC results + IFSC Ergebnisse + + + + Dark mode + Dunkler Modus + + + + Light mode + Heller Modus + + + + About blueROCK + Über blueROCK + + + + Where are the IFSC results? + Wo sind die IFSC Ergebnisse? + + + + Unfortunately, the IFSC has restricted the access to their data and <b>is not willing to share results with blueROCK anymore</b>. Because of this, blueROCK is no longer able to access and display IFSC results.<br><br>You can find current IFSC results <a href="https://ifsc.results.info">over here</a> and on <a href="https://ifsc-climbing.org">their website</a>. + Leider hat die IFSC den Zugang zu ihren Ergebnissen eingeschränkt<b>und ist nicht mehr bereit, Ergebnisse mit blueROCK zu teilen</b>. Daher ist blueROCK nicht länger in der Lage auf IFSC Ergebnisse zuzugriefen und diese anzuzeigen.<br><br>Aktuelle IFSC Ergebnisse finden sich <a href="https://ifsc.results.info">hier</a> und auf der <a href="https://ifsc-climbing.org">IFSC Webseite</a>. + + + + This app was built using the <a href='https://qt.io'>Qt Framework</a> licensed under the <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 license</a>.<br><br>This app is open source and licensed under the <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 license</a>, the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>.<br><br>Resultservice and rankings provided by <a href='http://www.digitalROCK.de'>digital ROCK</a>. + Diese App wurde unter Verwendung des <a href='https://qt.io'>Qt Frameworks</a> unter der <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 Lizenz</a> erstellt.<br><br>Diese App ist Open-source und lizensiert unter der <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 Lizenz</a>. Der Sourcecode findet sich <a href='https://itsblue.dev/dorian/blueROCK/'>hier</a>.Die Ergebnisse und Ranglisten werden von <a href='http://www.digitalROCK.de'>digital ROCK</a> zur Verfügung gestellt. + + + + calendar + Kalender + + + + Favorites + Favoriten + + + + Select filters + Filter auswählen + + + + Infosheet + Ausschreibung + + + + Further infos + Weitere Informationen + + + + Event website + Veranstaltungswebseite + + + + Select year + Jahr auswählen + + + + Select cup + Rangliste auswählen + + + + + + Select category + Kategorie auswählen + + + + Age + Alter + + + + Year of birth + Geburtsjahr + + + + City + Stadt + + + + Show best results + Zeige die besten Ergebnisse + + + + Show all results + Zeige alle Ergebnisse + + + + (Ranking) + (Rangliste) + + + + (Registration) + (Registrierung) + + + + (Results) + (Ergebnisse) + + + + + (Startlist) + (Startliste) + + + + Loading + Laden + + + + No connection to server + Keine Verbindung zum Server + + + + Not found + Nicht gefunden + + + + No Data + Keine Daten + + + + Invalid Request + Ungültige Anfrage + + + + Unexpected error + Unerwarteter Fehler + + + + Check out the results of %1 over here: + Verfolge die Ergebnisse vom Wettkampf "%1" hier live: + + + + AndroidShareUtils + + + Share: an Error occured + + + + + Share: an Error occured +WorkingDir not valid + + + + + + + + Empty URL received + + + + + + File does not exist: %1 + + + + diff --git a/resources/translations/en.qm b/resources/translations/en.qm new file mode 100644 index 0000000..bbc25d2 Binary files /dev/null and b/resources/translations/en.qm differ diff --git a/resources/translations/en.ts b/resources/translations/en.ts new file mode 100644 index 0000000..b7e3af6 --- /dev/null +++ b/resources/translations/en.ts @@ -0,0 +1,271 @@ + + + + + + + + + Scan QR-Code + + + + + Place the Code in the center + + + + + Plase wait + + + + + Invalid QR-Code + + + + + Share these results + + + + + Link + + + + + QR-Code + + + + + Poster + + + + + Purchase failed + + + + + + Buy now for + + + + + This is a premium feature. + + + + + + This item is currently unavailable + + + + + Restore purchase + + + + + contact support + + + + + IFSC results + + + + + Dark mode + + + + + Light mode + + + + + About blueROCK + + + + + Where are the IFSC results? + + + + + Unfortunately, the IFSC has restricted the access to their data and <b>is not willing to share results with blueROCK anymore</b>. Because of this, blueROCK is no longer able to access and display IFSC results.<br><br>You can find current IFSC results <a href="https://ifsc.results.info">over here</a> and on <a href="https://ifsc-climbing.org">their website</a>. + + + + + This app was built using the <a href='https://qt.io'>Qt Framework</a> licensed under the <a href='https://www.gnu.org/licenses/lgpl-3.0.en.html'>GNU lgplV3 license</a>.<br><br>This app is open source and licensed under the <a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>GNU agplV3 license</a>, the source code can be found <a href='https://itsblue.dev/dorian/blueROCK/'>here</a>.<br><br>Resultservice and rankings provided by <a href='http://www.digitalROCK.de'>digital ROCK</a>. + + + + + calendar + + + + + Favorites + + + + + Select filters + + + + + Infosheet + + + + + Further infos + + + + + Event website + + + + + Select year + + + + + Select cup + + + + + + + Select category + + + + + Age + + + + + Year of birth + + + + + City + + + + + Show best results + + + + + Show all results + + + + + (Ranking) + + + + + (Registration) + + + + + (Results) + + + + + + (Startlist) + + + + + Loading + + + + + No connection to server + + + + + Not found + + + + + No Data + + + + + Invalid Request + + + + + Unexpected error + + + + + Check out the results of %1 over here: + + + + + AndroidShareUtils + + + Share: an Error occured + + + + + Share: an Error occured +WorkingDir not valid + + + + + + + + Empty URL received + + + + + + File does not exist: %1 + + + + diff --git a/resources/translations/translations.qrc b/resources/translations/translations.qrc new file mode 100644 index 0000000..a028120 --- /dev/null +++ b/resources/translations/translations.qrc @@ -0,0 +1,6 @@ + + + de.qm + en.qm + + diff --git a/sources/bluerockbackend.cpp b/sources/bluerockbackend.cpp index cc8f307..93a9f2b 100644 --- a/sources/bluerockbackend.cpp +++ b/sources/bluerockbackend.cpp @@ -95,7 +95,8 @@ QVariantMap BlueRockBackend::getParamsFromUrl(QString stringUrl) { } void BlueRockBackend::shareResultsAsUrl(QString url, QString compName) { - this->_shareUtils->shareText("Check out the results of " + compName + " over here:\n" + url); + //% "Check out the results of %1 over here:" + this->_shareUtils->shareText(qtTrId("#shareResultsLinkText").arg(compName) + "\n" + url); } void BlueRockBackend::shareResultsAsPoster(QString url, QString compName) { diff --git a/sources/main.cpp b/sources/main.cpp index fc04d7e..91f6832 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -34,6 +34,16 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); + // translation + QString localeName = QLocale::system().bcp47Name(); + QTranslator* translator = new QTranslator(qApp); + + // fallback to en! + if(!translator->load(":/" + localeName + ".qm")) + translator->load(":/en.qm"); + + QGuiApplication::installTranslator(translator); + QQuickStyle::setStyle("Material"); qmlRegisterType("de.itsblue.blueROCK", 1, 0, "BlueRockBackend");