diff --git a/translation.rst b/translation.rst index ed656c62848..d3042356b8e 100644 --- a/translation.rst +++ b/translation.rst @@ -337,6 +337,19 @@ Templates are now much simpler because you can pass translatable objects to the There's also a :ref:`function called t() `, available both in Twig and PHP, as a shortcut to create translatable objects. +On the contrary, if you want your message to never be translated, you can +ensure this behavior with the +:class:`Symfony\\Component\\Translation\\StaticMessage` class:: + + use Symfony\Component\Translation\StaticMessage; + + $message = new StaticMessage('This message will never be translated.'); + +.. versionadded:: 7.4 + + The :class:`Symfony\\Component\\Translation\\StaticMessage` class was introduced in Symfony + 7.4. + .. _translation-in-templates: Translations in Templates 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