Closed (fixed)
Project:
Webform
Version:
6.x-3.9
Component:
Translation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jan 2011 at 08:05 UTC
Updated:
2 Apr 2012 at 09:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchI'm not clear on where the "Name" field comes from here. Is that a field on the node/x/edit page or is it a field in the webform that you've created?
Comment #2
kartagisIt's a field on the webform that I've created.
Comment #3
quicksketchOkay looks like Webform is translating the component name improperly (in multiple ways). First, we're using the t() function here when we should probably be using i18n module's tt() function. Secondly, we're translating the label on components as part of node_load(), when we really should only be translating when displaying the label. Otherwise the translated version of the label may show up when you're editing the component.
Comment #4
sethiele commentedI submitted this patch already in #245424: Make Webform multilingual (i18n) aware through contributed modules
This patch adds two lines that let the Names (labels) of field translated in the backend.
For version 7.x-3.9
Comment #5
kartagisHello,
I installed the 6.x-3.9 yesterday, and this problem persists.
Comment #6
kartagisMy bad, I was looking at the wrong page. Changing to 'needs review' for #4.
Comment #7
quicksketchI'm still not comfortable with this approach, just shoving labels through t() is not really the right solution here. In Drupal 6, I think we need to remove the t() from webform_node_load() as it shouldn't be there and causes confusing and potentially damaging behavior as described in the original post here.
If users want to take the cheap/incomplete route of just running labels through t(), they can override theme_webform_element() in Drupal 7, but this approach doesn't work in Drupal 6 because theme_webform_element() doesn't get used for displaying forms. I think we're best off spending the time needed to actually build in true translation support into Webform, but no one is actually interested in (and capable of) implementing it.
Comment #8
quicksketchI posted a large master plan over in http://drupal.org/node/245424#comment-4873578, though as before I don't really have time/need to act on doing it the "right" way (nor does anyone else apparently).'
In any case, this patch fixes the "bug" but also removes functionality. As stated in the other issue, I really feel that the only true way to translate Webforms at this point is through multiple nodes, even though it's a huge hassle.
Comment #10
anrikun commentedNo please revert this!
Updating to 6.x-3.14 broke my labels that don't get translated any more.
This t() should not be removed unless full i18n support is added.
Comment #11
quicksketch@anrikun: I won't be adding it back as it's just outright *wrong* to translate the label like that. Not only is it incomplete (it doesn't translate descriptions, options, or any other strings), it actually can cause outright data corruption if people are editing Webform nodes in different languages.
Comment #12
anrikun commentedAll right. Thanks for your explanation.
Comment #13
tomsm commentedSorry, but I had to revert the patch #8 because my labels were not translated anymore after upgrading to 6.x-3.14.
I hope i18n support will be completed soon...
Comment #14
hovel commentedI had to take action too. After upgrading to 6.x-3.14 on a live website labels were no longer translated.
I solved the issue(s) as follows:
In file webform.module, at the begin of function _webform_client_form_add_component
i place this statement $component['name'] = t($component['name']);.
This results in the labels being translated in the submit-form and result-view page but not on the webform edit page.
Maybe t() is not the proper way to do translation, but at the moment it is the only way.
Comment #15
Marcus Aurelius commented@hovel: Thank you! You made my day!
Comment #16
giorgosk#14 it seems in 6.x-3.17 its no longer possible
but apparently
reverting #8 works