File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -337,18 +337,24 @@ Templates are now much simpler because you can pass translatable objects to the
337
337
There's also a :ref: `function called t() <reference-twig-function-t >`,
338
338
available both in Twig and PHP, as a shortcut to create translatable objects.
339
339
340
- On the contrary, if you want your message to never be translated, you can
341
- ensure this behavior with the
340
+ Non-Translatable Messages
341
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
342
+
343
+ In some cases, you may want to explicitly prevent a message from being
344
+ translated. You can ensure this behavior by using the
342
345
:class: `Symfony\\ Component\\ Translation\\ StaticMessage ` class::
343
346
344
347
use Symfony\Component\Translation\StaticMessage;
345
348
346
349
$message = new StaticMessage('This message will never be translated.');
347
350
351
+ This can be useful when rendering user-defined content or other strings
352
+ that must remain exactly as given.
353
+
348
354
.. versionadded :: 7.4
349
355
350
- The :class: `Symfony\\ Component\\ Translation\\ StaticMessage ` class was introduced in Symfony
351
- 7.4.
356
+ The :class: `Symfony\\ Component\\ Translation\\ StaticMessage ` class was
357
+ introduced in Symfony 7.4.
352
358
353
359
.. _translation-in-templates :
354
360
You can’t perform that action at this time.
0 commit comments