Skip to content

Commit 43fa51a

Browse files
committed
minor #1539 [Doc] Reword the section about the locale in Live Components (javiereguiluz)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Doc] Reword the section about the locale in Live Components | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Issues | - | License | MIT Context: we have a localized project that doesn't add the locale in the URL. When refreshing the page after any UX change, the local was lost. I read the docs but I couldn't fully understand it. I thought this was only for projects that include the locale in the URLs. In any case, after asking to Kevin and Ryan, they told me that this solution also applied to my case. They were right ... so I propose a minor reword to make it more clear that this solution is for everybody that works on localized projects. Commits ------- dfd967f [Doc] Reword the section about the locale in Live Components
2 parents b81fe2c + dfd967f commit 43fa51a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/LiveComponent/doc/index.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ needed if you're using AssetMapper):
9696
$ yarn install --force
9797
$ yarn watch
9898
99-
In case your project `localizes its URLs`_ by adding the special
100-
``{_locale}`` parameter to the paths of its route definitions,
101-
you need to do the same with the UX Live Components route definition:
99+
If your project is localized in different languages (either via the `_locale route parameter`_
100+
or by `setting the locale in the request`_) add the ``{ _locale}`` attribute to
101+
the UX Live Components route definition to keep the locale between re-renders:
102102

103103
.. code-block:: diff
104104
@@ -3456,7 +3456,6 @@ bound to Symfony's BC policy for the moment.
34563456
.. _`experimental`: https://symfony.com/doc/current/contributing/code/experimental.html
34573457
.. _`dependent form fields`: https://ux.symfony.com/live-component/demos/dependent-form-fields
34583458
.. _StimulusBundle configured in your app: https://symfony.com/bundles/StimulusBundle/current/index.html
3459-
.. _`localizes its URLs`: https://symfony.com/doc/current/translation/locale.html#translation-locale-url
34603459
.. _`attributes variable`: https://symfony.com/bundles/ux-twig-component/current/index.html#component-attributes
34613460
.. _`CollectionType`: https://symfony.com/doc/current/form/form_collections.html
34623461
.. _`the traditional collection type`: https://symfony.com/doc/current/form/form_themes.html#fragment-naming-for-collections
@@ -3467,3 +3466,5 @@ bound to Symfony's BC policy for the moment.
34673466
.. _`PostMount hook`: https://symfony.com/bundles/ux-twig-component/current/index.html#postmount-hook
34683467
.. _`validation groups`: https://symfony.com/doc/current/form/validation_groups.html
34693468
.. _morphing library: https://github.com/bigskysoftware/idiomorph
3469+
.. _`_locale route parameter`: https://symfony.com/doc/current/translation.html#the-locale-and-the-url
3470+
.. _`setting the locale in the request`: https://symfony.com/doc/current/translation.html#translation-locale

0 commit comments

Comments
 (0)