-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Added CountryType option for using alpha3 country codes #33791
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same applies to LanguageType, isnt it?
src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php
Show resolved
Hide resolved
I've added it to the LanguageType and added also the tests... When a language doesn't have a three letter code, it doesn't appear in the collection (behavior of Language::getAlpha3Names ).. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think you need to bump symfony/intl in composer.json of the Form component still ... see https://travis-ci.org/symfony/symfony/jobs/592410645#L4077
do you think a fallback to 2-letter codes for languages which doesn't have three letter codes would be appropriate?
i'd like to validate the dataset further in #33165, feel free to share any data related issues there. In general the alpha2 and alpha3 list should be the same size. For languages the alpha2 lists also includes alpha3 codes in case no alpha2 code is available, whereas Countries should have alpha3 codes for each alpha2 code.
Thank you @creiner. |
This PR was merged into the 4.4 branch. Discussion ---------- [Form] Update CHANGELOG.md | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> forgotten in #33791 Commits ------- 332128f Update CHANGELOG.md
…anguageType (creiner) This PR was squashed before being merged into the 4.4 branch (closes #12441). Discussion ---------- [Form] Added docs for alpha3 option in CountryType and LanguageType Here are the documentation parts for the PR: symfony/symfony#33791 Hope I didn't make any mistakes.. :-) Commits ------- 377d71c [Form] Added docs for alpha3 option in CountryType and LanguageType
…axperrimond) This PR was squashed before being merged into the 5.1-dev branch (closes #35116). Discussion ---------- [Validator] Add alpha3 option to country constraint | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#12857 A following of #33791 and #32988 to add `alpha3` option also to `Country` constraint in the validator component. Commits ------- d6f34a5 [Validator] Add alpha3 option to country constraint
In the linked issue #20313 was a proposal to add an alpha3 option to the country type.
Here it is..
Hopefully I've made no mistake, so when the code is fine, I will create a documentation PR.. :-)