Skip to content

Commit

Permalink
chore: added weather descriptions (#925)
Browse files Browse the repository at this point in the history
* added weather descriptions to finland, germany, poland, czechia and
  france

Signed-off-by: Guru Mehar Rachaputi <[email protected]>
  • Loading branch information
00thirdeye00 authored Sep 30, 2024
1 parent 7dfcc5c commit 388e098
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/modules/weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ const std::span<const std::string_view> getWeatherDefinition(Locale locale)
{
case Locale::sv_SE:
return svSEWeatherDescriptions;
case Locale::cs_CZ:
return csCZWeatherDescriptions;
case Locale::fr_BE:
case Locale::fr_CA:
case Locale::fr_CH:
case Locale::fr_LU:
case Locale::fr_MC:
case Locale::fr_FR:
return frFRWeatherDescriptions;
case Locale::pl_PL:
return plPLWeatherDescriptions;
case Locale::de_AT:
case Locale::de_BE:
case Locale::de_LU:
case Locale::de_CH:
case Locale::de_LI:
case Locale::de_DE:
return deDEWeatherDescriptions;
case Locale::fi_FI:
return fiFIWeatherDescriptions;
default:
return enUSWeatherDescriptions;
}
Expand Down
86 changes: 86 additions & 0 deletions src/modules/weather_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,90 @@ const auto svSEWeatherDescriptions = std::to_array<std::string_view>({
"höst", // fall/autumn
});

const auto csCZWeatherDescriptions = std::to_array<std::string_view>({
"dusno",
"chladno",
"horko",
"jasno",
"mlhavo",
"oblačno",
"slunečno",
"sucho",
"teplo",
"vedro",
"vlhko",
"zamračeno",
"zima",
"příjemně",
"polojasno",
});

const auto frFRWeatherDescriptions = std::to_array<std::string_view>({
"enneigée",
"ensoleillée",
"humide",
"nuageux",
"orageux",
"sèche",
"venteuse",
"pleut",
"pleut à verse",
"du soleil",
"du vent",
"du brouillard",
"neige",
"gèle",
"grêle",
"mauvais",
});

const auto plPLWeatherDescriptions = std::to_array<std::string_view>({
"pogoda",
"słońce",
"deszcz",
"śnieg",
"wiatr",
"chmura",
"mgła",
"lód",
"burza",
"grzmot",
"piorun",
"śnieżyca",
});

const auto deDEWeatherDescriptions = std::to_array<std::string_view>({
"sonnig",
"wolkig",
"windig",
"regnerisch",
"verregnet",
"neblig",
"diesig",
"trüb",
"stürmisch",
"schnee",
"hagel",
"nebel",
});

const auto fiFIWeatherDescriptions = std::to_array<std::string_view>({
"sumu",
"sade",
"lumi",
"aurinkoinen",
"tuuli",
"jää",
"myrsky",
"pilvi",
"rankkasade",
"kostea",
"sadekuuro",
"kuura",
"rae",
"räntä",
});

}


20 changes: 20 additions & 0 deletions tests/modules/weather_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ const std::span<const std::string_view> getWeatherDefinition(Locale locale)
{
case Locale::sv_SE:
return svSEWeatherDescriptions;
case Locale::cs_CZ:
return csCZWeatherDescriptions;
case Locale::fr_BE:
case Locale::fr_CA:
case Locale::fr_CH:
case Locale::fr_LU:
case Locale::fr_MC:
case Locale::fr_FR:
return frFRWeatherDescriptions;
case Locale::pl_PL:
return plPLWeatherDescriptions;
case Locale::de_AT:
case Locale::de_BE:
case Locale::de_LU:
case Locale::de_CH:
case Locale::de_LI:
case Locale::de_DE:
return deDEWeatherDescriptions;
case Locale::fi_FI:
return fiFIWeatherDescriptions;
default:
return enUSWeatherDescriptions;
}
Expand Down

0 comments on commit 388e098

Please sign in to comment.