CC-1960: Internationalize Airtime / Support translations

-added gettext wrapper functions for all strings in view/scripts, and forms
This commit is contained in:
denise 2012-11-15 10:59:06 -05:00
parent f0e2d5d295
commit b173b6dda4
78 changed files with 481 additions and 423 deletions

View file

@ -17,7 +17,7 @@ class Application_Form_SupportSettings extends Zend_Form
//Station name
$this->addElement('text', 'stationName', array(
'class' => 'input_text',
'label' => 'Station Name',
'label' => _('Station Name'),
'required' => true,
'filters' => array('StringTrim'),
'validator' => array('NotEmpty'),
@ -30,7 +30,7 @@ class Application_Form_SupportSettings extends Zend_Form
// Phone number
$this->addElement('text', 'Phone', array(
'class' => 'input_text',
'label' => 'Phone:',
'label' => _('Phone:'),
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetPhone(),
@ -42,7 +42,7 @@ class Application_Form_SupportSettings extends Zend_Form
//Email
$this->addElement('text', 'Email', array(
'class' => 'input_text',
'label' => 'Email:',
'label' => _('Email:'),
'required' => false,
'filters' => array('StringTrim'),
'value' => Application_Model_Preference::GetEmail(),
@ -53,7 +53,7 @@ class Application_Form_SupportSettings extends Zend_Form
// Station Web Site
$this->addElement('text', 'StationWebSite', array(
'label' => 'Station Web Site:',
'label' => _('Station Web Site:'),
'required' => false,
'class' => 'input_text',
'value' => Application_Model_Preference::GetStationWebSite(),
@ -64,7 +64,7 @@ class Application_Form_SupportSettings extends Zend_Form
// county list dropdown
$this->addElement('select', 'Country', array(
'label' => 'Country:',
'label' => _('Country:'),
'required' => false,
'value' => Application_Model_Preference::GetStationCountry(),
'multiOptions' => $country_list,
@ -75,7 +75,7 @@ class Application_Form_SupportSettings extends Zend_Form
// Station city
$this->addElement('text', 'City', array(
'label' => 'City:',
'label' => _('City:'),
'required' => false,
'class' => 'input_text',
'value' => Application_Model_Preference::GetStationCity(),
@ -87,7 +87,7 @@ class Application_Form_SupportSettings extends Zend_Form
// Station Description
$description = new Zend_Form_Element_Textarea('Description');
$description->class = 'input_text_area';
$description->setLabel('Station Description:')
$description->setLabel(_('Station Description:'))
->setRequired(false)
->setValue(Application_Model_Preference::GetStationDescription())
->setDecorators(array('ViewHelper'))
@ -97,7 +97,7 @@ class Application_Form_SupportSettings extends Zend_Form
// Station Logo
$upload = new Zend_Form_Element_File('Logo');
$upload->setLabel('Station Logo:')
$upload->setLabel(_('Station Logo:'))
->setRequired(false)
->setDecorators(array('File'))
->addValidator('Count', false, 1)
@ -108,7 +108,7 @@ class Application_Form_SupportSettings extends Zend_Form
//enable support feedback
$this->addElement('checkbox', 'SupportFeedback', array(
'label' => 'Send support feedback',
'label' => _('Send support feedback'),
'required' => false,
'value' => Application_Model_Preference::GetSupportFeedback(),
'decorators' => array(
@ -118,7 +118,7 @@ class Application_Form_SupportSettings extends Zend_Form
// checkbox for publicise
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')
$checkboxPublicise->setLabel(_('Promote my station on Sourcefabric.org'))
->setRequired(false)
->setDecorators(array('ViewHelper'))
->setValue(Application_Model_Preference::GetPublicise());
@ -143,7 +143,10 @@ class Application_Form_SupportSettings extends Zend_Form
// checkbox for privacy policy
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
$checkboxPrivacy->setLabel(
sprintf(_("By checking this box, I agree to Sourcefabric's %sprivacy policy%s."),
"<a id='link_to_privacy' href='http://www.sourcefabric.org/en/about/policy/' onclick='window.open(this.href); return false;'>",
"</a>"))
->setDecorators(array('ViewHelper'));
$this->addElement($checkboxPrivacy);
@ -151,7 +154,7 @@ class Application_Form_SupportSettings extends Zend_Form
$submit = new Zend_Form_Element_Submit("submit");
$submit->class = 'ui-button ui-state-default right-floated';
$submit->setIgnore(true)
->setLabel("Save")
->setLabel(_("Save"))
->setDecorators(array('ViewHelper'));
$this->addElement($submit);
}
@ -166,7 +169,7 @@ class Application_Form_SupportSettings extends Zend_Form
if (isset($data["Privacy"])) {
$checkPrivacy = $this->getElement('Privacy');
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
$checkPrivacy->addError("You have to agree to privacy policy.");
$checkPrivacy->addError(_("You have to agree to privacy policy."));
$isValid = false;
}
}