Trans tag with langcode option is not working

Created on 4 June 2018, almost 7 years ago
Updated 5 July 2023, almost 2 years ago

Language option to the Twig {% trans %} tag extension is not working

Requirement - I have to change language of a twig file content and not of the whole site.
Approach -
1. I used the trans tag with the langcode option in my twig file, the following way -

{% trans with {'langcode': 'es'} %}
  Thank you
{% endtrans %}

2. I have added the Spanish (es) string for "Thank you" in Admin->Regional & Language->Language

But I am not able to see the translated string of "Thank you".
Is there something I am missing ?

🐛 Bug report
Status

Active

Component

Code

Created by

🇮🇳India namratay

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024