-
Notifications
You must be signed in to change notification settings - Fork 178
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
Refactor country-specific properties #1489
Conversation
Apparently, it was occasionally commented out in commit f073184
these are settings that depend on country, not language (e.g. postal code, building numbers, passport numbers, internet domains). The primary test showing the difference is `AddressTest.usingOnlyCountryCodeWithoutLanguage()`. E.g. `new Faker(new Locale("et", "AL")).address().countryCode()` should return "AL" (Albania), not "EE" (Estonia).
There is no such a locale. The proper locale is "de_DE" ("de" means German language, and "DE" means country Germany).
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1489 +/- ##
============================================
- Coverage 92.45% 92.44% -0.01%
- Complexity 3255 3271 +16
============================================
Files 324 325 +1
Lines 6387 6437 +50
Branches 623 625 +2
============================================
+ Hits 5905 5951 +46
+ Misses 336 335 -1
- Partials 146 151 +5 ☔ View full report in Codecov by Sentry. |
Move country-specific properties from
lang.yml
to_COUNTRY.yml
files.These are settings that depend on country, not language (e.g. postal code, building numbers, passport numbers, internet domains).
The primary test showing the difference is
AddressTest.usingOnlyCountryCodeWithoutLanguage()
.For example,
And:
In this PR, I had to introduce concept of "language's default country".
In the case when only the language is given, we need to detect the country:
The list of "language's default countries" is located in
FakerContext.LANGUAGE_DEFAULT_COUNTRY
.