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

Refactor how we define the available locales #1511

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

javiereguiluz
Copy link
Member

I never liked the app_locales parameter: https://github.com/symfony/demo/blob/main/config/services.yaml#L9

But we need it for the route locale requirements.

I was digging into how to improve this ... and realized that if we use the standard enabled_locales config option from Symfony, the {_locale} parameter included in the URLs is automatically restricted to those values.

So, we can simplify code by moving to enabled_locales without losing any functionality.

@javiereguiluz javiereguiluz merged commit e8dc87b into symfony:main Apr 12, 2024
@94noni
Copy link
Contributor

94noni commented Apr 12, 2024

best part is no part 👍🏻

@javiereguiluz javiereguiluz deleted the refactor_locales branch April 12, 2024 10:30
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Apr 23, 2024
…description (javiereguiluz)

This PR was merged into the 5.4 branch.

Discussion
----------

[FrameworkBundle][Routing] Update the `enabled_locales` description

While working on symfony/demo#1511 I found this feature, which works since Symfony 5.4. See:

https://github.com/symfony/symfony/blob/184597db05288c68c9eb11dff55239768268f646/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1083-L1086

Commits
-------

c9b92b3 [FrameworkBundle] Update the enabled_locales description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants