Skip to content

Commit

Permalink
Add people names from Maldives 🇲🇻 (#508)
Browse files Browse the repository at this point in the history
* Add people names from Maldives

* run format scripts
  • Loading branch information
joshhn authored Feb 9, 2024
1 parent ca08a8b commit e20facc
Show file tree
Hide file tree
Showing 12 changed files with 547 additions and 62 deletions.
103 changes: 51 additions & 52 deletions include/faker-cxx/Book.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,60 +62,59 @@ class Book
*/
static std::string isbn();

/**
* @brief Returns a random release year
*
* @returns int year
*
* @code
* Book::releaseYear() // 2016
* @endcode
*/
static int releaseYear();
/**
* @brief Returns a random release year
*
* @returns int year
*
* @code
* Book::releaseYear() // 2016
* @endcode
*/
static int releaseYear();

/**
* @brief Returns the full name of a translator
*
* @returns std::string full name
*
* @code
* Book::translator() // "Eric Floyd"
* @endcode
*/
static std::string translator();
/**
* @brief Returns format of book
*
* @returns BookFormat format of book
*
* @code
* Book::format() // BookFormat::paperback
* @endcode
*/
static std::string format();
/**
* @brief Returns the full name of a translator
*
* @returns std::string full name
*
* @code
* Book::translator() // "Eric Floyd"
* @endcode
*/
static std::string translator();

/**
* @brief Returns format of book
*
* @returns BookFormat format of book
*
* @code
* Book::format() // BookFormat::paperback
* @endcode
*/
static std::string format();

/*
* @brief returns a random page number (50-999)
*
* @returns int page number
*
* @code
* Book::page() // 314
* @endcode
*/
static int page();
/*
* @brief returns a random page number (50-999)
*
* @returns int page number
*
* @code
* Book::page() // 314
* @endcode
*/
static int page();

/*
* @brief returns a random book series
*
* @returns std::string book series
*
* @code
* Book::series() // "Harry Potter"
* @endcode
*/
static std::string series();
/*
* @brief returns a random book series
*
* @returns std::string book series
*
* @code
* Book::series() // "Harry Potter"
* @endcode
*/
static std::string series();
};
}

4 changes: 2 additions & 2 deletions include/faker-cxx/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class Color
* @endcode
*/
static std::string hsv();
/**

/**
* @brief Return a YUV color
*
* @returns YUV color formatted with yuv(X,X,X)
Expand Down
7 changes: 3 additions & 4 deletions include/faker-cxx/Commerce.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Commerce
* @endcode
*/
static std::string productReview();

/**
* @brief Returns a random product rating (0-5).
*
Expand All @@ -217,7 +217,7 @@ class Commerce
* @endcode
*/
static std::string discountType();

/**
* @brief Returns random discount code within the specified range of 6 to 12 characters.
*
Expand All @@ -241,7 +241,7 @@ class Commerce
static double discountAmount();

/**
* @brief Returns a random discount percentage within the specified range of 1. to 90.
* @brief Returns a random discount percentage within the specified range of 1. to 90.
*
* @returns discountPercentage.
*
Expand All @@ -250,6 +250,5 @@ class Commerce
* @endcode
*/
static double discountPercentage();

};
}
3 changes: 1 addition & 2 deletions include/faker-cxx/Git.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Git
*/
static std::string commitSha(unsigned length = 40);


/**
* @brief Returns a random author name and email.
*
Expand All @@ -96,6 +95,6 @@ class Git
* Git::author // {Author.name = "Rachel McLaughlin", Author.email = "[email protected]"}
* @endcode
*/
static Author author();
static Author author();
};
}
3 changes: 3 additions & 0 deletions include/faker-cxx/types/Country.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ enum class Country
Azerbaijan,
Ghana,
Kazakhstan,
Maldives,
};

const std::vector<Country> countries{
Expand All @@ -84,6 +85,7 @@ const std::vector<Country> countries{
Country::Moldova, Country::Lithuania, Country::Iceland, Country::Palestine, Country::Israel,
Country::Vietnam, Country::Monaco, Country::Bosnia, Country::Lebanon, Country::Syria,
Country::Malta, Country::SouthAfrica, Country::Azerbaijan, Country::Ghana, Country::Kazakhstan,
Country::Maldives,
};

inline std::string toString(Country country)
Expand Down Expand Up @@ -149,6 +151,7 @@ inline std::string toString(Country country)
{Country::Azerbaijan, "Azerbaijan"},
{Country::Ghana, "Ghana"},
{Country::Kazakhstan, "Kazakhstan"},
{Country::Maldives, "Maldives"},
};

return countryToStringMapping.at(country);
Expand Down
4 changes: 2 additions & 2 deletions src/common/FormatHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <string>
#include <vector>

