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.
Tooltips should be exported with a t()
function like other Views labels.
Comments
Comment #2
infojunkieAdded tooltip translatability, but dependent on #2290511: `unpack_translatable` not supported for display extenders to export translatable strings.
Comment #3
infojunkieComment #4
infojunkieComment #5
tanius CreditAttribution: tanius commentedI applied the patch for the parent issue #2290511: `unpack_translatable` not supported for display extenders, and use patch in this issue (or more precisely, the functional equivalent now contained in the current 7.x-1.x-dev version). And it seems this implementation is saving translatable strings with the correct context, but trying to look them up with an empty context, which fails. (Not sure if this is how the Drupal string translation system works internally, it's just how it appeared to me …)
In detail:
/admin/config/regional/translate/translate
) with text group "Built-in Interface" and an empty value for context.my_view_name:my_display_name:field_my_field_name:label_tooltip:text
in the "Translate interface" system.As a workaround, just don't apply the parent issue patch for now. This will not allow translating the same string differently in different places since the context is empty, but if that is not needed, it will work for now. One more hints for getting this workaround to work: the strings in text group "Built-in interface" will only appear in the "Translate interface" backend after you visited a non-English page on your site's frontend where the translated tooltip ought to appear. Visiting an English frontend page will not help, as no translation of the built-in interface is attempted there (it is assumed the built-in interface is always English in Drupal, independent of the default language you set).