1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

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), guard let sidRegex = try? NSRegularExpression(pattern: sidRegex),
let match = sidRegex.matches(in: cookies, range: NSRange(cookies.startIndex..., in: cookies)).first let match = sidRegex.matches(in: cookies, range: NSRange(cookies.startIndex..., in: cookies)).first
else { 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 return
} }
let matchRange = match.range(withName: "sid") let matchRange = match.range(withName: "sid")
if let substringRange = Range(matchRange, in: cookies) { if let substringRange = Range(matchRange, in: cookies) {
print("updating invidious token")
let sid = String(cookies[substringRange]) let sid = String(cookies[substringRange])
AccountsModel.setToken(self.account, sid) AccountsModel.setToken(self.account, sid)
self.objectWillChange.send() self.objectWillChange.send()
} else { } 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() self.configure()

View File

@ -46,9 +46,9 @@ struct AdvancedSettings: View {
#endif #endif
} label: { } label: {
#if os(macOS) #if os(macOS)
let labelText = "Open logs in Finder" let labelText = "Open logs in Finder".localized()
#else #else
let labelText = "Share Logs..." let labelText = "Share Logs...".localized()
#endif #endif
Text(labelText) Text(labelText)
} }

View File

@ -45,7 +45,7 @@ struct PopularView: View {
refreshControl.endRefreshing() refreshControl.endRefreshing()
} }
.onFailure { error in .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 .backport