Skip to content

Commit

Permalink
add slovenian names (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal authored Nov 18, 2023
1 parent cd5d203 commit 70cde2a
Show file tree
Hide file tree
Showing 6 changed files with 802 additions and 17 deletions.
29 changes: 15 additions & 14 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,29 @@ enum class Country
Hungary,
Croatia,
Greece,
Slovenia,
};

const std::vector<Country> countries{
Country::Usa, Country::England, Country::Poland, Country::Italy, Country::France,
Country::Germany, Country::Russia, Country::Romania, Country::India, Country::Finland,
Country::Nepal, Country::Spain, Country::Turkey, Country::Czech, Country::Slovakia,
Country::Ukraine, Country::Denmark, Country::Sweden, Country::Brazil, Country::Norway,
Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia, Country::Greece,
Country::Usa, Country::England, Country::Poland, Country::Italy, Country::France, Country::Germany,
Country::Russia, Country::Romania, Country::India, Country::Finland, Country::Nepal, Country::Spain,
Country::Turkey, Country::Czech, Country::Slovakia, Country::Ukraine, Country::Denmark, Country::Sweden,
Country::Brazil, Country::Norway, Country::Japan, Country::Portugal, Country::Hungary, Country::Croatia,
Country::Greece, Country::Slovenia,
};

inline std::string toString(Country country)
{
std::map<Country, std::string> countryToStringMapping{
{Country::Usa, "Usa"}, {Country::England, "England"}, {Country::Poland, "Poland"},
{Country::Italy, "Italy"}, {Country::France, "France"}, {Country::Germany, "Germany"},
{Country::Russia, "Russia"}, {Country::Romania, "Romania"}, {Country::India, "India"},
{Country::Finland, "Finland"}, {Country::Nepal, "Nepal"}, {Country::Spain, "Spain"},
{Country::Turkey, "Turkey"}, {Country::Czech, "Czech"}, {Country::Slovakia, "Slovakia"},
{Country::Ukraine, "Ukraine"}, {Country::Denmark, "Denmark"}, {Country::Sweden, "Sweden"},
{Country::Brazil, "Brazil"}, {Country::Norway, "Norway"}, {Country::Japan, "Japan"},
{Country::Portugal, "Portugal"}, {Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"},
{Country::Greece, "Greece"},
{Country::Usa, "Usa"}, {Country::England, "England"}, {Country::Poland, "Poland"},
{Country::Italy, "Italy"}, {Country::France, "France"}, {Country::Germany, "Germany"},
{Country::Russia, "Russia"}, {Country::Romania, "Romania"}, {Country::India, "India"},
{Country::Finland, "Finland"}, {Country::Nepal, "Nepal"}, {Country::Spain, "Spain"},
{Country::Turkey, "Turkey"}, {Country::Czech, "Czech"}, {Country::Slovakia, "Slovakia"},
{Country::Ukraine, "Ukraine"}, {Country::Denmark, "Denmark"}, {Country::Sweden, "Sweden"},
{Country::Brazil, "Brazil"}, {Country::Norway, "Norway"}, {Country::Japan, "Japan"},
{Country::Portugal, "Portugal"}, {Country::Hungary, "Hungary"}, {Country::Croatia, "Croatia"},
{Country::Greece, "Greece"}, {Country::Slovenia, "Slovenia"},
};

return countryToStringMapping.at(country);
Expand Down
3 changes: 2 additions & 1 deletion src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "data/romania/RomanianPeopleNames.h"
#include "data/russia/RussianPeopleNames.h"
#include "data/slovakia/SlovakPeopleNames.h"
#include "data/slovenia/SlovenianPeopleNames.h"
#include "data/spain/SpanishPeopleNames.h"
#include "data/sweden/SwedishPeopleNames.h"
#include "data/turkey/TurkishPeopleNames.h"
Expand Down Expand Up @@ -58,7 +59,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
5 changes: 3 additions & 2 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "data/romania/RomanianPeopleNames.h"
#include "data/russia/RussianPeopleNames.h"
#include "data/slovakia/SlovakPeopleNames.h"
#include "data/slovenia/SlovenianPeopleNames.h"
#include "data/spain/SpanishPeopleNames.h"
#include "data/sweden/SwedishPeopleNames.h"
#include "data/turkey/TurkishPeopleNames.h"
Expand Down Expand Up @@ -58,7 +59,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Brazil, brazilianPeopleNames}, {Country::Norway, norwegianPeopleNames},
{Country::Japan, japanesePeopleNames}, {Country::Portugal, portuguesePeopleNames},
{Country::Hungary, hungarianPeopleNames}, {Country::Croatia, croatianPeopleNames},
{Country::Greece, greekPeopleNames},
{Country::Greece, greekPeopleNames}, {Country::Slovenia, slovenianPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand All @@ -74,7 +75,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Brazil, "shouldGenerateBrazilianName"}, {Country::Norway, "shouldGenerateNorwegianName"},
{Country::Japan, "shouldGenerateJapaneseName"}, {Country::Portugal, "shouldGeneratePortugueseName"},
{Country::Hungary, "shouldGenerateHungarianName"}, {Country::Croatia, "shouldGenerateCroatianName"},
{Country::Greece, "shouldGenerateGreekName"},
{Country::Greece, "shouldGenerateGreekName"}, {Country::Slovenia, "shouldGenerateSlovenianName"},
};
}

Expand Down
Loading

0 comments on commit 70cde2a

Please sign in to comment.