Skip to content

Commit 2d1505a

Browse files
Add doc for StaticMessage
1 parent 18fd48c commit 2d1505a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

translation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,14 @@ Templates are now much simpler because you can pass translatable objects to the
337337
There's also a :ref:`function called t() <reference-twig-function-t>`,
338338
available both in Twig and PHP, as a shortcut to create translatable objects.
339339

340+
On the contrary, if you want your message to never be translated, you can
341+
ensure this behavior with the
342+
:class:`Symfony\\Component\\Translation\\StaticMessage` class::
343+
344+
use Symfony\Component\Translation\StaticMessage;
345+
346+
$message = new StaticMessage('This message will never be translated.');
347+
340348
.. _translation-in-templates:
341349

342350
Translations in Templates

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy