I am unable to add tokens into the translated strings for the purpose of having different tokens (or the same) per translation of the page.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | webform_localization-add_tokens-1812776-15.patch | 4.25 KB | joseph.olstad |
I am unable to add tokens into the translated strings for the purpose of having different tokens (or the same) per translation of the page.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | webform_localization-add_tokens-1812776-15.patch | 4.25 KB | joseph.olstad |
Comments
Comment #1
superspring commentedHere is a patch which allows this.
Comment #2
liuba commentedThank you, superspring, for the patch.
Here is another patch that should be applied straight after superspring's patch to fix an issue with mark up component translation
Comment #3
liuba commentedRolling the patch from the module directory, this is to replace patch in #2
Comment #4
liuba commentedOne more patch to integrate the fixes with the patch to resolve Unnecessary check_plain() for radio labels and select options via i18n_string() issue
Comment #5
jweowu commented#1781266: Unnecessary check_plain() for radio labels and select options via i18n_string() was committed, so #4 can be ignored.
#1796748: Translation of markup component: HTML is parsed an printend out was committed, so #2 and #3 can be ignored (and in fact should never have been necessary -- the patch from that issue was committed before this issue ever existed, and the original patch here incorrectly reverted the commit. Adding new cumulative patches to resolve that mistake has just increased the confusion here).
Re-rolling the original patch.
Comment #6
jweowu commentedSwitching from
token_replace()towebform_replace_tokens(), which works in some situations where the other function didn't.Comment #7
joseph.olstadlets try testing patch 6
Comment #8
joseph.olstadComment #9
joseph.olstadComment #10
joseph.olstadpatch 6 needs a reroll
Comment #11
joseph.olstadHere's a rerolled patch **EDIT**
however the function webform_replace_tokens() doesn't existit might have been from a previous version of the webforms module or perhaps someone forgot to include it with the above patches.
there is something similar in the webforms module called _webform_filter_values()so still work to do but this patch should help get us closer.**EDIT** edit, ignore this, I was looking at the 3.x branch of webform which does not have the webform_replace_tokens function however the 7.x-4.x branch does indeed have this function.So, the patch could possibly work however these token replacements might not be necessary anymore because of recent fixes upstream to the webforms module. Still worth testing this out though, give it a try.
Comment #12
joseph.olstadthis is a really old issue, was tagged for the 1.x branch, might not be needed for the 4.x branch. Putting it to a test anyway though.
Comment #13
joseph.olstaddue to this commit for this issue:Refactor component localization process and add missing translations. the above patch very likely needs to be refactored.
Comment #14
joseph.olstadComment #15
joseph.olstadok, I refactored this patch, try testing it, I haven't tested it yet.
Comment #16
joseph.olstadlatest patch passes all tests
Comment #19
jweowu commentedHi joseph.olstad,
This is a slightly arbitrary place to mention it, but in your release notes and in comments like #13 above, you can/should use the special markup syntax for referring to issues, so that people can easily follow the links, and see the current status:
-- https://www.drupal.org/filter/tips
e.g. #1812776: Problems with Token Module and Webform Localization
Comment #20
joseph.olstadGreat tip jwoewu, yes I should have used that type of project reference, I will do that from now on thanks!
Comment #21
joseph.olstad***EDIT*** see the related issue:
#2760945: Double token replace on markup component breaks [submission:values:KEY] token
Comment #22
joseph.olstad