Locale text is not translated

Created on 28 February 2022, about 3 years ago
Updated 10 February 2023, about 2 years ago

Locale text is not translated in current language

Steps to reproduce

  1. Create a new project with default language as FRENCH (not english), maybe this case is outside of your tests.
  2. add english language
  3. configure url as detection method
  4. add block language select: two languages are expected french/english
  5. Check translations in admin interface : English -> Anglais, French -> Français : OK
  6. display a page in english: OK, both languages in switcher are written in english
  7. swith French: KO: French is still displayed as 'French' instead of 'Français', english is displayed as 'English' instead of 'Anglais'.

Proposed resolution

In template 'languageicons-link-content.html.twig', add '|t' as twig translation function for 'text'

{% if placement == 'before' %}
    {{ icon }}{{ separator }}{{ text|t }}
{% endif %}
{% if placement == 'after' %}
    {{ text|t }}{{ separator }}{{ icon }}
{% endif %}
{% if placement == 'replace' %}
    {{ icon }}
{% endif %}
🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇫🇷France frondeau Nantes, FRANCE

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