symfony / demo

Symfony Demo Application
https://symfony.com/
MIT License
2.46k stars 1.61k forks source link

Refactor how we define the available locales #1511

Closed javiereguiluz closed 4 months ago

javiereguiluz commented 4 months ago

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.

94noni commented 4 months ago

best part is no part 👍🏻