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 tried to translate the following strings via core translation:
"Terms of Use" --> Found and translated
"Click here to read the full disclaimer" --> not found
"I agree with these terms" --> Found and translated
Even if I can tranlate 2 of 3 strings, they are not displayed when I change the language, they are always in english.
How can I translate them in multiple languages?
Comment | File | Size | Author |
---|---|---|---|
#4 | 2281563-4-site_disclaimer-7.x-1.x-translate-checkbox-text.patch | 667 bytes | alberto56 |
Comments
Comment #1
bisonbleu CreditAttribution: bisonbleu commentedSame issue. Terms of Use is translated but always appears in English.
Comment #2
alberto56 CreditAttribution: alberto56 commentedBetter title for this issue.
Comment #3
alberto56 CreditAttribution: alberto56 at Dcycle commentedThere is currently a function "_site_disclaimer_variable_get_translated", only "Terms of Use" uses it, not "I agree with these terms".
It uses i18n_variable, not the default Drupal string translation mechanism.
If you want to translate only "Terms of Use", you can follow the instructions below starting at (2).
If you want to translate "I agree with these terms" also, you must follow the instructions below including point (1).
If you have followed steps 2 to 6, and then applied the patch after, you must follow all the steps again.
For this to work:
(1) Apply the enclosed patch if it has not yet been applied to this module.
(2) Install and enable i18n's i18n_variable module.
(3) Go to admin/config/regional/i18n/variable
(4) Check all checkboxes and save
(5) Go to admin/config/people/site_disclaimer
(6) Notice that there is a new "THERE ARE MULTILINGUAL VARIABLES IN THIS FORM" section in the form, click on the language to which you want to translate, and change the values in the form, and save.
It should work now!
Comment #4
alberto56 CreditAttribution: alberto56 at Dcycle commentedHere is the patch
Comment #5
ybabel CreditAttribution: ybabel commentedworked for me
Comment #6
iva2k CreditAttribution: iva2k commentedPatch looks reasonable, need to roll it in.
Comment #7
Scott Robertson CreditAttribution: Scott Robertson commentedCommitted, thanks!