Fix non-localized company suffixes in CH and it locales#3271
Conversation
`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>
|
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? |
|
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 |
thdaraujo
left a comment
There was a problem hiding this comment.
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!
| 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 |
There was a problem hiding this comment.
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.
| 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 |
| 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 |
There was a problem hiding this comment.
let's avoid testing locale contents
|
|
||
| assert_includes suffixes, 'Gruppo' | ||
| assert_not_includes suffixes, 'Group' | ||
| end |
Motivation / Background
Faker::Company.nameproduced anglophone legal forms that do not exist inthese locales:
LLCandInc.are US forms and are not used in Switzerland;GroupisEnglish. This Pull Request fixes the company
suffixlists:LLCandInc.suffixes.LLC/Inc.and add the Swiss-French formsSAandSàrl.Groupwith the ItalianGruppo.Additional information
Output after the change:
Tests assert the English forms are gone (and the localized forms present)
so the lists don't regress.
Checklist