Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Intl component - missing region #47825

Copy link
Copy link
Closed
Closed
Copy link
@trsteel88

Description

@trsteel88
Issue body actions

Symfony version(s) affected

6.*

Description

I have a application which was recently upgraded from Symfony 3.4 to 6 and I have noticed that there is a region missing from the Intl component.

The region that I have found was "AC" - https://github.com/symfony/intl/blob/3.4/Resources/data/regions/en.json#L3

Within the application, we have the following method:

public function getCountryName(): ?string
    {
        if (null === $this->country) {
            return null;
        }

        return Countries::getName($this->country);
    }

However, this now throws a Symfony\Component\Intl\Exception\MissingResourceException exception.

The only option for us is to catch this exception and return the code instead:

public function getCountryName(): ?string
    {
        if (null === $this->country) {
            return null;
        }

        try {
            return Countries::getName($this->country);
        } catch (MissingResourceException $e) {
            return $this->country;
        }
    }

It seems odd that this region has disappeared when it still exists here: https://www.iso.org/obp/ui/#iso:code:3166:AC

How to reproduce

echo \Symfony\Component\Intl\Countries::getName('AC');

Possible Solution

Load "AC" and any other missing regions back into the Intl php arrays. Unless this was intentionally removed?

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.