Closed adrianrudnik closed 3 months ago
@adrianrudnik
Thank you for your contribution!
As far as I can tell, we have agreed a while ago not to accept any new features for fakerphp/faker:1
. However, your contribution could be good for fakerphp/faker:2.0.0
.
Also see
Ah thank you for the hint. I'll take a look and migrate it to 2.x if possible. Should I close this PR or reuse it for that?
@adrianrudnik
Let's keep it open!
Since it depends on intl i dont see this going in the main core repo of faker. Best is to provide a custom provider that can easily be added as an extension
@pimjansen It depends on the context of Intl yes, but it does not have a code depdency or what are you referencing to?
Since it depends on intl i dont see this going in the main core repo of faker. Best is to provide a custom provider that can easily be added as an extension
I don't see any of the code referencing the intl extension?
Since it depends on intl i dont see this going in the main core repo of faker. Best is to provide a custom provider that can easily be added as an extension
I don't see any of the code referencing the intl extension?
Ah crap i was wrong. My bad
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 1 week if no further activity occurs. Thank you for your contributions.
What is the reason for this PR?
Use case: Using an API Platform based project, the user chooses a locale for display of UI language, number and date formatting based on the browsers BCP 47 language tags.
The UI itself uses Javascript, so the Intl namespace is used there. The classes and functions available there operate around a BCP 47 language tag maintained by the IANA Language Subtag Registry. While similar, they are not the same. It is simple to derive a PHP Locale from that BCP 47 language tag, it is not as easy the other way around.
The goal is allow Faker to produce valid BCP 47 / IETF language tags (either with subtag or not).
Is this a worthwhile addition before I invest time into the documentation?
In addition I get errors on
make test
about locale based providers, i.e.InvalidArgumentException: Unable to find provider "Ietf" with locale "ar_EG"
, not sure why, I tried to stick with theNumberProvider
for the implementation but must have missed something.getProviderClassname
does not seem to fall back here.Author's checklist
Summary of changes
Review checklist
CHANGELOG.md