From f4fa0b9793daabee798a0c0c656766979523cf9a Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 8 Jun 2025 20:39:57 +0200 Subject: [PATCH] Translations --- harbour-allradio.pro | 1 + qml/items/RadioPlayer.qml | 36 +++++++++----------- qml/pages/CountryListPage.qml | 4 +-- qml/pages/CountryStationsPage.qml | 2 +- qml/pages/FavoritesPage.qml | 14 ++++---- qml/pages/HistoryPage.qml | 6 ++-- qml/pages/SearchStationsPage.qml | 18 +++++----- qml/pages/SettingsPage.qml | 28 +++++---------- qml/pages/SleepTimerPage.qml | 2 +- qml/pages/TagListPage.qml | 4 +-- translations/harbour-allradio-sv.ts | 53 +++++++++++++++++++++++++---- 11 files changed, 97 insertions(+), 71 deletions(-) diff --git a/harbour-allradio.pro b/harbour-allradio.pro index f249379..a8dbba8 100644 --- a/harbour-allradio.pro +++ b/harbour-allradio.pro @@ -47,3 +47,4 @@ CONFIG += sailfishapp_i18n # following TRANSLATIONS line. And also do not forget to # modify the localized app name in the the .desktop file. TRANSLATIONS += translations/harbour-allradio-de.ts +TRANSLATIONS += translations/harbour-allradio-sv.ts diff --git a/qml/items/RadioPlayer.qml b/qml/items/RadioPlayer.qml index f63b78d..b9d25f3 100644 --- a/qml/items/RadioPlayer.qml +++ b/qml/items/RadioPlayer.qml @@ -281,25 +281,23 @@ MediaPlayer { } function loadRecentPlay(){ - if (playHistory.count > 0) { - if (playHistory.get(0).url_resolved) { - _favicon = playHistory.get(0).favicon - _name = playHistory.get(0).name - _cc = playHistory.get(0).countrycode - _tags = playHistory.get(0).tags - _codec = playHistory.get(0).codec//getCodec(model.codec) - _bitrate = playHistory.get(0).bitrate //getBitrate(model.bitrate) - _hls = playHistory.get(0).hls - _url_resolved = playHistory.get(0).url_resolved - _homepage = playHistory.get(0).homepage - _stationuuid = playHistory.get(0).stationuuid - _favorite = playHistory.get(0).favorite - isPlaying = false - isPaused = true - ///if (_favorite) playlistCount = Favorites.getSetting("playlistIndex",-1) - //playlistIndex = allradioSettings.value("currentFavorite",-1) - // pageStack.push("RadioPlayerPage.qml") - } + if (playHistory.get(0).url_resolved) { + _favicon = playHistory.get(0).favicon + _name = playHistory.get(0).name + _cc = playHistory.get(0).countrycode + _tags = playHistory.get(0).tags + _codec = playHistory.get(0).codec//getCodec(model.codec) + _bitrate = playHistory.get(0).bitrate //getBitrate(model.bitrate) + _hls = playHistory.get(0).hls + _url_resolved = playHistory.get(0).url_resolved + _homepage = playHistory.get(0).homepage + _stationuuid = playHistory.get(0).stationuuid + _favorite = playHistory.get(0).favorite + isPlaying = false + isPaused = true + ///if (_favorite) playlistCount = Favorites.getSetting("playlistIndex",-1) + //playlistIndex = allradioSettings.value("currentFavorite",-1) + // pageStack.push("RadioPlayerPage.qml") } } diff --git a/qml/pages/CountryListPage.qml b/qml/pages/CountryListPage.qml index 438cabc..6580ae3 100644 --- a/qml/pages/CountryListPage.qml +++ b/qml/pages/CountryListPage.qml @@ -20,12 +20,12 @@ Page { header: Column { width: parent.width - PageHeader {title: "Community Radio Browser";description: "Found "+view.count + " countries"} + PageHeader {title: "Community Radio Browser";description: qsTr("Found ")+view.count + qsTr(" countries")} SearchField { id: sfield width: parent.width - placeholderText: "Search" + placeholderText: qsTr("Search") text: "" inputMethodHints: Qt.ImhNoAutoUppercase EnterKey.iconSource: "image://theme/icon-m-enter-close" diff --git a/qml/pages/CountryStationsPage.qml b/qml/pages/CountryStationsPage.qml index c499e8b..147aa33 100644 --- a/qml/pages/CountryStationsPage.qml +++ b/qml/pages/CountryStationsPage.qml @@ -145,7 +145,7 @@ Page { ComboBox { id: searchCombo - label: "Search by:" + label: qsTr("Search by:") currentIndex: comboIndex menu: ContextMenu { MenuItem { text: qsTr("Name") } diff --git a/qml/pages/FavoritesPage.qml b/qml/pages/FavoritesPage.qml index 042b8e3..1f1f5b5 100644 --- a/qml/pages/FavoritesPage.qml +++ b/qml/pages/FavoritesPage.qml @@ -24,8 +24,8 @@ Page { width: parent.width spacing: Theme.paddingLarge PageHeader{ - title: "Favorites" - description: "Radio stations: "+view.count + title: qsTr("Favorites") + description: qsTr("Radio stations: ")+view.count } Row { @@ -43,7 +43,7 @@ Page { fontColor: down ? Theme.secondaryColor : Theme.secondaryColor iconVisible: false // icon: "image://theme/icon-m-home" //"image://theme/icon-m-video" - text: "By name" + text: qsTr("By name") onButtonClick: {showP=0.0;tab = 0;Favorites.getFavorites(favorites,"name",10000)} } TabButton { @@ -55,7 +55,7 @@ Page { fontColor: down ? Theme.secondaryColor : Theme.secondaryColor iconVisible: false // icon: "image://theme/icon-m-search" - text: "Most played" + text: qsTr("Most played") onButtonClick: {showP=0.0;tab = 1;Favorites.getFavorites(favorites,"myclickcount",10000)} } TabButton { @@ -67,7 +67,7 @@ Page { fontColor: down ? Theme.secondaryColor : Theme.secondaryColor iconVisible: false // icon: "image://theme/icon-m-favorite" - text: "Last played" + text: qsTr("Last played") onButtonClick: {showP=0.0;tab = 2;Favorites.getFavorites(favorites,"myclicktimestamp",10000);console.log("CLICK")} } } @@ -78,8 +78,8 @@ Page { ViewPlaceholder { anchors.centerIn: allRadio.center enabled: view.count == 0 - text: "Favorites" - hintText: "add favorites here" + text: qsTr("Favorites") + hintText: qsTr("add favorites here") } VerticalScrollDecorator {} diff --git a/qml/pages/HistoryPage.qml b/qml/pages/HistoryPage.qml index a838ad8..7c2afc5 100644 --- a/qml/pages/HistoryPage.qml +++ b/qml/pages/HistoryPage.qml @@ -19,12 +19,12 @@ Page { ViewPlaceholder { anchors.centerIn: allRadio.center enabled: view.count == 0 - text: "History" - hintText: "see you play history here" + text: qsTr("History") + hintText: qsTr("see you play history here") } VerticalScrollDecorator {} - header: PageHeader{title: "Play history";description: "Radio stations: "+view.count} + header: PageHeader{title: qsTr("Play history");description: qsTr("Radio stations: ")+view.count} /* onAtYEndChanged: { diff --git a/qml/pages/SearchStationsPage.qml b/qml/pages/SearchStationsPage.qml index d032fb7..e43ee46 100644 --- a/qml/pages/SearchStationsPage.qml +++ b/qml/pages/SearchStationsPage.qml @@ -48,8 +48,8 @@ Page { ViewPlaceholder { anchors.centerIn: parent enabled: view.count == 0 - text: getCountryStations.finished && view.count === 0 ? "Search" : "Please wait" - hintText: getCountryStations.finished && view.count === 0 ? "radio stations" : "getting radio stations" + text: getCountryStations.finished && view.count === 0 ? qsTr("Search") : qsTr("Please wait") + hintText: getCountryStations.finished && view.count === 0 ? qsTr("radio stations") : qsTr("getting radio stations") } VerticalScrollDecorator {} @@ -150,11 +150,11 @@ Page { ComboBox { id: searchCombo - label: "Search by:" + label: qsTr("Search by:") currentIndex: 0 menu: ContextMenu { - MenuItem { text: "Name" } - MenuItem { text: "Tag" } + MenuItem { text: qsTr("Name") } + MenuItem { text: qsTr("Tag") } } onValueChanged: { switch(currentIndex) { @@ -173,20 +173,20 @@ Page { PullDownMenu { MenuItem { - text: "Name" + text: qsTr("Name") onClicked: {getCountryStations.order = "name";if (view.count > 0) {getCountryStations.clear=true;getCountryStations.getStations()}}//;xmlModel.running = true} } MenuItem { - text: "Most likes" + text: qsTr("Most likes") onClicked: {getCountryStations.order = "votes";if (view.count > 0) {getCountryStations.clear=true;getCountryStations.getStations()}}//;xmlModel.running = true} } MenuItem { - text: "Most played" + text: qsTr("Most played") onClicked: {getCountryStations.order = "clickcount";if (view.count > 0) {getCountryStations.clear=true;getCountryStations.getStations()}}//xmlModel.running = true} } MenuItem { - text: "Trending right now" + text: qsTr("Trending right now") onClicked: {getCountryStations.order = "clicktrend";if (view.count > 0) {getCountryStations.clear=true;getCountryStations.getStations()}}//xmlModel.running = true} } } diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index d6dd1b5..834d485 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -6,12 +6,8 @@ import "../helpers/db.js" as Favorites Dialog { id: settingsDialog - // property bool aComp - // property bool aMag - // property int aR: anchorRadius Column { - //id: col1 anchors.left: parent.left anchors.right: parent.right spacing: Theme.paddingMedium @@ -23,7 +19,7 @@ Dialog { anchors.rightMargin: Theme.paddingLarge color: Theme.highlightColor font.pixelSize: Theme.fontSizeLarge - text: qsTr("App settings") + text: qsTr("Player settings") } Separator { @@ -36,27 +32,19 @@ Dialog { ComboBox { id: appStart width: parent.width - label: "Auto play" + label: qsTr("Auto play") anchors.margins: Theme.paddingLarge - description: "What to do when AllRadio2 starts" + description: qsTr("What to do when AllRadio2 starts") currentIndex: Favorites.getSetting("appStart",0) menu: ContextMenu { - MenuItem { text: "Off" } - MenuItem { text: "Last played" } - MenuItem { text: "Random favorite" } + MenuItem { text: qsTr("Off") } + MenuItem { text: qsTr("Last played") } + MenuItem { text: qsTr("Random favorite") } } } } - onAccepted: { - //console.log(" *** APPSTART: "+appStart.currentIndex) - Favorites.setSetting("appStart",appStart.currentIndex) - /* activateNumbers.checked ? showCompasNumbers = 1 : showCompasNumbers = 0 - var scron - keepSon.checked ? scron = 1 : scron = 0 - keepScreenOn = keepSon.checked - settings.setSettingSetting(aComp,aMag,aR,showCompasNumbers,scron) - anchorRadius = aR */ - } + onAccepted: Favorites.setSetting("appStart",appStart.currentIndex) + } diff --git a/qml/pages/SleepTimerPage.qml b/qml/pages/SleepTimerPage.qml index d4503af..0df10c8 100644 --- a/qml/pages/SleepTimerPage.qml +++ b/qml/pages/SleepTimerPage.qml @@ -15,7 +15,7 @@ Page { clip: true anchors.bottomMargin: mediaPlayerPanel.visibleSize VerticalScrollDecorator {} - PageHeader {title: "Sleep timer";description: ((sleepTime > 0) ? (qsTr("Remaning time: ") + (sleepTime) + qsTr(" minutes")) : qsTr("choose time: ") + minutes.value )} + PageHeader {title: qsTr("Sleep timer");description: ((sleepTime > 0) ? (qsTr("Remaning time: ") + (sleepTime) + qsTr(" minutes")) : qsTr("choose time: ") + minutes.value )} ValuePicker { id: minutes diff --git a/qml/pages/TagListPage.qml b/qml/pages/TagListPage.qml index 9b87c0c..55e7809 100644 --- a/qml/pages/TagListPage.qml +++ b/qml/pages/TagListPage.qml @@ -36,8 +36,8 @@ Page { width: parent.width PageHeader { - title: "Played tags" - description: "Found "+playedTags.count + title: qsTr("Played tags") + description: qsTr("Found ")+playedTags.count } } diff --git a/translations/harbour-allradio-sv.ts b/translations/harbour-allradio-sv.ts index 5595a3b..30e2cbf 100644 --- a/translations/harbour-allradio-sv.ts +++ b/translations/harbour-allradio-sv.ts @@ -3,10 +3,6 @@ AboutPage - - AllRadio is an internet radio station player - AllRadio är en internet radio spelare - License: GPLv2 Licens: GPLv2 @@ -1062,6 +1058,49 @@ + + CountryStationsPage + + Oh no... + + + + Please wait + + + + No radio stations!?! + + + + getting radio stations + + + + Search + Sök + + + Name + + + + Tag + + + + Most likes + + + + Most played + + + + Trending right now + + + FavoriteStations @@ -1095,7 +1134,7 @@ SettingsPage - Working on it..... + App settings @@ -1144,11 +1183,11 @@ - Searching for servers... + Connecting to: - Connecting to: + Searching servers