Drupal 8 - Translate string from template

1.4k Views Asked by At

I have texts in different screens of my template that correspond to headers, links, etc. and that I need them to appear translated in my web page.

How can I enter words, text strings, etc. and put the translation in all the languages of my site from the admin?

Thank you.

1

There are 1 best solutions below

0
Jeffrey On BEST ANSWER

in twig template you can translate value by this way :

{{ "Most Recent"|t }}

another example :

<a class="button" href="#">{{ "Show most recent item"|t }}</a>

more documentation here : https://www.drupal.org/docs/8/api/translation-api/overview