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 @@
@@ -87,7 +87,7 @@
diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index e21347cb3..ec81cbfb9 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -117,7 +117,7 @@
@@ -161,7 +161,7 @@
diff --git a/airtime_mvc/application/views/scripts/form/showbuilder.phtml b/airtime_mvc/application/views/scripts/form/showbuilder.phtml index af6791714..8b2936e4e 100644 --- a/airtime_mvc/application/views/scripts/form/showbuilder.phtml +++ b/airtime_mvc/application/views/scripts/form/showbuilder.phtml @@ -4,7 +4,7 @@ element->getElement('sb_time_end'); ?> - +
diff --git a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml index 7b6ccf0fd..92bb40fe1 100644 --- a/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml +++ b/airtime_mvc/application/views/scripts/form/smart-block-criteria.phtml @@ -130,7 +130,7 @@ - 0 + 0 ;">
@@ -58,7 +58,7 @@
- (for verification purposes only, will not be published) +
element->getElement('Phone') ?> @@ -148,7 +148,7 @@ element->getElement('Logo') ?>
-

+

element->getElement('Logo')->hasErrors()) : ?>
    diff --git a/airtime_mvc/application/views/scripts/partialviews/header.phtml b/airtime_mvc/application/views/scripts/partialviews/header.phtml index e43dbc262..0432dcee9 100644 --- a/airtime_mvc/application/views/scripts/partialviews/header.phtml +++ b/airtime_mvc/application/views/scripts/partialviews/header.phtml @@ -3,7 +3,7 @@
    -
    +
@@ -42,7 +42,7 @@
  • -
    +
    scheduled_play_switch?>
    diff --git a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js index d25ad32c6..50141eeac 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js @@ -30,11 +30,11 @@ var AIRTIME = (function(AIRTIME) { var objType = $('#obj_type').val(), btnText; if (objType === 'playlist') { - btnText = $.i18n._(' Add to current playlist'); + btnText = ' '+$.i18n._('Add to current playlist'); } else if (objType === 'block') { - btnText = $.i18n._(' Add to current smart block'); + btnText = ' '+$.i18n._('Add to current smart block'); } else { - btnText = $.i18n._(' Add to current playlist'); + btnText = ' '+$.i18n._('Add to current playlist'); } AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText); }; diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index 8e77fc50b..60958f9bd 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -21,7 +21,7 @@ var AIRTIME = (function(AIRTIME) { AIRTIME.button.disableButton("btn-group #library-plus", false); } - AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), $.i18n._(' Add to selected show')); + AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), ' '+$.i18n._('Add to selected show')); }; mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { diff --git a/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COLUMN_FILTER b/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COLUMN_FILTER index 6ad517869..d62d5ecb1 100644 --- a/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COLUMN_FILTER +++ b/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COLUMN_FILTER @@ -88,13 +88,13 @@ denise@denise-DX4860:~/airtime/airtime_mvc/public/js/datatables/plugin$ diff -u + + var label = ""; + if (th.attr('id') == "bit_rate") { -+ label = $.i18n._(" kbps"); ++ label = $.i18n._("kbps"); + } else if (th.attr('id') == "utime" || th.attr('id') == "mtime" || th.attr('id') == "lptime") { -+ label = $.i18n._(" yyyy-mm-dd"); ++ label = $.i18n._("yyyy-mm-dd"); + } else if (th.attr('id') == "length") { -+ label = $.i18n._(" hh:mm:ss.t"); ++ label = $.i18n._("hh:mm:ss.t"); + } else if (th.attr('id') == "sample_rate") { -+ label = $.i18n._(" kHz"); ++ label = $.i18n._("kHz"); + } + th.html(_fnRangeLabelPart(0)); diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js b/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js index 871b375af..07c8bba72 100644 --- a/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js +++ b/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js @@ -184,13 +184,13 @@ var label = ""; if (th.attr('id') == "bit_rate") { - label = $.i18n._(" kbps"); + label = $.i18n._("kbps"); } else if (th.attr('id') == "utime" || th.attr('id') == "mtime" || th.attr('id') == "lptime") { - label = $.i18n._(" yyyy-mm-dd"); + label = $.i18n._("yyyy-mm-dd"); } else if (th.attr('id') == "length") { - label = $.i18n._(" hh:mm:ss.t"); + label = $.i18n._("hh:mm:ss.t"); } else if (th.attr('id') == "sample_rate") { - label = $.i18n._(" kHz"); + label = $.i18n._("kHz"); } th.html(_fnRangeLabelPart(0));