mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
fix yandex wheather, for correct lang
This commit is contained in:
parent
466c0e5f68
commit
e9e5a6f739
@ -88,9 +88,9 @@ class YandexWeatherBarItem: CustomButtonTouchBarItem, CLLocationManagerDelegate
|
||||
|
||||
func getWeatherUrl() -> String {
|
||||
if location != nil {
|
||||
return "https://yandex.ru/pogoda/?lat=\(location.coordinate.latitude)&lon=\(location.coordinate.longitude)"
|
||||
return "https://yandex.ru/pogoda/?lat=\(location.coordinate.latitude)&lon=\(location.coordinate.longitude)?lang=ru"
|
||||
} else {
|
||||
return "https://yandex.ru/pogoda/" // Yandex will try to determine your location by default
|
||||
return "https://yandex.ru/pogoda/?lang=ru" // Yandex will try to determine your location by default
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ extension String {
|
||||
let nsString = self as NSString
|
||||
let results = regex.matches(in: self, options: [], range: NSMakeRange(0, nsString.length))
|
||||
return results.map { result in
|
||||
(0..<result.numberOfRanges).map {
|
||||
(0 ..< result.numberOfRanges).map {
|
||||
result.range(at: $0).location != NSNotFound
|
||||
? nsString.substring(with: result.range(at: $0))
|
||||
: ""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user