From c2deb94c16bb5a048815fc55a5f18e4afdeaedaa Mon Sep 17 00:00:00 2001 From: Lucas Bickel Date: Fri, 24 Mar 2017 17:23:21 +0100 Subject: [PATCH] Make radio page translatable This makes the radio page use the station default language if one is set. Previously the pages where not really getting translated. --- .../application/controllers/EmbedController.php | 10 ++++++---- .../application/controllers/IndexController.php | 6 ++++++ .../application/views/scripts/embed/player.phtml | 2 +- .../views/scripts/embed/weekly-program.phtml | 4 ++-- .../application/views/scripts/index/index.phtml | 16 ++++++++-------- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/airtime_mvc/application/controllers/EmbedController.php b/airtime_mvc/application/controllers/EmbedController.php index eba37c93c..dbe12cb0b 100644 --- a/airtime_mvc/application/controllers/EmbedController.php +++ b/airtime_mvc/application/controllers/EmbedController.php @@ -2,11 +2,13 @@ class EmbedController extends Zend_Controller_Action { - public function init() - { - + public function init() { + // translate widgets to station default language + $locale = Application_Model_Preference::GetDefaultLocale(); + if ($locale) { + Application_Model_Locale::configureLocalization($locale); + } } - /** * This is the action that is called to insert the player onto a web page. * It passes all the js and css files to the view, as well as all the diff --git a/airtime_mvc/application/controllers/IndexController.php b/airtime_mvc/application/controllers/IndexController.php index 8a04b85ca..619b85bd8 100644 --- a/airtime_mvc/application/controllers/IndexController.php +++ b/airtime_mvc/application/controllers/IndexController.php @@ -34,6 +34,12 @@ class IndexController extends Zend_Controller_Action $this->_helper->layout->setLayout('radio-page'); + // translate page to station default language + $locale = Application_Model_Preference::GetDefaultLocale(); + if ($locale) { + Application_Model_Locale::configureLocalization($locale); + } + $this->view->stationLogo = Application_Model_Preference::GetStationLogo(); $stationName = Application_Model_Preference::GetStationName(); diff --git a/airtime_mvc/application/views/scripts/embed/player.phtml b/airtime_mvc/application/views/scripts/embed/player.phtml index c14de15e2..853dbddc1 100644 --- a/airtime_mvc/application/views/scripts/embed/player.phtml +++ b/airtime_mvc/application/views/scripts/embed/player.phtml @@ -395,7 +395,7 @@
  • - Powered by + diff --git a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml index 59202bf26..548f9e233 100644 --- a/airtime_mvc/application/views/scripts/embed/weekly-program.phtml +++ b/airtime_mvc/application/views/scripts/embed/weekly-program.phtml @@ -84,7 +84,7 @@
    -
    Looks like there are no shows scheduled on this day.
    +
    {{show.show_start_hour}} - {{show.show_end_hour}}
    {{show.name}}
    @@ -93,7 +93,7 @@
    diff --git a/airtime_mvc/application/views/scripts/index/index.phtml b/airtime_mvc/application/views/scripts/index/index.phtml index 37e304def..6ae9d4fb7 100644 --- a/airtime_mvc/application/views/scripts/index/index.phtml +++ b/airtime_mvc/application/views/scripts/index/index.phtml @@ -24,14 +24,14 @@ echo ""; } ?> - displayLoginButton) { - echo ""; - }?> + displayLoginButton): ?> + +