diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
index 4c08f14b7..7d9e1efcf 100644
--- a/airtime_mvc/application/controllers/LocaleController.php
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -46,8 +46,8 @@ class LocaleController extends Zend_Controller_Action
"This version is no longer supported." => _("This version is no longer supported."),
"Please upgrade to " => _("Please upgrade to "),
//library/events/library_playlistbuilder.js
- " Add to current playlist" => _(" Add to current playlist"),
- " Add to current smart block" => _(" Add to current smart block"),
+ "Add to current playlist" => _("Add to current playlist"),
+ "Add to current smart block" => _("Add to current smart block"),
"Adding 1 Item" => _("Adding 1 Item"),
"Adding %s Items" => _("Adding %s Items"),
"You can only add tracks to smart blocks." => _("You can only add tracks to smart blocks."),
@@ -57,7 +57,7 @@ class LocaleController extends Zend_Controller_Action
//"Adding 1 Item" => _("Adding 1 Item"),
//"Adding %s Items" => _("Adding %s Items"),
//library/library.js
- " Add to selected show" => _(" Add to selected show"),
+ "Add to selected show" => _("Add to selected show"),
"Select" => _("Select"),
"Select this page" => _("Select this page"),
"Deselect this page" => _("Deselect this page"),
@@ -311,10 +311,10 @@ class LocaleController extends Zend_Controller_Action
"Show / hide columns" => _("Show / hide columns"),
//datatables.columnFilter.js
"From {from} to {to}" => _("From {from} to {to}"),
- " kbps" => _(" kbps"),
- " yyyy-mm-dd" => _(" yyyy-mm-dd"),
- " hh:mm:ss.t" => _(" hh:mm:ss.t"),
- " kHz" => _(" kHz"),
+ "kbps" => _("kbps"),
+ "yyyy-mm-dd" => _("yyyy-mm-dd"),
+ "hh:mm:ss.t" => _("hh:mm:ss.t"),
+ "kHz" => _("kHz"),
//datepicker
//months are already in schedule/schedule.js
"Su" => _("Su"),
diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php
index 059fe2bda..c8622d5b3 100644
--- a/airtime_mvc/application/forms/GeneralPreferences.php
+++ b/airtime_mvc/application/forms/GeneralPreferences.php
@@ -45,7 +45,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
$third_party_api = new Zend_Form_Element_Radio('thirdPartyApi');
$third_party_api->setLabel(
- sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.'), '
'));
+ sprintf(_('Allow Remote Websites To Access "Schedule" Info?%s (Enable this to make front-end widgets work.)'), '
'));
$third_party_api->setMultiOptions(array(_("Disabled"),
_("Enabled")));
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php
index 546d1650e..975ee3516 100644
--- a/airtime_mvc/application/forms/LiveStreamingPreferences.php
+++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php
@@ -81,11 +81,12 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$this->addElement($live_dj_connection_url);
//liquidsoap harbor.input port
+ $betweenValidator = Application_Form_Helper_ValidationTypes::overrideBetweenValidator(1024, 49151);
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
$master_dj_port = new Zend_Form_Element_Text('master_harbor_input_port');
$master_dj_port->setLabel(_("Master Source Port"))
->setValue($m_port)
- ->setValidators(array(new Zend_Validate_Between(array('min'=>1024, 'max'=>49151))))
+ ->setValidators(array($betweenValidator))
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))))
->setDecorators(array('ViewHelper'));
$this->addElement($master_dj_port);
@@ -104,7 +105,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$live_dj_port = new Zend_Form_Element_Text('dj_harbor_input_port');
$live_dj_port->setLabel(_("Show Source Port"))
->setValue($l_port)
- ->setValidators(array(new Zend_Validate_Between(array('min'=>1024, 'max'=>49151))))
+ ->setValidators(array($betweenValidator))
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))))
->setDecorators(array('ViewHelper'));
$this->addElement($live_dj_port);
diff --git a/airtime_mvc/application/forms/StreamSettingSubForm.php b/airtime_mvc/application/forms/StreamSettingSubForm.php
index df61bb9ec..c5d8a19b2 100644
--- a/airtime_mvc/application/forms/StreamSettingSubForm.php
+++ b/airtime_mvc/application/forms/StreamSettingSubForm.php
@@ -191,7 +191,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$user->setAttrib('alt', 'regular_text');
$this->addElement($user);
- $liquidsopa_error_msg = '
Getting information from the server...
';
+ $liquidsopa_error_msg = ''._('Getting information from the server...').'
';
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "enabled"=>$enable->getValue(), "liquidsoap_error_msg"=>$liquidsopa_error_msg))
diff --git a/airtime_mvc/application/forms/SupportSettings.php b/airtime_mvc/application/forms/SupportSettings.php
index ecad67bb3..4662a08ae 100644
--- a/airtime_mvc/application/forms/SupportSettings.php
+++ b/airtime_mvc/application/forms/SupportSettings.php
@@ -8,6 +8,7 @@ class Application_Form_SupportSettings extends Zend_Form
public function init()
{
$country_list = Application_Model_Preference::GetCountryList();
+ $notEmptyValidator = Application_Form_Helper_ValidationTypes::overrideNotEmptyValidator();
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
@@ -20,7 +21,7 @@ class Application_Form_SupportSettings extends Zend_Form
'label' => _('Station Name'),
'required' => true,
'filters' => array('StringTrim'),
- 'validator' => array('NotEmpty'),
+ 'validators' => array($notEmptyValidator),
'value' => Application_Model_Preference::GetStationName(),
'decorators' => array(
'ViewHelper'
diff --git a/airtime_mvc/application/forms/helpers/ValidationTypes.php b/airtime_mvc/application/forms/helpers/ValidationTypes.php
index 23aebba4b..6211a14b5 100644
--- a/airtime_mvc/application/forms/helpers/ValidationTypes.php
+++ b/airtime_mvc/application/forms/helpers/ValidationTypes.php
@@ -61,11 +61,23 @@ Class Application_Form_Helper_ValidationTypes {
);
$validator->setMessage(
- _("'%value%' is less than %max% characters long"),
+ _("'%value%' is more than %max% characters long"),
Zend_Validate_StringLength::TOO_LONG
);
return $validator;
}
+ public static function overrideBetweenValidator($p_min, $p_max)
+ {
+ $validator = new Zend_Validate_Between($p_min, $p_max, true);
+
+ $validator->setMessage(
+ _("'%value%' is not between '%min%' and '%max%', inclusively"),
+ Zend_Validate_Between::NOT_BETWEEN
+ );
+
+ return $validator;
+ }
+
}
\ No newline at end of file
diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php
index 10a6c49d8..916bc1deb 100644
--- a/airtime_mvc/application/models/Preference.php
+++ b/airtime_mvc/application/models/Preference.php
@@ -466,7 +466,7 @@ class Application_Model_Preference
$sql = "SELECT * FROM cc_country";
$res = $con->query($sql)->fetchAll();
$out = array();
- $out[""] = "Select Country";
+ $out[""] = _("Select Country");
foreach ($res as $r) {
$out[$r["isocode"]] = $r["name"];
}
diff --git a/airtime_mvc/application/views/scripts/form/preferences_email_server.phtml b/airtime_mvc/application/views/scripts/form/preferences_email_server.phtml
index f898873f7..bcc6bb4c8 100644
--- a/airtime_mvc/application/views/scripts/form/preferences_email_server.phtml
+++ b/airtime_mvc/application/views/scripts/form/preferences_email_server.phtml
@@ -41,7 +41,7 @@