Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
Add documentation about alpha3 methods#12105
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…braten-certua)This PR was merged into the 4.4 branch.Discussion----------[Intl] Support ISO 3166-1 Alpha-3 country codes| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | #20313| Doc PR |symfony/symfony-docs#12105| License | MITThis is a pre-requiste for fixing #20313 and only handles the changes to the INTL component.Commits-------848f60e905 Support ISO 3166-1 Alpha-3 country codes
…braten-certua)This PR was merged into the 4.4 branch.Discussion----------[Intl] Support ISO 3166-1 Alpha-3 country codes| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20313| Doc PR |symfony/symfony-docs#12105| License | MITThis is a pre-requiste for fixing#20313 and only handles the changes to the INTL component.Commits-------848f60e Support ISO 3166-1 Alpha-3 country codes
OskarStark commentedAug 14, 2019
@ro0NL would you do me a favor and review this PR? Thank you 😃 |
ro0NL left a comment
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.
😁
| // => 'French' | ||
| If you want to you can also use the ISO 639-2 three-letter language codes instead of | ||
| the ISO 639-1 two-letter codes. (They are here called alpha3 codes.) |
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.
You can also use the ISO 639-2 three-letter language codes instead ofthe ISO 639-1 two-letter codes, respectively called alpha3 and alpha2 codes.| // Indexed with alpha-2 | ||
| $countries = Countries::getNames(); | ||
| // ('countryCode' => 'countryName') |
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.
perhaps mention "alpha2" here to reduce comments, e.g.// ('alpha2Code' => 'countryName')
| // Indexed with alhpa-3 | ||
| $countries = Countries::getAlpha3Names(); | ||
| // ('countryCode' => 'countryName') |
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.
same// ('alpha3Code' => 'countryName')
| $country = Countries::getName('GB', 'de'); | ||
| // => 'Vereinigtes Königreich' | ||
| $country = Countries::getName('GBR', 'de'); |
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.
getAlpha3Name
| $isValidCountry = Countries::exists($countryCode); | ||
| $isValidCountry = Countries::exists($alpha2Code); | ||
| $isValidCountry = Countries::alpha3CodeExists($alpha2Code); |
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.
i would add a paragraph in between like languages does
Or if you have a alpha3 country code you want to check: $isValidCountry = Countries::alpha3CodeExists($alpha3Code);| $isValidLanguage = Languages::exists($languageCode); | ||
| Or if you have a three-letter language code you want to check: |
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.
:: i believe (not a format expert here :D)
OskarStark commentedAug 15, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
It took time, but here we go, this is in now. Thank you very much Terje. I made the requested changes while merging (b3d776d) 👍 |
* 4.4: Tweaks. refs#12105 Add documentation about alpha3 methods
This PR was merged into the 4.4 branch.Discussion----------Update intl.rsttiny follow up of#12105cc@OskarStarkCommits-------d757a2d Update intl.rst
This PR was squashed before being merged into the 4.3 branch (closes#12173).Discussion----------Mention ISO 639 for languageswe've added this in 4.4 (#12105), but languages in 4.3 already had (partial) alpha3 support.let me know if this is merged in 4.4 :) it needs some cleanup after.cc@OskarStarkCommits-------8ee8df7 Mention ISO 639 for languages
Uh oh!
There was an error while loading.Please reload this page.
Replaces#12104