#if defined(__APPLE__) || defined(__MINGW32__) || (defined(__GNUC__) && (__GNUC__ < 12) && !defined(__clang__))
#if defined(__APPLE__) || defined(__MINGW32__) || (defined(__GNUC__) && (__GNUC__ < 12) && !defined(__clang__))
#include <fmt/format.h>
#else
#include <format>
Expand All @@ -16,7 +16,7 @@ namespace faker
class FormatHelper
{
public:
#if defined(__APPLE__) || defined(__MINGW32__) || (defined(__GNUC__) && (__GNUC__ < 12) && !defined(__clang__))
#if defined(__APPLE__) || defined(__MINGW32__) || (defined(__GNUC__) && (__GNUC__ < 12) && !defined(__clang__))
template <typename... Args>
static std::string format(fmt::format_string<Args...> fmt, Args&&... args)
{
Expand Down
2 changes: 2 additions & 0 deletions src/modules/person/Person.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "data/spain/SpanishPeopleNames.h"
#include "data/SsnFormats.h"
#include "data/sweden/SwedishPeopleNames.h"
#include "data/maldives/MaldiviansPeopleNames.h"
#include "data/switzerland/SwissPeopleNames.h"
#include "data/syria/SyrianPeopleNames.h"
#include "data/turkey/TurkishPeopleNames.h"
Expand Down Expand Up @@ -143,6 +144,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Azerbaijan, azerbaijaniPeopleNames},
{Country::Ghana, ghanaianPeopleNames},
{Country::Kazakhstan, kazakhPeopleNames},
{Country::Maldives, maldiviansPeopleNames},
};

std::string middleNameForCountry(Country country, std::optional<Sex> sex);
Expand Down
3 changes: 3 additions & 0 deletions src/modules/person/PersonTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "data/switzerland/SwissPeopleNames.h"
#include "data/syria/SyrianPeopleNames.h"
#include "data/turkey/TurkishPeopleNames.h"
#include "data/maldives/MaldiviansPeopleNames.h"
#include "data/ukraine/UkrainianPeopleNames.h"
#include "data/vietnam/VietnamesePeopleNames.h"
#include "data/ZodiacSigns.h"
Expand Down Expand Up @@ -141,6 +142,7 @@ const std::map<Country, PeopleNames> countryToPeopleNamesMapping{
{Country::Azerbaijan, azerbaijaniPeopleNames},
{Country::Ghana, ghanaianPeopleNames},
{Country::Kazakhstan, kazakhPeopleNames},
{Country::Maldives, maldiviansPeopleNames},
};

const std::map<Country, std::string> generatedTestName{
Expand Down Expand Up @@ -204,6 +206,7 @@ const std::map<Country, std::string> generatedTestName{
{Country::Azerbaijan, "shouldGenerateAzerbaijaniName"},
{Country::Ghana, "shouldGenerateGhanaianName"},
{Country::Kazakhstan, "shouldGenerateKazakhName"},
{Country::Maldives, "shouldGenerateMaldivianName"},
};
}

Expand Down
76 changes: 76 additions & 0 deletions src/modules/person/data/maldives/MaldiviansFirstNames.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#pragma once

#include <string>
#include <vector>

namespace faker
{
const std::vector<std::string> maldiviansMalesFirstNames = {
"އާދަމް",
"އިބްރާހީމް",
"އިލްޔާސް",
"އިސްމާޢީލް",
"ޢީސާ",
"އަބޫބަކްރު",
"އަލީ",
"އުސާމާ",
"ދާއޫދު",
"ޢަޠާ",
"ޤުދާސް",
"މުޙައްމަދު",
"މޫސާ",
"ޔޫސުފް",
};

const std::vector<std::string> maldiviansFemalesFirstNames = {
"ރަމްލާ",
"ހިންދު",
"ޙަފްޞާ",
"ޚަދީޖާ",
"ޒައިނަބު",
"ޞަފިއްޔާ",
"ޢާއިޝާ",
"މައިމޫނާ",
"ޖުވައިރިއްޔާ",
"ސައުދާ",
"މާރިޔާ",
"ރުޤައްޔާ",
"ފާޠިމާ",
"އުއްމުކުލްޘޫމޮ",
"ޙައްވާ",
"ސާރާ",
"ހާޖަރު",
"މަރްޔަމޮ",
"ޒުލައިޚާ",
"އާސިޔާ",
"ބަލްޤީސް",
"އާމިނަތު",
"އަސްމާއު",
"އުމާމާ",
"ބަރްކާ",
"ޖަމީލާ",
"ޙަސްނާއު",
"ޙަލީމާ",
"ޚަވްލާ",
"ޚައިރާ",
"ރުމައިޞާއު",
"ރުފައިދާ",
"ރަޤީޤާ",
"ސަޢާދު",
"ސަލްމާ",
"ސުލައިމް",
"ސުމައްޔާ",
"ޝަހީދާ",
"ޝިފާ",
"ޢާތިކާ",
"ޤައިލާ",
"ލަޔާލީ",
"ކުލްޘޫމް",
"މުސްލިމާ",
"ނަސީބާ",
"ނަފީސާ",
"ނަވާރު",
"ހާނީ",
"ހުނައިދާ"
};
}
Loading

0 comments on commit e20facc

Please sign in to comment.