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.
In the _name_field_widget_form:382 , it loops for all name translations but on line 389, it sets the title to its original value... Shouldn't it use the translated name translations ?
I will post the patch in the next comment.
- Etienne
Comments
Comment #1
emorency CreditAttribution: emorency commentedHere is the patch to use the translated name component titles.
Comment #2
Alan D. CreditAttribution: Alan D. commentedThis line of code uses the field settings to add the label. I know that these are used in many sites where these fields are used for completely different purposes, for example one university site uses these fields to describe a course.
So the solution will not work, but this should stay open and a working solution needs to be found.
Comment #3
fraweg CreditAttribution: fraweg commentedHello,
I need a solution for a multi language site too. In the registration form the titles like "Given" "Family" are not translatable..
Thanks for any help!
Best regards
Frank
Edit: This patch works for me. I will use it until there is no other solution.
Comment #4
drupal a11y CreditAttribution: drupal a11y commentedThe Options set in the "Title component seettings" are totally ignored in my case (multidomain & multilanguage).
Comment #5
alexh CreditAttribution: alexh commentedI know that t() should not be used to translate user input, but at least it works if it is used in line 389:
This should probably be done using the i18_string module, but I could not find a way how.
Comment #6
stevieb CreditAttribution: stevieb commentedyou could try using taxonomy - according to the field info
"Titles may be also imported from one or more vocabularies using the tag '[vocabulary:xxx]', where xxx is the vocabulary machine-name or id."
Comment #7
sgurlt CreditAttribution: sgurlt commentedAnything new here?
I was able to find the title strings with i18n, but the translation of the title field does not get displayed?
Comment #8
PascalAnimateur CreditAttribution: PascalAnimateur commentedI can confirm the patch from #1 solves the problem with l10n (don't know about i18n though).
Comment #9
karimei CreditAttribution: karimei commentedHere is my approach to solve this issue.
Comment #10
PascalAnimateur CreditAttribution: PascalAnimateur commentedRe-rolled patch from #9 to apply cleanly
Comment #11
webadpro CreditAttribution: webadpro commentedPatch #1 did it for me. I dont think #8 or #9 is the proper way to translate strings. Usually you dont pass variables to t() function. Thats what i18n string is for.
Comment #12
PascalAnimateur CreditAttribution: PascalAnimateur commentedRe-rolled patch #10 against 7.x-1.10 ... while we wait for proper i18n integration :(
Comment #13
DaReMe CreditAttribution: DaReMe commentedExpanded patch #12 - added context for t() because the name of the title component conflicts with the drupal built-in title field.
Comment #14
Alan D. CreditAttribution: Alan D. commentedRe-roll.
Any rtbtc & she will be committed. It's the select list and titles. Both default and I18N versions should be checked.
Notes:
check_plain(t()) used as t() accepts unescaped characters.
t() with context "name:options:{$key}" added to options (autocomplete & select lists)
Comment #15
Liam MorlandPlease put your patch into an issue fork.
Comment #16
natew CreditAttribution: natew commentedre-roll for name 1.12