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

Error: Symfony\Polyfill\Intl\Icu\Locale::setDefault() Not Implemented #1505

Closed
igor-jean opened this issue Mar 4, 2024 · 3 comments
Closed

Comments

@igor-jean
Copy link

I encountered an error while trying to run the Symfony project. The error message states:

"The Symfony\Polyfill\Intl\Icu\Locale::setDefault() is not implemented. Please install the "intl" extension for full localization capabilities."

Installation Procedure Used:

I used option 2 for installation:

bash
Copy code
You can create a new project based on the Symfony Demo project...
composer create-project symfony/symfony-demo my_project

...or you can clone the code repository and install its dependencies
git clone https://github.com/symfony/demo.git my_project
cd my_project/
composer install
Server Launch Behavior:

When I launch the server using symfony serve, here's what happens:
Capture d'écran 2024-03-04 165121

@igor-jean
Copy link
Author

I just tried again, it doesn't work. I thinking it was the location.I am in France and when I launch the server the URL address appears like this: http://127.0.0.1:8000/fr
So I tried to change the address to http://127.0.0.1:8000/en, and I managed to join the demo.
Capture d'écran 2024-03-06 092356

@derrabus
Copy link
Member

derrabus commented Mar 6, 2024

For the best experience, you should really install the INTL extension, as the error message suggests.


Regarding the issue, I'm unsure how we should tackle it. I basically see two options:

  • Document ext-intl as a requirement in composer.json of the demo app.
  • Send a PR to Symfony to ignore this error in the locale switcher.

@stof
Copy link
Member

stof commented Mar 6, 2024

Symfony should ignore this in the LocaleSwitcher, as already done in \Symfony\Component\HttpFoundation\Request::setLocale

smnandre added a commit to smnandre/symfony that referenced this issue Apr 3, 2024
nicolas-grekas added a commit to symfony/symfony that referenced this issue Apr 3, 2024
…ed (smnandre)

This PR was merged into the 6.4 branch.

Discussion
----------

[Translation] Fix LocaleSwitcher throws when intl not loaded

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix issue [1505](symfony/demo#1505) (from Symfony demo)
| License       | MIT

LocaleSwitcher::setDefault() throw an exception when intl is not installed

> "The Symfony\Polyfill\Intl\Icu\Locale::setDefault() is not implemented. Please install the "intl" extension for full localization capabilities."

Fixed by following `@stof` suggestion

> Symfony should ignore this in the LocaleSwitcher, as already done in \Symfony\Component\HttpFoundation\Request::setLocale

Commits
-------

eff5e3c [Translation] Silence error when intl not loaded
symfony-splitter pushed a commit to symfony/translation that referenced this issue Apr 3, 2024
@xabbuh xabbuh closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants