From 6c5057c5092360bf100cc698a43fd050f1360b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pauli=20J=C3=A4rvinen?= Date: Sat, 16 Mar 2024 20:21:16 +0200 Subject: [PATCH] Fix some error messages being shown as untranslated The translations for these strings were not being shown even when they had been translated. The problem was the trailing space character which had got dropped by the translation tools. Hence, the translation key in translations.js didn't match exactly the one given to gettextCatalog.getString(). --- js/app/controllers/maincontroller.js | 4 ++-- js/app/controllers/views/radioviewcontroller.js | 4 ++-- js/app/controllers/views/settingsviewcontroller.js | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/app/controllers/maincontroller.js b/js/app/controllers/maincontroller.js index e0f8d2ca9..485e0ecd5 100644 --- a/js/app/controllers/maincontroller.js +++ b/js/app/controllers/maincontroller.js @@ -185,8 +185,8 @@ function ($rootScope, $scope, $timeout, $window, ArtistFactory, reason = response.status; break; } - OC.Notification.showTemporary( - gettextCatalog.getString('Failed to load the collection: ') + reason); + const errMsg = gettextCatalog.getString('Failed to load the collection:'); + OC.Notification.showTemporary(errMsg + ' ' + reason); }); }; diff --git a/js/app/controllers/views/radioviewcontroller.js b/js/app/controllers/views/radioviewcontroller.js index d421d698a..4e422eacf 100644 --- a/js/app/controllers/views/radioviewcontroller.js +++ b/js/app/controllers/views/radioviewcontroller.js @@ -69,8 +69,8 @@ angular.module('Music').controller('RadioViewController', [ }, function (error) { station.busy = false; - OC.Notification.showTemporary( - gettextCatalog.getString('Failed to delete the radio station: ') + error.status); + const errMsg = gettextCatalog.getString('Failed to delete the radio station:'); + OC.Notification.showTemporary(errMsg + ' ' + error.status); } ); } diff --git a/js/app/controllers/views/settingsviewcontroller.js b/js/app/controllers/views/settingsviewcontroller.js index 56c41f10f..e7c8bb5bb 100644 --- a/js/app/controllers/views/settingsviewcontroller.js +++ b/js/app/controllers/views/settingsviewcontroller.js @@ -170,8 +170,8 @@ angular.module('Music').controller('SettingsViewController', [ }, function(error) { // error handling $scope.collectionResetOngoing = false; - OC.Notification.showTemporary( - gettextCatalog.getString('Failed to reset the collection: ') + error.status); + const errMsg = gettextCatalog.getString('Failed to reset the collection:'); + OC.Notification.showTemporary(errMsg + ' ' + error.status); } ); }; @@ -208,8 +208,8 @@ angular.module('Music').controller('SettingsViewController', [ }, function(error) { // error handling $scope.radioResetOngoing = false; - OC.Notification.showTemporary( - gettextCatalog.getString('Failed to reset the radio stations: ') + error.status); + const errMsg = gettextCatalog.getString('Failed to reset the radio stations:'); + OC.Notification.showTemporary(errMsg + ' ' + error.status); } ); } @@ -238,8 +238,8 @@ angular.module('Music').controller('SettingsViewController', [ }, function(error) { // error handling $scope.podcastsResetOngoing = false; - OC.Notification.showTemporary( - gettextCatalog.getString('Failed to reset the podcast channels: ') + error.status); + const errMsg = gettextCatalog.getString('Failed to reset the podcast channels:'); + OC.Notification.showTemporary(errMsg + ' ' + error.status); } ); }