mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Localizations fixes
This commit is contained in:
parent
ba9460483f
commit
fb1358cfc3
@ -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()
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user