SAAS-1126: Make player widget localizable

This commit is contained in:
drigato 2015-10-21 16:14:36 -04:00
parent b98f573531
commit cb8c34c3d5
4 changed files with 17 additions and 7 deletions

View File

@ -29,6 +29,7 @@ class EmbedController extends Zend_Controller_Action
$this->view->muses_swf = Application_Common_HTTPHelper::getStationUrl() . "js/airtime/player/muses.swf";
$this->view->metadata_api_url = Application_Common_HTTPHelper::getStationUrl() . "api/live-info";
$this->view->player_title = json_encode($this->view->escape($request->getParam('title')));
$this->view->jquery_i18n = Application_Common_HTTPHelper::getStationUrl() . "js/i18n/jquery.i18n.js?";
$styleParam = $request->getParam('style');
$player_style = isset($styleParam) ? $styleParam : "basic";

View File

@ -424,7 +424,12 @@ class LocaleController extends Zend_Controller_Action
": activate to sort column ascending",
": activate to sort column descending",
//End of datatables
"Welcome to the new Airtime Pro!" => _("Welcome to the new Airtime Pro!")
"Welcome to the new Airtime Pro!" => _("Welcome to the new Airtime Pro!"),
//embed player
"On Air" => _("On Air"),
"Off Air" => _("Off Air"),
"Offline" => _("Offline"),
"Nothing scheduled" => _("Nothing scheduled")
);
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

View File

@ -5,8 +5,12 @@
<link rel="stylesheet" href="<?php echo $this->css?>" type="text/css">
<script src="<?php echo $this->mrp_js?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery?>" type="text/javascript"></script>
<script src="<?php echo $this->jquery_i18n?>" type="text/javascript"></script>
<script src="/locale/general-translation-table" type="text/javascript"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'>
<script type="text/javascript">
$.i18n.setDictionary(general_dict);
var RETRY_DELAY_MSECS = 2000; //Delay before trying to reconnect to stream after an error.
var MAX_MOBILE_SCREEN_WIDTH = 760;
@ -280,9 +284,9 @@
if (data.current === null) {
if (data.currentShow != null && data.currentShow.length > 0) {
//Master/show source have no current track but they do have a current show.
$("p.now_playing").html("On Air:" + "<span>" + data.currentShow[0].name + "</span>");
$("p.now_playing").html($.i18n._("On Air") + "<span>" + data.currentShow[0].name + "</span>");
} else {
$("p.now_playing").html("Off Air" + "<span>Offline</span>");
$("p.now_playing").html($.i18n._("Off Air") + "<span>"+ $.i18n._("Offline") + "</span>");
}
time_to_next_track_starts = 20000;
} else {
@ -311,7 +315,7 @@
}
if (data.next === null) {
$("ul.schedule_list").find("li").html("Nothing scheduled");
$("ul.schedule_list").find("li").html($.i18n._("Nothing scheduled"));
} else {
$("ul.schedule_list").find("li").html(data.next.name);
}
@ -364,7 +368,7 @@
<div style="clear:both"></div>
<div class="airtime_schedule">
<p class="airtime_next">Next</p>
<p class="airtime_next"><?php echo _("Next") ?></p>
<ul class="schedule_list">
<li></li>
</ul>

View File

@ -9,8 +9,8 @@
</div>
<div id="player_instructions">
Customize the player by configuring the options below. When you are done,
copy the embeddable code below and paste it into your website's HTML.
<?php echo _("Customize the player by configuring the options below. When you are done,
copy the embeddable code below and paste it into your website's HTML.") ?>
</div>
<?php echo $this->element->getElement('player_title')->render(); ?>