fix: stop treating rainfall total as current rain
This commit is contained in:
12
lib/i18n.tsx
12
lib/i18n.tsx
@@ -61,7 +61,7 @@ const translations = {
|
||||
"favorites.remove": "Usuń z ulubionych",
|
||||
"weather.humidity": "Wilgotność",
|
||||
"weather.wind": "Wiatr",
|
||||
"weather.rainfall": "Opad",
|
||||
"weather.rainfall": "Suma opadu",
|
||||
"weather.pressure": "Ciśnienie",
|
||||
"weather.feelsLike": "Odczuwalna",
|
||||
"weather.measurement": "pomiar",
|
||||
@@ -69,8 +69,6 @@ const translations = {
|
||||
"weather.calm": "Spokojne warunki",
|
||||
"weather.humid": "Wilgotno",
|
||||
"weather.strongWind": "Silny wiatr",
|
||||
"weather.rain": "Opady",
|
||||
"weather.heavyRain": "Wyraźne opady",
|
||||
"weather.airTemperature": "Temperatura",
|
||||
"weather.windSpeed": "Prędkość wiatru",
|
||||
"weather.rainfallTotal": "Suma opadu",
|
||||
@@ -79,7 +77,7 @@ const translations = {
|
||||
"weather.pressureDetail": "Ciśnienie atmosferyczne",
|
||||
"weather.windSpeedDetail": "Bieżący odczyt IMGW",
|
||||
"weather.windDirectionDetail": "Kierunek napływu wiatru",
|
||||
"weather.rainfallDetail": "Suma opadu z pomiaru IMGW",
|
||||
"weather.rainfallDetail": "Akumulowana suma opadu z pomiaru IMGW. Nie oznacza, że pada w tej chwili.",
|
||||
"weather.temperatureDetail": "Temperatura powietrza",
|
||||
"forecast.label": "Prognoza modelowa",
|
||||
"forecast.title": "Najbliższe godziny i dni",
|
||||
@@ -205,7 +203,7 @@ const translations = {
|
||||
"favorites.remove": "Remove from favourites",
|
||||
"weather.humidity": "Humidity",
|
||||
"weather.wind": "Wind",
|
||||
"weather.rainfall": "Rainfall",
|
||||
"weather.rainfall": "Rainfall total",
|
||||
"weather.pressure": "Pressure",
|
||||
"weather.feelsLike": "Feels like",
|
||||
"weather.measurement": "measurement",
|
||||
@@ -213,8 +211,6 @@ const translations = {
|
||||
"weather.calm": "Calm conditions",
|
||||
"weather.humid": "Humid",
|
||||
"weather.strongWind": "Strong wind",
|
||||
"weather.rain": "Rainfall",
|
||||
"weather.heavyRain": "Heavy rainfall",
|
||||
"weather.airTemperature": "Temperature",
|
||||
"weather.windSpeed": "Wind speed",
|
||||
"weather.rainfallTotal": "Rainfall total",
|
||||
@@ -223,7 +219,7 @@ const translations = {
|
||||
"weather.pressureDetail": "Atmospheric pressure",
|
||||
"weather.windSpeedDetail": "Current IMGW reading",
|
||||
"weather.windDirectionDetail": "Direction the wind is coming from",
|
||||
"weather.rainfallDetail": "Total rainfall from the IMGW reading",
|
||||
"weather.rainfallDetail": "Accumulated rainfall total from the IMGW reading. It does not mean that it is raining right now.",
|
||||
"weather.temperatureDetail": "Air temperature",
|
||||
"forecast.label": "Model forecast",
|
||||
"forecast.title": "Upcoming hours and days",
|
||||
|
||||
@@ -160,7 +160,6 @@ export function getWindDirection(degrees: number) {
|
||||
|
||||
export function getWeatherMoodFromData(station: SynopStation, date = new Date()): WeatherMood {
|
||||
const hour = date.getHours();
|
||||
if ((station.rainfall ?? 0) >= 0.1) return "rain";
|
||||
if (hour < 6 || hour >= 21) return "night";
|
||||
if ((station.windSpeed ?? 0) >= 8) return "wind";
|
||||
if ((station.temperature ?? 15) <= 3) return "cold";
|
||||
@@ -170,8 +169,6 @@ export function getWeatherMoodFromData(station: SynopStation, date = new Date())
|
||||
}
|
||||
|
||||
export function getWeatherDescription(station: SynopStation, language: Language = "pl") {
|
||||
if ((station.rainfall ?? 0) >= 5) return translate(language, "weather.heavyRain");
|
||||
if ((station.rainfall ?? 0) >= 0.1) return translate(language, "weather.rain");
|
||||
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");
|
||||
@@ -181,7 +178,6 @@ export function moodGradient(mood: WeatherMood) {
|
||||
return {
|
||||
warm: "from-sky-400 via-blue-500 to-indigo-700",
|
||||
cloudy: "from-slate-600 via-slate-700 to-slate-900",
|
||||
rain: "from-slate-600 via-blue-900 to-slate-950",
|
||||
wind: "from-cyan-600 via-slate-600 to-blue-950",
|
||||
cold: "from-cyan-300 via-blue-500 to-indigo-900",
|
||||
night: "from-slate-800 via-indigo-950 to-slate-950",
|
||||
|
||||
Reference in New Issue
Block a user