Skip to content

Commit a55a705

Browse files
committed
Documented "translation" section
1 parent 193901a commit a55a705

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

cookbook/bundles/inheritance.rst

+3-6
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,9 @@ The same goes for routing files, validation configuration and other resources.
9797

9898
.. caution::
9999

100-
Translation files do not work in the same way as described above. All
101-
translation files are accumulated into a set of "pools" (one for each)
102-
domain. Symfony loads translation files from bundles first (in the order
103-
that the bundles are initialized) and then from your ``app/Resources``
104-
directory. If the same translation is specified in two resources, the
105-
translation from the resource that's loaded last will win.
100+
Translation files do not work in the same way as described above. Read
101+
:ref:`override-translations` if you want to learn how to override
102+
translations.
106103

107104
.. _`FOSUserBundle`: https://github.com/friendsofsymfony/fosuserbundle
108105

cookbook/bundles/override.rst

+15-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Templates
1111
---------
1212

1313
For information on overriding templates, see
14+
1415
* :ref:`overriding-bundle-templates`.
1516
* :doc:`/cookbook/bundles/inheritance`
1617

@@ -120,9 +121,22 @@ Validation metadata
120121

121122
In progress...
122123

124+
.. _override-translations:
125+
123126
Translations
124127
------------
125128

126-
In progress...
129+
Translations are not related to bundles, but to domains. That means that you
130+
can override the translations from any translation file, as long as it is in
131+
:ref:`the correct domain <translation-domains>`.
132+
133+
.. caution::
134+
135+
The last translation file always wins. That mean that you need to make
136+
sure to load the class which overrides the translation of another bundle
137+
before that bundle in the ``AppKernel``.
138+
139+
The file that always wins is the one that is placed in
140+
``app/Resources/translations``, as those files are always loaded as last.
127141

128142
.. _`the Doctrine documentation`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#overrides

0 commit comments

Comments
 (0)