Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Problem
Actually, I created a webform on a multilingue project which contains a component using Term select.
This component is linked to a vocabulary, some of terms are translated.
When i printed my webform, I saw that in list terms options, terms name are printed in the original language but not with the current language of the page.
Proposed resolution
Before the term name is get:
- Check if the term is translatable and has a translation to get it
- Use the name of the translatable term instead of the original name.
Please see the attached patch in my next comment.
Comment | File | Size | Author |
---|---|---|---|
#8 | print_term_select-2862845-8.patch | 2.31 KB | jrockowitz |
| |||
#6 | webform-print-term-select-reference-items-translated-2862845-6.patch | 2.3 KB | Tsymi |
|
Comments
Comment #2
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedComment #4
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedSorry, please find my patch fixed.
Comment #6
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedPatch attached with another fix.
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThe only tweak that I am going to make is change...
...to...
...because as general rule, it is okay to let the source language bleed through when there is no translation. If a vocabulary had no translated terms the menu would be empty or if a parent term is missing a translation, the menu would appear broken.
Comment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commented@Tsymi thanks for the patch.
I committed the latest patch. Please download and review the latest dev release. Don't hesitate to post more tweaks and reopen this ticket if needed.
Comment #11
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedHi jrockowitz,
Thanks for your return :)