Skip to content

[LiveComponent][doc] Document how to deal with locales #239

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

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

Lustmored
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Tickets Fix #231
License MIT

Locale was lost after any live component action. It turns out that simply by adding {_locale} to the route fixes the issue even when no locales are configured (router still seems to inject en).

@kbond
Copy link
Member

kbond commented Jan 21, 2022

Can this be achieved by adding the locale prefix when importing the route? https://symfony.com/doc/current/routing.html#route-groups-and-prefixes

I'd prefer suggesting this. Maybe a note in the docs/recipe?

@Lustmored
Copy link
Contributor Author

@kbond it looks like you are right and your approach seems much cleaner. I will follow up on that 👍

@Lustmored Lustmored changed the title [LiveComponent] Add locale to live_component route [LiveComponent][doc] Document how to deal with locales Jan 21, 2022
@Lustmored
Copy link
Contributor Author

@kbond I don't think there is any recipe for live component (at least I couldn't find any), therefore I believe putting this in installation step instructions is enough.

Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any recipe for live component

You're right, there isn't yet.

@Lustmored Lustmored requested a review from kbond January 21, 2022 15:56
@weaverryan
Copy link
Member

Thank you Jakub!

@weaverryan weaverryan merged commit a33303d into symfony:2.x Jan 21, 2022
@Lustmored Lustmored deleted the fix-locale branch March 11, 2022 12:20
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

Successfully merging this pull request may close these issues.

[LiveComponent] Component loses locale with every render
3 participants