Localizations fixes

This commit is contained in:
Arkadiusz Fal 2022-10-12 18:49:47 +02:00
parent ba9460483f
commit fb1358cfc3
3 changed files with 5 additions and 6 deletions

View File

@ -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()

View File

@ -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)
}

View File

@ -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