fix: use IMGW Hybrid for current weather
This commit is contained in:
@@ -10,6 +10,7 @@ import type {
|
||||
} from "@/types/imgw";
|
||||
import { translate, type Language } from "@/lib/i18n";
|
||||
import { getProvinceFromTeryt, normalizeProvinceName } from "@/lib/provinces";
|
||||
import type { CurrentWeatherCondition } from "@/types/imgw-current";
|
||||
|
||||
const locales: Record<Language, string> = { pl: "pl-PL", en: "en-GB" };
|
||||
|
||||
@@ -174,7 +175,10 @@ export function getWeatherMoodFromData(station: SynopStation, date = new Date())
|
||||
return "mild";
|
||||
}
|
||||
|
||||
export function getWeatherDescription(station: SynopStation, language: Language = "pl") {
|
||||
export function getWeatherDescription(station: SynopStation, language: Language = "pl", condition?: CurrentWeatherCondition) {
|
||||
if (condition === "thunderstorm") return translate(language, "weather.thunderstorm");
|
||||
if (condition === "snow") return translate(language, "weather.currentSnow");
|
||||
if (condition === "rain") return translate(language, "weather.currentRain");
|
||||
if ((station.windSpeed ?? 0) >= 8) return translate(language, "weather.strongWind");
|
||||
if ((station.humidity ?? 0) >= 90) return translate(language, "weather.humid");
|
||||
return translate(language, "weather.calm");
|
||||
|
||||
Reference in New Issue
Block a user