Skip to content

[Translation] Please remove dependency of INTL plugin #38279

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
peter-mw opened this issue Sep 23, 2020 · 3 comments
Closed

[Translation] Please remove dependency of INTL plugin #38279

peter-mw opened this issue Sep 23, 2020 · 3 comments

Comments

@peter-mw
Copy link

peter-mw commented Sep 23, 2020

Hello,

as of this commit

symfony/translation@fe0e1f2#diff-c93f36c15d5c29291cda962db092b47bR161

the symfony/translation package now requires the INTL plugin which is not installed on the majority of users and i get the error Class 'Locale' not found . https://www.php.net/manual/en/book.intl.php

Using symfony/translation version '5.1' breaks a lot of installs because of this dependency

I needed to revert to symfony/translation version '5.0'

Can you please fix this dependency as INTL plugin does not come by default

@peter-mw peter-mw added the Bug label Sep 23, 2020
peter-mw referenced this issue in symfony/translation Sep 23, 2020
* 5.1: (25 commits)
  stop using the deprecated at() PHPUnit matcher
  fix lowest allowed version of the HTTP client contracts
  fix lowest allowed version for the PHPUnit bridge
  fix merge
  fix merge
  drop logger mock in favor of using the BufferingLogger
  catch ValueError thrown on PHP 8
  [Yaml Parser] Fix edge cases when parsing multiple documents
  fix parsing comments not prefixed by a space
  [Translator] Make sure a null locale is handled properly
  deal with errors being thrown on PHP 8
  loadRoutes shoud receive RoutingPhpFileLoader
  [Cache] Allow cache tags to be objects implementing __toString()
  [HttpKernel] Do not override max_redirects option in HttpClientKernel
  Log notice when no entry point is configured
  remove superfluous cast
  [HttpClient] Support for CURLOPT_LOCALPORT.
  Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3).
  Fixed exception message formatting
  [FrameworkBundle] Fix error in xsd which prevent to register more than one metadata
  ...
@ro0NL
Copy link
Contributor

ro0NL commented Sep 23, 2020

that's a good catch 👍 i think it's best to add a class_exists check for \Locale, and eventually fallback to en hardcoded in case the extension/polyfill is unavailable.

@xabbuh
Copy link
Member

xabbuh commented Sep 23, 2020

see #38282

@ro0NL
Copy link
Contributor

ro0NL commented Sep 23, 2020

@xabbuh ai, i picked the same issue - #38283

@fabpot fabpot closed this as completed Sep 24, 2020
fabpot added a commit that referenced this issue Sep 24, 2020
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Translator] Optional Intl dependency

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38279
| 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/releases):
 - 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 master.
-->

i decided to cast $locale at construct, given its property is documented to be string

Commits
-------

a2eb263 [Translator] Optional Intl dependency
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

5 participants