-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Random country code returned for address with locale en-US
#231
Comments
Hi @kukido , As of current This has likely changed between versions you mention because the yml files aren't managed by kotlin-faker, and I have a rule of using them as is (with a very few exceptions) to avoid maintenance overhead. So likely during one of the upstream pulls, the data in the May I ask what is your use-case for returning |
Thank you for quick response! Intuitively I would expect Our use-case is simple, we create US-based addresses in most cases, so your proposal to hardcode It was just odd to see the behavior to change between versions as it was not mentioned in the changelog. |
Hmm, yeah, I can see your point and agree that such behavior would be natural. But most of the current localized files don't override the I can also see how it can be confusing when the behavior changes between versions. I'll mark it as "needs fixing upstream for now", but feel free to propose an alternative solution if you can think of one :) |
Looks like there's |
So ideally, the library should take |
Looked into it a bit further, exactly the same bug was submitted with
|
Yeah, I saw there's a "default_country_code" in the localized dictionaries and I've thought about using that, but kotlin-faker currently does not support non-default localized keys (e.g. a key that is present in |
I guess one simple way to implement this while avoiding having to deal with the whole "non-default keys" thing, would be to check the locale value, and then either fetch |
This is now implemented and will be available in next version. Similar cases should also be quite simple to fix since this was done via supporting "alternative keys" in the yml. Thanks for your inputs and suggestions, @kukido |
Thank you for the fix @serpro69 ! As I understand, it will be available in 2.0, correct? |
Yes, but you can also use the next 2.0 release-candidate if you don't want to wait until the stable release version is out ;) |
Looks like
address
generation got broken in version1.14.0
The text was updated successfully, but these errors were encountered: