-
-
Notifications
You must be signed in to change notification settings - Fork 929
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
feat(address): use localized fake pattern in city #948
Conversation
Codecov Report
@@ Coverage Diff @@
## main #948 +/- ##
=======================================
Coverage 99.65% 99.65%
=======================================
Files 1957 1970 +13
Lines 209831 209927 +96
Branches 878 875 -3
=======================================
+ Hits 209112 209211 +99
+ Misses 699 697 -2
+ Partials 20 19 -1
|
What's the value of having both methods |
For now, mainly legacy reasons, but for some usecases it might be required to have actual city names instead of generated ones. |
(I do plan to deprecate the cityPrefix and citySuffix methods at some point though) |
Following the comment in the other PR we both agreed that it would be better to have data close to reality (zodiac I think) so I think |
That sounds like a reasonable suggestion. I would like to do that in a separate PR though, as these mass locale changes get confusing/unreviewable really fast. Should I also remove the city (pattern) files, if there are actual city name files? |
Make sense :)
Yes. And deprecate |
This PR changes the
address.city
method to use theaddress.city
locale data with fake to generate city names.For that I checked, that all city files are named correctly (city -> patterns; city_name -> actual city names).
I did not check whether the specified patterns make sense or the city names are real.
I generated the missing city files with the original pattern from the method to ensure it does not break between versions.
I did not add
'{{address.city_name}}'
to the city patterns if both the city and city_name files exist (except for the en locale because it affected a test, see my second commit).I did not remove it from the patterns if the city_name file is missing in that locale.
Everything in the first commit was generated by using this code:
generateLocales.ts
And executed it using this helper: