Skip to content

Commit d337e76

Browse files
committed
Reformatted references for translation in twig
1 parent c1eddf7 commit d337e76

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

book/translation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ Translations in Templates
741741
Most of the time, translation occurs in templates. Symfony2 provides native
742742
support for both Twig and PHP templates.
743743

744-
.. _book-translation-twig:
744+
.. _book-translation-tags:
745745

746746
Twig Templates
747747
~~~~~~~~~~~~~~
@@ -778,6 +778,8 @@ You can also specify the message domain and pass some additional variables:
778778
{0} There is no apples|{1} There is one apple|]1,Inf] There are %count% apples
779779
{% endtranschoice %}
780780
781+
.. _book-translation-filters:
782+
781783
The ``trans`` and ``transchoice`` filters can be used to translate *variable
782784
texts* and complex expressions:
783785

reference/twig_reference.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Filters
7777
| | spaces and capitalizes the string) |
7878
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
7979
| ``text|trans(arguments = {}, domain = 'messages', locale = null)`` | This will translate the text into the current language, more |
80-
| | information in :ref:`book-translation-twig`. |
80+
| | information in :ref:`book-translation-filers`. |
8181
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
8282
| ``text|transchoice(count, arguments = {}, domain = 'messages', locale = null)`` | This will translate the text with pluralization, more information |
83-
| | in :ref:`book-translation-twig`. |
83+
| | in :ref:`book-translation-filters`. |
8484
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
8585
| ``variable|yaml_encode(inline = 0)`` | This will transform the variable text into a YAML syntax. |
8686
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
@@ -121,10 +121,10 @@ Tags
121121
| | more information in :doc:`/cookbook/form/form_customization`. |
122122
+---------------------------------------------------+--------------------------------------------------------------------+
123123
| ``{% trans with {variables} %}...{% endtrans %}`` | This will translate and render the text, more information in |
124-
| | :ref:`book-translation-twig` |
124+
| | :ref:`book-translation-tags` |
125125
+---------------------------------------------------+--------------------------------------------------------------------+
126126
| ``{% transchoice count with {variables} %}`` | This will translate and render the text with pluralization, more |
127-
| ... | information in :ref:`book-translation-twig` |
127+
| ... | information in :ref:`book-translation-tags` |
128128
| ``{% endtranschoice %}`` | |
129129
+---------------------------------------------------+--------------------------------------------------------------------+
130130
| ``{% trans_default_domain language %}`` | This will set the default domain for message catalogues in the |

0 commit comments

Comments
 (0)