Here is the scenario:
- Entity translation is enabled on webform node types
- A single form is created and the strings translation option is on
- A confirmation message is set on the node while browsing in the sites default language
- The string is translated using the translate interface
- A user switches to French
- Edits the webform settings
- The confirmation message appears in French (as it has been translated)
- User saves the webform form settings
- The confirmation message is now in French for all languages
Basically, since the form settings page isn't language aware, it overrides the default language string with the loaded translation when you save in any other language.
I suggest we disable form settings fields which are translated to prevent them from being saved. Meaning those fields can only be edited in the sites default language.
Patch to follow.
Comments
Comment #1
dave bagler commentedThis patch removes the webform menu from the webform's local tasks if the user's current language is not the site's default language. It also implements hook_node_presave() to check if the user is editing the node the webform is attached to in a language other than the site's default language and if so resets the confirmation and submit text in the node object to the default language's confirmation and submit text.
Comment #1.0
dave bagler commentedAdded list
Comment #2
Alienpruts commentedI'm having the same problems with my confirmation strings but ALSO with the Submit button texts. I'll try this patch and conduct some further tests.
(Oh yeah, tnx for the patch :) )
EDIT :
While testing I've found that my labels are having this problem as well.......
EDIT 2 :
Seems all is well after your patch...
The labels that changed from one language to the other was my fault really : to better test the patch I changed the default language, so the labels had to be "re-translated" from the default language to my second one.
Tnx again for the patch :)
Comment #3
GDrupal commentedThank you all for all the work on this issue!
I solve this in a different way, perhaps less messy for me.
Check my last commit and let me know how it goes.
http://drupalcode.org/project/webform_localization.git/commit/d89ba9e
Comment #5
mducharme commentedThis issue is still happening. Exact same description as the original. All of my default language strings are replaced after being translated.
Both 'Expose webform component strings suitable for translation.' and 'Keep a single webform across a translation set.' are checked.
Comment #6
mducharme commentedSorry, I had the 1.x version of this module in place. Upgraded to 4.x now. My bad.
Comment #7
mducharme commentedI switched to the 4.x branch but again, this issue is still happening.
Comment #8
mducharme commentedThe patch still works to fix the variables on the form settings page. What was committed did not fix these. I've updated the patch to fix some white-space issues and to add the 'redirect_url' variable in addition to the 'confirmation' and 'submit_text' that was in the previous patch.
Comment #10
joseph.olstadis patch 8 still required? it does apply cleanly. looking for a review.
Comment #12
rodlangh commentedSeems to be related to Issue 2604562
Looks like the same problem is described as in point 4:
As that patch has been submitted, this issue should be resolved as well.
Comment #13
joseph.olstadlets close this as a duplicate then
Rodlangh, thanks for checking!