Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

middleName consistency #1191

Closed
JustBlackBird opened this issue Apr 17, 2017 · 2 comments
Closed

middleName consistency #1191

JustBlackBird opened this issue Apr 17, 2017 · 2 comments

Comments

@JustBlackBird
Copy link
Contributor

JustBlackBird commented Apr 17, 2017

At the moment different providers expose middle names in different ways.

For example, person provider for ru_RU locale exposes middle names with two methods: middleNameMale and middleNameFemale. At the same time, person provider for vi_VN locale exposes middle names as a single middleName method.

I suggest to use only one way of exposing middle names. To be compatible with lastName and firstName it should be done as in vi_VN locale with a single method middleName with $gender flag.

If the maintainer is interested in it I could provide a PR to fix this.

@fzaninotto
Copy link
Owner

I don't mind inconsistencies in middleNames.

@JustBlackBird
Copy link
Contributor Author

JustBlackBird commented May 2, 2017

Consider an use case when the lib is used to generate test data for multilingual system. If I use both ru_RU and vi_VN locales for testing I have to vary method name to get middle name. For example:

$faker = \Faker\Factory::create('ru_RU');
$faker->firstName(\Faker\Provider::GENDER_MALE);
$faker->middleNameMale(); // There is no "middleName" method with "gender" argument :(

but

$faker = \Faker\Factory::create('vi_VN');
$faker->firstName(\Faker\Provider::GENDER_MALE);
$faker->middleName(\Faker\Provider::GENDER_MALE);

You may notice that retrieving of middle names is inconsistent across locales.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants