Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR locale "name" broken #2783

Closed
ojsdude opened this issue Jun 19, 2023 · 2 comments · Fixed by #2800
Closed

FR locale "name" broken #2783

ojsdude opened this issue Jun 19, 2023 · 2 comments · Fixed by #2800

Comments

@ojsdude
Copy link

ojsdude commented Jun 19, 2023

Describe the bug

When using the fr locale; the Faker::Name.name method sometimes errors with:

no implicit conversion of nil into String (TypeError)

I believe this is due to the prefix being nil and sometimes name will choose the prefix version (#{prefix} #{first_name} #{last_name})

To Reproduce

10 times calling .name works pretty consistently
Use the reproduction script below to reproduce the issue:

require "faker"
10.times do
  I18n.with_locale :fr do
    Faker::Name.name
  end
end

Expected behavior

Either prefix is available; or the two options including a prefix (name and middle) are removed from https://github.com/faker-ruby/faker/blob/main/lib/locales/fr/name.yml

@sudeeptarlekar
Copy link
Contributor

Which version of Faker are you using? I tested this on 3.2.0 but could not reproduce the bug.

@thdaraujo
Copy link
Contributor

I could not reproduce the bug either on Faker 3.2. But we could probably add prefixes to the fr locale, please take a look at #2800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants