🚧 wip extract to translations file

This commit is contained in:
Manuel Ruwe
2022-08-18 21:46:46 +02:00
parent 57cfb58c0b
commit ac4dc23e08
29 changed files with 1216 additions and 156 deletions

View File

@@ -16,6 +16,7 @@ import {
import { useConfig } from '../../tools/state';
import { IModule } from '../ModuleTypes';
import { WeatherResponse } from './WeatherInterface';
import { t } from 'i18next';
export const WeatherModule: IModule = {
title: 'Weather',
@@ -52,75 +53,81 @@ export function WeatherIcon(props: any) {
let data: { icon: any; name: string };
switch (code) {
case 0: {
data = { icon: Sun, name: 'Clear' };
data = { icon: Sun, name: t('modules.weather.card.weatherDescriptions.clear') };
break;
}
case 1:
case 2:
case 3: {
data = { icon: Cloud, name: 'Mainly clear' };
data = { icon: Cloud, name: t('modules.weather.card.weatherDescriptions.mainlyClear') };
break;
}
case 45:
case 48: {
data = { icon: CloudFog, name: 'Fog' };
data = { icon: CloudFog, name: t('modules.weather.card.weatherDescriptions.fog') };
break;
}
case 51:
case 53:
case 55: {
data = { icon: Cloud, name: 'Drizzle' };
data = { icon: Cloud, name: t('modules.weather.card.weatherDescriptions.drizzle') };
break;
}
case 56:
case 57: {
data = { icon: Snowflake, name: 'Freezing drizzle' };
data = {
icon: Snowflake,
name: t('modules.weather.card.weatherDescriptions.freezingDrizzle'),
};
break;
}
case 61:
case 63:
case 65: {
data = { icon: CloudRain, name: 'Rain' };
data = { icon: CloudRain, name: t('modules.weather.card.weatherDescriptions.rain') };
break;
}
case 66:
case 67: {
data = { icon: CloudRain, name: 'Freezing rain' };
data = { icon: CloudRain, name: t('modules.weather.card.weatherDescriptions.freezingRain') };
break;
}
case 71:
case 73:
case 75: {
data = { icon: CloudSnow, name: 'Snow fall' };
data = { icon: CloudSnow, name: t('modules.weather.card.weatherDescriptions.snowFall') };
break;
}
case 77: {
data = { icon: CloudSnow, name: 'Snow grains' };
data = { icon: CloudSnow, name: t('modules.weather.card.weatherDescriptions.snowGrains') };
break;
}
case 80:
case 81:
case 82: {
data = { icon: CloudRain, name: 'Rain showers' };
data = { icon: CloudRain, name: t('modules.weather.card.weatherDescriptions.rainShowers') };
break;
}
case 85:
case 86: {
data = { icon: CloudSnow, name: 'Snow showers' };
data = { icon: CloudSnow, name: t('modules.weather.card.weatherDescriptions.snowShowers') };
break;
}
case 95: {
data = { icon: CloudStorm, name: 'Thunderstorm' };
data = { icon: CloudStorm, name: t('modules.weather.card.weatherDescriptions.thunderstorm') };
break;
}
case 96:
case 99: {
data = { icon: CloudStorm, name: 'Thunderstorm with hail' };
data = {
icon: CloudStorm,
name: t('modules.weather.card.weatherDescriptions.thunderstormWithHail'),
};
break;
}
default: {
data = { icon: QuestionMark, name: 'Unknown' };
data = { icon: QuestionMark, name: t('modules.weather.card.weatherDescriptions.unknown') };
}
}
return (