FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix non-localized company suffixes in CH and it locales by huerlisi · Pull Request #3271 · faker-ruby/faker · GitHub

Fix non-localized company suffixes in CH and it locales - #3271

Open
huerlisi wants to merge 1 commit into
faker-ruby:mainfrom
huerlisi:locale-ch-company-suffixes
Open

Fix non-localized company suffixes in CH and it locales#3271
huerlisi wants to merge 1 commit into
faker-ruby:mainfrom
huerlisi:locale-ch-company-suffixes

Conversation

huerlisi commented Jun 8, 2026

Copy link
Copy Markdown

Motivation / Background

Faker::Company.name produced anglophone legal forms that do not exist in
these locales:

Faker::Config.locale = 'de-CH'
Faker::Company.name  #=> "Klimczak LLC"

Faker::Config.locale = 'fr-CH'
Faker::Company.name  #=> "Adam LLC"

Faker::Config.locale = 'it'
Faker::Company.name  #=> "Russo-Russo Group"

LLC and Inc. are US forms and are not used in Switzerland; Group is
English. This Pull Request fixes the company suffix lists:

  • de-CH: drop the English LLC and Inc. suffixes.
  • fr-CH: drop LLC/Inc. and add the Swiss-French forms SA and Sàrl.
  • it: replace English Group with the Italian Gruppo.

Additional information

Output after the change:

Faker::Config.locale = 'de-CH'
Faker::Company.name  #=> "Slotta AG"

Faker::Config.locale = 'fr-CH'
Faker::Company.name  #=> "Dumas, Bénoit et Duval"   # also: "Morin SA", "Brun Sàrl"

Faker::Config.locale = 'it'
Faker::Company.name  #=> "Monti, Cattaneo e Costantin Gruppo"

Tests assert the English forms are gone (and the localized forms present)
so the lists don't regress.

Checklist

  • This Pull Request is related to one change.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • Tests and Rubocop are passing before submitting your proposed changes.

`Faker::Company.name` produced anglophone legal forms that do not exist
in these locales, e.g. "Klimczak LLC" (de-CH), "Adam LLC" (fr-CH) and
"Russo Group" (it).

- de-CH: drop the English `LLC` and `Inc.` suffixes.
- fr-CH: drop `LLC`/`Inc.` and add the Swiss-French forms `SA` and `Sàrl`.
- it: replace English `Group` with the Italian `Gruppo`.

Add tests asserting the English forms are gone (and the localized forms
present) so the lists don't regress.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

huerlisi commented Jun 8, 2026

Copy link
Copy Markdown
Author

I used Claude Code to create this MR and it included very specific unit tests. I don't see too much value in those but they don't hurt.

Should I drop them, or what is best practice in this repo around unit tests?

huerlisi commented Jun 8, 2026

Copy link
Copy Markdown
Author

Related but not directly part of this MR: I understand that the project has a "freeze" on new locales. For Switzerland there's currently DE and FR locales available, but no for the IT speaking part. As Swiss that feels as kind of a bug:-)

Would you accept a contribution that introduces an it-CH locale?

thdaraujo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would you accept a contribution that introduces an it-CH locale?

I think that would be okay, as long as it's a short addition. Thanks!

Comment thread test/test_de_ch_locale.rb
Comment on lines +26 to +31
def test_de_ch_company_suffix_has_no_english_forms
suffixes = I18n.translate('faker.company.suffix', locale: :'de-CH')

assert_not_includes suffixes, 'LLC'
assert_not_includes suffixes, 'Inc.'
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

no need for this test, we should assume the locales are correct or fix them when they're not, which is what this PR is already doing.

Suggested change
def test_de_ch_company_suffix_has_no_english_forms
suffixes = I18n.translate('faker.company.suffix', locale: :'de-CH')
assert_not_includes suffixes, 'LLC'
assert_not_includes suffixes, 'Inc.'
end

Comment thread test/test_fr_ch_locale.rb
Comment on lines +47 to +54
def test_fr_ch_company_suffix_uses_swiss_forms
suffixes = I18n.translate('faker.company.suffix', locale: :'fr-CH')

assert_includes suffixes, 'SA'
assert_includes suffixes, 'Sàrl'
assert_not_includes suffixes, 'LLC'
assert_not_includes suffixes, 'Inc.'
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

let's avoid testing locale contents

Comment thread test/test_it_locale.rb

assert_includes suffixes, 'Gruppo'
assert_not_includes suffixes, 'Group'
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

same comment here

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL