Closed (fixed)
Project:
Agreement
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2011 at 22:49 UTC
Updated:
3 Aug 2012 at 23:51 UTC
Hi,
Is there a ready made possibility to translate the agreement, button value and title?
If no, i'd like to request a help about how to implement this.
thanks
Comments
Comment #1
carvalhar commentedI had to edit agreement.module at function agreement_form (line 406).
I changed these two lines to include t() (and then translate them using localized strings):
'#title' => check_plain(variable_get('agreement_checkbox_text', AGREEMENT_CHECKBOX_TEXT)),
to
'#title' => check_plain(t(variable_get('agreement_checkbox_text', AGREEMENT_CHECKBOX_TEXT))),
and for the button:
'#value' => check_plain(variable_get('agreement_submit_text', AGREEMENT_SUBMIT_TEXT)),
to
'#value' => check_plain(t(variable_get('agreement_submit_text', AGREEMENT_SUBMIT_TEXT))),
I could do the same for Agreement Text, but i don't like the idea to use t() function.
This text will always be a big text and mainly, it can change only with one language.
If i use t(), the bond would broke if the original language text change but the translated text don't.
I think that this agreement text should be a node, and then translated for many languages but I'm not sure how to set a node for this.
The agreement text is loaded at function agreement_page:
$text = check_markup(variable_get('agreement_text', ''), variable_get('agreement_format', AGREEMENT_FORMAT), FALSE);
Any help about how to solve this?
thanks
Comment #2
pagaille commentedI don't know how this issue slipped through the cracks - I apologize for the extremely delayed response! All of those values are run through the translation function and have been since rc1.