Drupal twig, different ways to translate.
After searching, once again, how to solve a translation in the Drupal 8 template system, it occurred to me that it would be good to always have a notes on hand with the different ways in which we can do a twig translation. Let us begin.
The best known and simple, we apply the filter | t to the text string:
{{ 'Hello World!'|t }}
We can also use the | trans filter, but this is more useful when we use it as a block:
{% trans %}Hello World!{% endtrans %}
It is clear that this form uses...