Skip to content
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

[Intl] Cleanup unused language aliases entry #33139

Merged
merged 1 commit into from Aug 13, 2019
Merged

[Intl] Cleanup unused language aliases entry #33139

merged 1 commit into from Aug 13, 2019

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Aug 13, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #...
License MIT
Doc PR symfony/symfony-docs#...

The data entry Aliases in languages is never used.

public function getAliases()
{
return $this->reader->readEntry($this->path, 'root', ['Aliases']);
}

Already crashes with

Symfony\Component\Intl\Exception\MissingResourceException:
Couldn't read the indices [Aliases] for the locale "root" in "src/Symfony/Component/Intl/Resources/data/languages".

The locale should be meta, which would return an empty array 🤷‍♂️

@fabpot
Copy link
Member

fabpot commented Aug 13, 2019

Thank you @ro0NL.

@fabpot fabpot merged commit 1689f77 into symfony:3.4 Aug 13, 2019
fabpot added a commit that referenced this pull request Aug 13, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Cleanup unused language aliases entry

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

The data entry `Aliases` in languages is never used.

https://github.com/symfony/symfony/blob/50c59112298669e7724a42a8ee1a1fe6d1e1b536/src/Symfony/Component/Intl/Data/Provider/LanguageDataProvider.php#L44-L47

Already crashes with

```
Symfony\Component\Intl\Exception\MissingResourceException:
Couldn't read the indices [Aliases] for the locale "root" in "src/Symfony/Component/Intl/Resources/data/languages".
```

The locale should be `meta`, which would return an empty array 🤷‍♂️

Commits
-------

1689f77 [Intl] Cleanup unused language aliases entry
@ro0NL ro0NL deleted the intl-lang-alias branch August 13, 2019 15:51
This was referenced Aug 26, 2019
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.

None yet

4 participants