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.
I just noticed: "Form submission guidelines" in a form block always appear in the sites default language.
(on the stand alone form, translation works fine).
FIeld labels translate just fine.
Looking into it, if I find it I'll post back here
Comments
Comment #1
rv0 CreditAttribution: rv0 commentedFound and tested the following fix, seems to work nice:
in formblock.module, line 135, change the line to:
just added a t() tag.
Comment #2
Greg BoggsThis works for me. Possibly related I couldn't translate the form string above the help. Luckily, I just hid that field and used the help field as the title.
Comment #3
mikey_p CreditAttribution: mikey_p commentedThe documentation for t() indicates that user content should not pass through t():
Comment #4
mikey_p CreditAttribution: mikey_p commentedComment #5
Greg BoggsIn this case, the string goes through filter xss admin which prevents JavaScript from being entered as a translation or as a user value.
Does t() really circumvent admin_xss_filter()?
Comment #6
cs_shadow CreditAttribution: cs_shadow commentedAs far as I can tell, since the string passes through
filter_xss_admin()
, its safe to uset()
function in this case.Comment #7
rv0 CreditAttribution: rv0 commentedIf it is user-entered text, it should never, ever run through t().. regardless of what I said above in 2011 ;)
Comment #8
Greg BoggsThere are lines of code not 3 lines below this one where user text is run through t(); Perhaps we should fix both?
I'm familiar with the code for a Drupal global variable translation, but this is a local function variable only used to temporarily store a string for output. So, I'm not sure how to approach translating that if not the t(); function.
Comment #9
mikey_p CreditAttribution: mikey_p commentedComment #10
joseph.olstadTo fix this would have to check module_exists for entity_translation and module_exists for the tid approach to translation and then check to see which version of translation is being used by the node then load the translated node through tid if it's the tid approach or load the entity translation by the current interface language if it's the entity_translation approach just prior to the "['content']['help'] code in
function formblock_get_block($type)
this way you'd not have to use the t function at all.