Skip to content

Commit 615696f

Browse files
authored
Add a hint to localization.rst how to get the current active locale
Adds a note how to get the currently active locale in the documentation for the localizations.
1 parent 1aa73ff commit 615696f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

book/localization.rst

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ For the developer the only touching points with localizations are the
7070
configuration and the eventual use of a language switcher on the homepage.
7171
For the language switcher the ``localizations`` variable delivered to the twig template
7272
can be used, which contains an associative array with the parameters ``locale``, ``url`` and ``country``.
73+
The currently active locale can be obtained from the underlying Symfony Request
74+
object with ``app.locale``.
7375

7476
.. code-block:: twig
7577

0 commit comments

Comments
 (0)