Skip to content

Commit cc913f0

Browse files
committed
Provide example of adding labels to entities using translatable
1 parent c051d22 commit cc913f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

translation.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ Sometimes you may want to create a message, but at the time of creation aren't
303303
sure how it would be translated. For example, it could be translated multiple
304304
times if intended to be displayed to multiple users.
305305

306+
Using translatable objects also allows preparing translations without having a
307+
dependency on an entrypoint (such as a router) where the context for performing
308+
the translation is provided. For example, entities could prepare translatable
309+
strings (such as labels) without the need for a translator.
310+
306311
Instead of translating a string at the time of creation, a ``Translatable``
307312
object can be created that can then be translated when used. Later this message
308313
can be translated with a translator in either PHP or in Twig.

0 commit comments

Comments
 (0)