From fb1358cfc34701d81616073e432c783471ebd25a Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 12 Oct 2022 18:49:47 +0200 Subject: [PATCH] Localizations fixes --- Model/Applications/InvidiousAPI.swift | 5 ++--- Shared/Settings/AdvancedSettings.swift | 4 ++-- Shared/Views/PopularView.swift | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Model/Applications/InvidiousAPI.swift b/Model/Applications/InvidiousAPI.swift index 852e85ac..a2cef790 100644 --- a/Model/Applications/InvidiousAPI.swift +++ b/Model/Applications/InvidiousAPI.swift @@ -216,19 +216,18 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { guard let sidRegex = try? NSRegularExpression(pattern: sidRegex), let match = sidRegex.matches(in: cookies, range: NSRange(cookies.startIndex..., in: cookies)).first else { - presentTokenUpdateFailedAlert(nil, "Could not extract SID from received cookies: \(cookies)") + presentTokenUpdateFailedAlert(nil, String(format: "Could not extract SID from received cookies: %@".localized(), cookies)) return } let matchRange = match.range(withName: "sid") if let substringRange = Range(matchRange, in: cookies) { - print("updating invidious token") let sid = String(cookies[substringRange]) AccountsModel.setToken(self.account, sid) self.objectWillChange.send() } else { - presentTokenUpdateFailedAlert(nil, "Could not extract SID from received cookies: \(cookies)") + presentTokenUpdateFailedAlert(nil, String(format: "Could not extract SID from received cookies: %@".localized(), cookies)) } self.configure() diff --git a/Shared/Settings/AdvancedSettings.swift b/Shared/Settings/AdvancedSettings.swift index 5e91b606..f1e7c8f5 100644 --- a/Shared/Settings/AdvancedSettings.swift +++ b/Shared/Settings/AdvancedSettings.swift @@ -46,9 +46,9 @@ struct AdvancedSettings: View { #endif } label: { #if os(macOS) - let labelText = "Open logs in Finder" + let labelText = "Open logs in Finder".localized() #else - let labelText = "Share Logs..." + let labelText = "Share Logs...".localized() #endif Text(labelText) } diff --git a/Shared/Views/PopularView.swift b/Shared/Views/PopularView.swift index 3bcb4285..5dbaa965 100644 --- a/Shared/Views/PopularView.swift +++ b/Shared/Views/PopularView.swift @@ -45,7 +45,7 @@ struct PopularView: View { refreshControl.endRefreshing() } .onFailure { error in - NavigationModel.shared.presentAlert(title: "Could not refresh Trending", message: error.userMessage) + NavigationModel.shared.presentAlert(title: "Could not refresh Popular", message: error.userMessage) } } .backport