8000 [Form] Added CountryType option for using alpha3 country codes by creiner · Pull Request #33791 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

creiner
Copy link
Contributor
@creiner creiner commented Oct 1, 2019
Q A
Branch? 4.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fixes #20313
License MIT
Doc PR -

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.. :-)

@creiner creiner changed the title Added option for using alpha3 country codes [Form][Intl] Added option for using alpha3 country codes Oct 1, 2019
@creiner creiner changed the title [Form][Intl] Added option for using alpha3 country codes [Form] Added option for using alpha3 country codes Oct 1, 2019
@creiner creiner marked this pull request as ready for review October 1, 2019 14:22
@creiner creiner changed the title [Form] Added option for using alpha3 country codes [Form] Added CountryType option for using alpha3 country codes Oct 1, 2019
Copy link
Contributor
@ro0NL ro0NL left a 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?

@creiner
Copy link
Contributor Author
creiner commented Oct 2, 2019

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 )..
Maybe this can cause confusion.. do you think a fallback to 2-letter codes for languages which doesn't have three letter codes would be appropriate?

@nicolas-grekas nicolas-grekas added this to the next milestone Oct 2, 2019
Copy link
Contributor
@ro0NL ro0NL left a 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.

@creiner creiner requested a review from xabbuh as a code owner October 3, 2019 10:16
@fabpot
Copy link
Member
fabpot commented Oct 3, 2019

Thank you @creiner.

@fabpot fabpot closed this in 2ccecbe Oct 3, 2019
@fabpot fabpot merged commit d07f5a3 into symfony:4.4 Oct 3, 2019
yceruto added a commit that referenced this pull request Oct 4, 2019
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
@creiner creiner deleted the patch-1 branch October 7, 2019 15:04
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 9, 2019
…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
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
fabpot added a commit that referenced this pull request Jan 31, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Intl][Form] Support ISO 3166-1 Alpha-3 country codes
6 participants
0