-
-
Notifications
You must be signed in to change notification settings - Fork 942
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
Improve locale loading and global locale data #823
Comments
I already have an outdated branch with a potential solution/implementation for 2: main...ST-DDT:feature/locales/multi-fallback |
We should definitely have a space where we could put all locale-independent definitions. Not sure we should call it
Being able to create a path of multilevel fallbacks sounds like a good idea too! I can at least see 3 levels: dialect (eg
We should also define default fallbacks so |
I specifically used a locale for these data to allow for easy and consistent overwriting of the data. The locale order will be like this by default: de-At, de, en, global The localeOrder is indepent of the available locales in a faker instance. The locale order uses the locale names/keys, not the locale objects. |
We would use the same fallback mechanism as now, just with more fallback levels. If it is not in en-GB then we will check en, then global. You can overwrite in en-GB only |
Just some suggestions for the local-independent definitions name: |
This is not a good example for IBAN, as for example I might be on a polish locale, yet willing to generate Italian IBAN... IBAN imho is not connected with locale. Country of origin might a param for it, but otherwise format is the same for all countries, right? I really don't think I really see no reason why anyone would like to exclude |
You have a point. What about mime file types? |
Superseded by #1340. |
Clear and concise description of the problem
The current system of loading locale data has some drawbacks, that needs to be addresses:
en
locale, even though some of the data (emojis, iban, country codes) aren't related to thaten
by default)faker.definitions
)Suggested solution
global
locale with all the locale data that aren't bound to a specific localefaker.definitions
) feat: dynamic definitions tree #822Alternative
faker.definitions
faker.definitions
Additional context
The text was updated successfully, but these errors were encountered: