File tree 1 file changed +27
-0
lines changed
Filter options
1 file changed +27
-0
lines changed
Original file line number Diff line number Diff line change @@ -304,6 +304,27 @@ impersonation_exit_url
304
304
It's similar to the `impersonation_exit_path `_ function, but it generates
305
305
absolute URLs instead of relative URLs.
306
306
307
+ t
308
+ ~
309
+
310
+ .. code-block :: twig
311
+
312
+ {{ t(message, parameters = [], domain = 'messages')|trans }}
313
+
314
+ ``message ``
315
+ **type **: ``string ``
316
+ ``parameters `` *(optional) *
317
+ **type **: ``array `` **default **: ``[] ``
318
+ ``domain `` *(optional) *
319
+ **type **: ``string `` **default **: ``messages ``
320
+
321
+ .. versionadded :: 5.2
322
+
323
+ The ``t() `` function was introduced in Symfony 5.2.
324
+
325
+ Creates a ``Translatable `` object that can be passed to the
326
+ :ref: `trans filter <reference-twig-filter-trans >`.
327
+
307
328
Form Related Functions
308
329
~~~~~~~~~~~~~~~~~~~~~~
309
330
@@ -341,6 +362,8 @@ Makes a technical name human readable (i.e. replaces underscores by spaces
341
362
or transforms camelCase text like ``helloWorld `` to ``hello world ``
342
363
and then capitalizes the string).
343
364
365
+ .. _reference-twig-filter-trans :
366
+
344
367
trans
345
368
~~~~~
346
369
@@ -357,6 +380,10 @@ trans
357
380
``locale `` *(optional) *
358
381
**type **: ``string `` **default **: ``null ``
359
382
383
+ .. versionadded :: 5.2
384
+
385
+ ``message `` accepting ``Translatable `` as a valid type was introduced in Symfony 5.2.
386
+
360
387
Translates the text into the current language. More information in
361
388
:ref: `Translation Filters <translation-filters >`.
362
389
You can’t perform that action at this time.
0 commit comments