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.
Variables terms_of_use_fieldset_name and terms_of_use_checkbox_label should be declared in order to be used by the Variable project (see http://www.drupal.org/project/variable). Attached is a file that can be added to the module in order to declare those variables (to be renamed to terms_of_use.variable.inc)
The main advantage of declaring these variables is the possibility to translate the texts "Terms of Use" and "I agree with these terms"
Comment | File | Size | Author |
---|---|---|---|
#18 | terms_of_use-variables-1181458-16.patch | 5.46 KB | akalam |
#16 | terms_of_use-variables-1181458-16.patch | 5.73 KB | KevinVb |
#11 | terms_of_use-variables-1181458-11.patch | 1.09 KB | guillaumev |
#8 | 1181458-do-not-translate-link.patch | 1.27 KB | jramby |
#5 | 1181458-Variables-should-be-declared-for-translation.patch | 2.29 KB | Haza |
Comments
Comment #1
dddave CreditAttribution: dddave commentedsub
Comment #2
tahiticlic CreditAttribution: tahiticlic commentedThanks for the patch, works great.
Comment #3
peteruithoven CreditAttribution: peteruithoven commentedWorks, but I was also missing the node title option. Since this delivers the content, this should be multilingual too.
Comment #4
jocken CreditAttribution: jocken commentedI just discovered why this wasn't working. Until a patch is ready (I don't know how to do that), this is the solution:
file: terms_of_use.module
around row 58
Should be
around row 112
Should be:
Hope someone with a little more knowledge could make this to a patch:)
Comment #5
HazaI made a patch from above.
(patch need to be applied using "git am < file.patch")
Comment #6
guillaumev CreditAttribution: guillaumev commentedI just tested the patch and it works just fine... Ready To Be Committed ?
Comment #7
Schnitzel CreditAttribution: Schnitzel commented+1 works for me
Comment #8
jramby CreditAttribution: jramby commentedHi, thanks for the patch.
I tested it and I tried to translate my text with "@link" in the "label for the checkbox". It shows the HTML link in interface translation page. So I've done this patch to make translation available just for the text with "@link" and not with link that is already handled by the module itself.
Tests are welcome!
Thanks.
Comment #9
jramby CreditAttribution: jramby commentedOoops!... this #8 comment patch comes with the first patch
Comment #10
Kars-T CreditAttribution: Kars-T commentedHi
working with the variables module would be nice but I refuse a patch that can put strings in other languages than english into t() like the one in #5 is doing. Please reroll the patch with an update to the latest variables module so the strings can be translated.
Comment #11
guillaumev CreditAttribution: guillaumev commentedThere might be something that I'm missing here but for me, it works just by declaring the variables: you then just have to have the variable module enabled and you can then translate easily the checkbox and fieldset labels... I'm therefore proposing this patch which just declares the variables...
Comment #12
poiu CreditAttribution: poiu commented#11 looks good and works for me.
Comment #13
Rustan CreditAttribution: Rustan commented#5 works for me, but not #11. Using 1.2.
Comment #14
bryanmanalo CreditAttribution: bryanmanalo as a volunteer commentedAccording to this blog post, #5 should not be used.
I used #11 and it works. Just make sure:
1. Variable translation module must be enabled.
2. In admin/config/regional/i18n/variable , under "Other" subtab, mark the variable as translatable.
3. In /admin/config/system/variable/module, under Terms of use subtab, this is where you actually translate the variable.
Hope this helps
Comment #15
Triumphent CreditAttribution: Triumphent commentedLike @bryanmanalo said (#14,) if you follow his short guide, you won't fail!
Comment #16
KevinVb CreditAttribution: KevinVb commentedHi,
I started with the patch of #11
But it doesn't cover the whole functionality. I extended it so the node id and title are also available as translated variables.
Because the administration was using AJAX to change the form elements and it was saving variables during form_validate the node_id translation wouldn't work.
I changed the flow of the form so the node id is a hidden value and it is only possible to apply the node with the node title.
During validate we then change the value of the node id.
So form submit can handle the multilingual variable.
This way it is possible to show a different node for each language.
Comment #18
akalam CreditAttribution: akalam at Atenea tech commentedLast patch does not apply against last dev
Comment #19
AlfTheCat CreditAttribution: AlfTheCat commentedTried patch #18 and now re-saved the module settings. Ran cron, flushed caches.
I get a new string for the admin description of the Label for the checkbox field. But the field itself is not translatable.
I thought it worked before, maybe i18n has gone through a change.... But I can no longer translate strings for this module, except for the one admin description this patch exposes.
Am curious as to what has happened...
Comment #20
AlfTheCat CreditAttribution: AlfTheCat commentedUpdating status
Comment #21
AlfTheCat CreditAttribution: AlfTheCat commentedhad another go at this and turned out i needed to enable the variable admin module to be able to translate the variable as per #15.
Comment #22
AlfTheCat CreditAttribution: AlfTheCat commentedupdating status
Comment #25
ivnish CreditAttribution: ivnish commentedNeeds to reroll the patch against the latest dev
Comment #26
ivnish CreditAttribution: ivnish commentedClosed due to inactivity. If it is relevant, we will open it again