8000 [Intl][Validator] Language::exists fail for es_419 · Issue #35513 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[Intl][Validator] Language::exists fail for es_419 #35513

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

Closed
jkobus opened this issue Jan 29, 2020 · 7 comments
Closed

[Intl][Validator] Language::exists fail for es_419 #35513

jkobus opened this issue Jan 29, 2020 · 7 comments

Comments

@jkobus
Copy link
Contributor
jkobus commented Jan 29, 2020

Symfony version(s) affected: 4.4

Description
Languages::exists('es_419') is not working in intl 4.4 where the same code worked with 4.3.

How to reproduce

  • Checkout intl repo, latest version
  • Add assertion in \Symfony\Component\Intl\Tests\LanguagesTest::testExists:
    $this->assertTrue(Languages::exists('es_419'));
  • run the test: phpunit --group intl-data --filter testExists
  • tests will fail

Repeat the same steps with 4.3 and the test will be green.

Possible Solution
I tried to dig in the code but with no luck so far.

Additional context
The language validator in symfony 4.4 will also fail due to this bug.

@jkobus
Copy link
Contributor Author
jkobus commented Jan 29, 2020

Thanks, closing then :)

@jkobus jkobus closed this as completed Jan 29, 2020
@jkobus
Copy link
Contributor Author
jkobus commented Jan 29, 2020

@ro0NL, would you be so kind and tell me, what alternatives we have now for the language validator?

We used it to validate user input; we have content in various languages and dialects, also es_419. I followed the related tickets, but there is no straightforward information. I assume, there is now no validator that can accept es_419 as input?

@jkobus
Copy link
Contributor Author
jkobus commented Jan 29, 2020

Tested, and:

var_dump(\Symfony\Component\Intl\Locales::exists('es_419'));

returns false with intl 4.4.3.

fabpot added a commit that referenced this issue Jan 30, 2020
This PR was submitted for the 4.3 branch but it was merged into the 4.4 branch instead (closes #35517).

Discussion
----------

[Intl] Provide more locale translations

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35513 (comment)
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This enables more locale translations, available upstream, which are valid. In this case esp. locales with a numeric region code, eg. `es_419`

This should return true in `Locales::exists()`, which is currently not the case. By providing the translation, it implicitly exists as well.

cc @jkobus

Commits
-------

27cc120 [Intl] Provide more locale translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0