CC-1960: Internationalize Airtime / Support translations

- added gettext wrapper function to all strings in controllers
This commit is contained in:
denise 2012-11-15 12:55:45 -05:00
parent e5f67c8b05
commit 5adadc2e91
12 changed files with 91 additions and 89 deletions

View File

@ -53,7 +53,7 @@ class ApiController extends Zend_Controller_Action
if (!in_array($api_key, $CC_CONFIG["apiKey"]) && if (!in_array($api_key, $CC_CONFIG["apiKey"]) &&
is_null(Zend_Auth::getInstance()->getStorage()->read())) { is_null(Zend_Auth::getInstance()->getStorage()->read())) {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.'; print _('You are not allowed to access this resource.');
exit; exit;
} }
} }
@ -80,7 +80,7 @@ class ApiController extends Zend_Controller_Action
if (is_null(Zend_Auth::getInstance()->getStorage()->read())) { if (is_null(Zend_Auth::getInstance()->getStorage()->read())) {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource.'; print _('You are not allowed to access this resource.');
return; return;
} }
@ -282,7 +282,7 @@ class ApiController extends Zend_Controller_Action
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
} else { } else {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource. '; print _('You are not allowed to access this resource. ');
exit; exit;
} }
} }
@ -321,7 +321,7 @@ class ApiController extends Zend_Controller_Action
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
} else { } else {
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
print 'You are not allowed to access this resource. '; print _('You are not allowed to access this resource. ');
exit; exit;
} }
} }
@ -502,7 +502,7 @@ class ApiController extends Zend_Controller_Action
//File is not in database anymore. //File is not in database anymore.
if (is_null($file)) { if (is_null($file)) {
$return_hash['error'] = "File does not exist in Airtime."; $return_hash['error'] = _("File does not exist in Airtime.");
return $return_hash; return $return_hash;
} }
@ -515,7 +515,7 @@ class ApiController extends Zend_Controller_Action
$md['MDATA_KEY_ORIGINAL_PATH']); $md['MDATA_KEY_ORIGINAL_PATH']);
if (is_null($file)) { if (is_null($file)) {
$return_hash['error'] = 'File does not exist in Airtime'; $return_hash['error'] = _('File does not exist in Airtime');
} else { } else {
$filepath = $md['MDATA_KEY_FILEPATH']; $filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath); //$filepath = str_replace("\\", "", $filepath);
@ -527,7 +527,7 @@ class ApiController extends Zend_Controller_Action
$file = Application_Model_StoredFile::RecallByFilepath($filepath); $file = Application_Model_StoredFile::RecallByFilepath($filepath);
if (is_null($file)) { if (is_null($file)) {
$return_hash['error'] = "File doesn't exist in Airtime."; $return_hash['error'] = _("File doesn't exist in Airtime.");
Logging::warn("Attempt to delete file that doesn't exist. Logging::warn("Attempt to delete file that doesn't exist.
Path: '$filepath'"); Path: '$filepath'");
@ -573,7 +573,7 @@ class ApiController extends Zend_Controller_Action
Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:"); Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
Logging::info( $info_json ); Logging::info( $info_json );
array_push( $responses, array( array_push( $responses, array(
'error' => "Bad request. no 'mode' parameter passed.", 'error' => _("Bad request. no 'mode' parameter passed."),
'key' => $k)); 'key' => $k));
continue; continue;
} elseif ( !in_array($info_json['mode'], $valid_modes) ) { } elseif ( !in_array($info_json['mode'], $valid_modes) ) {
@ -583,7 +583,7 @@ class ApiController extends Zend_Controller_Action
Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:"); Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:");
Logging::info( $info_json ); Logging::info( $info_json );
array_push( $responses, array( array_push( $responses, array(
'error' => "Bad request. 'mode' parameter is invalid", 'error' => _("Bad request. 'mode' parameter is invalid"),
'key' => $k, 'key' => $k,
'mode' => $mode ) ); 'mode' => $mode ) );
continue; continue;

View File

@ -210,7 +210,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime"); throw new Exception("Unknown file type: $mime");
} }
$elementMap['uri'] = "/api/get-media/file/".$track['item_id']; $elementMap['uri'] = $baseUrl."/api/get-media/file/".$track['item_id'];
} else { } else {
$elementMap['uri'] = $track['path']; $elementMap['uri'] = $track['path'];
} }

View File

@ -33,9 +33,9 @@ class DashboardController extends Zend_Controller_Action
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data); Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
} else { } else {
if ($source_connected) { if ($source_connected) {
$this->view->error = "You don't have permission to disconnect source."; $this->view->error = _("You don't have permission to disconnect source.");
} else { } else {
$this->view->error = "There is no source connected to this input."; $this->view->error = _("There is no source connected to this input.");
} }
} }
} }
@ -79,12 +79,12 @@ class DashboardController extends Zend_Controller_Action
} }
} else { } else {
if ($source_connected) { if ($source_connected) {
$this->view->error = "You don't have permission to switch source."; $this->view->error = _("You don't have permission to switch source.");
} else { } else {
if ($sourcename == 'scheduled_play') { if ($sourcename == 'scheduled_play') {
$this->view->error = "You don't have permission to disconnect source."; $this->view->error = _("You don't have permission to disconnect source.");
} else { } else {
$this->view->error = "There is no source connected to this input."; $this->view->error = _("There is no source connected to this input.");
} }
} }
} }

View File

@ -14,12 +14,12 @@ class ErrorController extends Zend_Controller_Action
// 404 error -- controller or action not found // 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404); $this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found'; $this->view->message = _('Page not found');
break; break;
default: default:
// application error // application error
$this->getResponse()->setHttpResponseCode(500); $this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error'; $this->view->message = _('Application error');
break; break;
} }

View File

@ -90,7 +90,7 @@ class LibraryController extends Zend_Controller_Action
protected function playlistNotFound($p_type) protected function playlistNotFound($p_type)
{ {
$this->view->error = "$p_type not found"; $this->view->error = sprintf(_("%s not found"), $p_type);
Logging::info("$p_type not found"); Logging::info("$p_type not found");
Application_Model_Library::changePlaylist(null, $p_type); Application_Model_Library::changePlaylist(null, $p_type);
@ -99,7 +99,7 @@ class LibraryController extends Zend_Controller_Action
protected function playlistUnknownError($e) protected function playlistUnknownError($e)
{ {
$this->view->error = "Something went wrong."; $this->view->error = _("Something went wrong.");
Logging::info($e->getMessage()); Logging::info($e->getMessage());
} }
@ -156,7 +156,7 @@ class LibraryController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
//Open a jPlayer window and play the audio clip. //Open a jPlayer window and play the audio clip.
$menu["play"] = array("name"=> "Preview", "icon" => "play", "disabled" => false); $menu["play"] = array("name"=> _("Preview"), "icon" => "play", "disabled" => false);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
@ -177,19 +177,19 @@ class LibraryController extends Zend_Controller_Action
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($obj_sess->type === "playlist") { if ($obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy"); $menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
} elseif ($obj_sess->type === "block" && $obj->isStatic()) { } elseif ($obj_sess->type === "block" && $obj->isStatic()) {
$menu["pl_add"] = array("name"=> "Add to Smart Block", "icon" => "add-playlist", "icon" => "copy"); $menu["pl_add"] = array("name"=> _("Add to Smart Block"), "icon" => "add-playlist", "icon" => "copy");
} }
} }
} }
if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) { if ($isAdminOrPM || $file->getFileOwnerId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/library/delete");
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> _("Edit Metadata"), "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}");
} }
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu["download"] = array("name" => "Download", "icon" => "download", "url" => $url); $menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url);
} elseif ($type === "playlist" || $type === "block") { } elseif ($type === "playlist" || $type === "block") {
if ($type === 'playlist') { if ($type === 'playlist') {
$obj = new Application_Model_Playlist($id); $obj = new Application_Model_Playlist($id);
@ -200,19 +200,19 @@ class LibraryController extends Zend_Controller_Action
} }
if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == "playlist") { if (($isAdminOrPM || $obj->getCreatorId() == $user->getId()) && $screen == "playlist") {
if ($obj_sess->type === "playlist") { if ($obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy"); $menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
} }
} }
} }
if ($obj_sess->id !== $id && $screen == "playlist") { if ($obj_sess->id !== $id && $screen == "playlist") {
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["edit"] = array("name"=> "Edit", "icon" => "edit"); $menu["edit"] = array("name"=> _("Edit"), "icon" => "edit");
} }
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/library/delete");
} }
} elseif ($type == "stream") { } elseif ($type == "stream") {
@ -221,15 +221,15 @@ class LibraryController extends Zend_Controller_Action
if (isset($obj_sess->id) && $screen == "playlist") { if (isset($obj_sess->id) && $screen == "playlist") {
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($obj_sess->type === "playlist") { if ($obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy"); $menu["pl_add"] = array("name"=> _("Add to Playlist"), "icon" => "add-playlist", "icon" => "copy");
} }
} }
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($screen == "playlist") { if ($screen == "playlist") {
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> _("Edit"), "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}");
} }
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/library/delete");
} }
} }
@ -240,26 +240,26 @@ class LibraryController extends Zend_Controller_Action
$menu["sep1"] = "-----------"; $menu["sep1"] = "-----------";
//create a sub menu for Soundcloud actions. //create a sub menu for Soundcloud actions.
$menu["soundcloud"] = array("name" => "Soundcloud", "icon" => "soundcloud", "items" => array()); $menu["soundcloud"] = array("name" => _("Soundcloud"), "icon" => "soundcloud", "items" => array());
$scid = $file->getSoundCloudId(); $scid = $file->getSoundCloudId();
if ($scid > 0) { if ($scid > 0) {
$url = $file->getSoundCloudLinkToFile(); $url = $file->getSoundCloudLinkToFile();
$menu["soundcloud"]["items"]["view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url); $menu["soundcloud"]["items"]["view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
} }
if (!is_null($scid)) { if (!is_null($scid)) {
$text = "Re-upload to SoundCloud"; $text = _("Re-upload to SoundCloud");
} else { } else {
$text = "Upload to SoundCloud"; $text = _("Upload to SoundCloud");
} }
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."/library/upload-file-soundcloud/id/{$id}"); $menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."/library/upload-file-soundcloud/id/{$id}");
} }
if (empty($menu)) { if (empty($menu)) {
$menu["noaction"] = array("name"=>"No action available"); $menu["noaction"] = array("name"=>_("No action available"));
} }
$this->view->items = $menu; $this->view->items = $menu;
@ -279,7 +279,7 @@ class LibraryController extends Zend_Controller_Action
$streams = array(); $streams = array();
$message = null; $message = null;
$noPermissionMsg = "You don't have permission to delete selected items."; $noPermissionMsg = _("You don't have permission to delete selected items.");
foreach ($mediaItems as $media) { foreach ($mediaItems as $media) {
@ -328,7 +328,7 @@ class LibraryController extends Zend_Controller_Action
$message = $noPermissionMsg; $message = $noPermissionMsg;
} catch (Exception $e) { } catch (Exception $e) {
//could throw a scheduled in future exception. //could throw a scheduled in future exception.
$message = "Could not delete some scheduled files."; $message = _("Could not delete some scheduled files.");
Logging::debug($e->getMessage()); Logging::debug($e->getMessage());
} }
} }
@ -455,10 +455,10 @@ class LibraryController extends Zend_Controller_Action
$this->view->md = $md; $this->view->md = $md;
if ($block->isStatic()) { if ($block->isStatic()) {
$this->view->blType = 'Static'; $this->view->blType = _('Static');
$this->view->contents = $block->getContents(); $this->view->contents = $block->getContents();
} else { } else {
$this->view->blType = 'Dynamic'; $this->view->blType = _('Dynamic');
$this->view->contents = $block->getCriteria(); $this->view->contents = $block->getCriteria();
} }
$this->view->block = $block; $this->view->block = $block;

View File

@ -31,7 +31,7 @@ class LoginController extends Zend_Controller_Action
$form = new Application_Form_Login(); $form = new Application_Form_Login();
$message = "Please enter your user name and password"; $message = _("Please enter your user name and password");
if ($request->isPost()) { if ($request->isPost()) {
// if the post contains recaptcha field, which means form had recaptcha field. // if the post contains recaptcha field, which means form had recaptcha field.
@ -70,7 +70,7 @@ class LoginController extends Zend_Controller_Action
$this->_redirect('Showbuilder'); $this->_redirect('Showbuilder');
} else { } else {
$message = "Wrong username or password provided. Please try again."; $message = _("Wrong username or password provided. Please try again.");
Application_Model_Subjects::increaseLoginAttempts($username); Application_Model_Subjects::increaseLoginAttempts($username);
Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']); Application_Model_LoginAttempts::increaseAttempts($_SERVER['REMOTE_ADDR']);
$form = new Application_Form_Login(); $form = new Application_Form_Login();
@ -132,10 +132,10 @@ class LoginController extends Zend_Controller_Action
if ($success) { if ($success) {
$this->_helper->redirector('password-restore-after', 'login'); $this->_helper->redirector('password-restore-after', 'login');
} else { } else {
$form->email->addError($this->view->translate("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")); $form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
} }
} else { } else {
$form->email->addError($this->view->translate("Given email not found.")); $form->email->addError($this->view->translate(_("Given email not found.")));
} }
} }

View File

@ -42,7 +42,7 @@ class PlaylistController extends Zend_Controller_Action
$modified = $this->_getParam('modified', null); $modified = $this->_getParam('modified', null);
if ($obj->getLastModified("U") !== $modified) { if ($obj->getLastModified("U") !== $modified) {
$this->createFullResponse($obj); $this->createFullResponse($obj);
throw new PlaylistOutDatedException("You are viewing an older version of {$obj->getName()}"); throw new PlaylistOutDatedException(sprintf(_("You are viewing an older version of %s"), $obj->getName()));
} }
} }
@ -117,14 +117,14 @@ class PlaylistController extends Zend_Controller_Action
private function blockDynamic($obj) private function blockDynamic($obj)
{ {
$this->view->error = "You cannot add tracks to dynamic blocks."; $this->view->error = _("You cannot add tracks to dynamic blocks.");
$this->createFullResponse($obj); $this->createFullResponse($obj);
} }
private function playlistNotFound($p_type, $p_isJson = false) private function playlistNotFound($p_type, $p_isJson = false)
{ {
$p_type = ucfirst($p_type); $p_type = ucfirst($p_type);
$this->view->error = "{$p_type} not found"; $this->view->error = sprintf(_("%s not found"), $p_type);
Logging::info("{$p_type} not found"); Logging::info("{$p_type} not found");
Application_Model_Library::changePlaylist(null, $p_type); Application_Model_Library::changePlaylist(null, $p_type);
@ -138,26 +138,26 @@ class PlaylistController extends Zend_Controller_Action
private function playlistNoPermission($p_type) private function playlistNoPermission($p_type)
{ {
$this->view->error = "You don't have permission to delete selected {$p_type}(s)."; $this->view->error = sprintf(_("You don't have permission to delete selected %s(s)."), $p_type);
$this->changePlaylist(null, $p_type); $this->changePlaylist(null, $p_type);
$this->createFullResponse(null); $this->createFullResponse(null);
} }
private function playlistUnknownError($e) private function playlistUnknownError($e)
{ {
$this->view->error = "Something went wrong."; $this->view->error = _("Something went wrong.");
Logging::info($e->getMessage()); Logging::info($e->getMessage());
} }
private function wrongTypeToBlock($obj) private function wrongTypeToBlock($obj)
{ {
$this->view->error = "You can only add tracks to smart block."; $this->view->error = _("You can only add tracks to smart block.");
$this->createFullResponse($obj); $this->createFullResponse($obj);
} }
private function wrongTypeToPlaylist($obj) private function wrongTypeToPlaylist($obj)
{ {
$this->view->error = "You can only add tracks, smart blocks, and webstreams to playlists."; $this->view->error = _("You can only add tracks, smart blocks, and webstreams to playlists.");
$this->createFullResponse($obj); $this->createFullResponse($obj);
} }
@ -169,9 +169,9 @@ class PlaylistController extends Zend_Controller_Action
$objInfo = Application_Model_Library::getObjInfo($type); $objInfo = Application_Model_Library::getObjInfo($type);
$name = 'Untitled Playlist'; $name = _('Untitled Playlist');
if ($type == 'block') { if ($type == 'block') {
$name = 'Untitled Smart Block'; $name = _('Untitled Smart Block');
} }
$obj = new $objInfo['className'](); $obj = new $objInfo['className']();
@ -434,7 +434,7 @@ class PlaylistController extends Zend_Controller_Action
public function setPlaylistNameDescAction() public function setPlaylistNameDescAction()
{ {
$name = $this->_getParam('name', 'Unknown Playlist'); $name = $this->_getParam('name', _('Unknown Playlist'));
$description = $this->_getParam('description', ""); $description = $this->_getParam('description', "");
$type = $this->_getParam('type'); $type = $this->_getParam('type');

View File

@ -66,7 +66,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetSoundCloudTrackType($values["SoundCloudTrackType"]); Application_Model_Preference::SetSoundCloudTrackType($values["SoundCloudTrackType"]);
Application_Model_Preference::SetSoundCloudLicense($values["SoundCloudLicense"]); Application_Model_Preference::SetSoundCloudLicense($values["SoundCloudLicense"]);
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>"; $this->view->statusMsg = "<div class='success'>_(Preferences updated.)</div>";
$this->view->form = $form; $this->view->form = $form;
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')))); die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml'))));
} else { } else {
@ -118,7 +118,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
} }
} }
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>"; $this->view->statusMsg = "<div class='success'>_(Support setting updated.)</div>";
} }
} }
$logo = Application_Model_Preference::GetStationLogo(); $logo = Application_Model_Preference::GetStationLogo();
@ -130,7 +130,7 @@ class PreferenceController extends Zend_Controller_Action
$privacyChecked = true; $privacyChecked = true;
} }
$this->view->privacyChecked = $privacyChecked; $this->view->privacyChecked = $privacyChecked;
$this->view->section_title = 'Support Feedback'; $this->view->section_title = _('Support Feedback');
$this->view->form = $form; $this->view->form = $form;
//$form->render($this->view); //$form->render($this->view);
} }
@ -301,7 +301,7 @@ class PreferenceController extends Zend_Controller_Action
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf(); $this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
$this->view->form = $form; $this->view->form = $form;
$this->view->num_stream = $num_of_stream; $this->view->num_stream = $num_of_stream;
$this->view->statusMsg = "<div class='success'>Stream Setting Updated.</div>"; $this->view->statusMsg = "<div class='success'>_(Stream Setting Updated.)</div>";
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/stream-setting.phtml')))); die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/stream-setting.phtml'))));
} else { } else {
$live_stream_subform->updateVariables(); $live_stream_subform->updateVariables();
@ -328,7 +328,7 @@ class PreferenceController extends Zend_Controller_Action
if (is_null($path)) { if (is_null($path)) {
$element = array(); $element = array();
$element["name"] = "path should be specified"; $element["name"] = _("path should be specified");
$element["isFolder"] = false; $element["isFolder"] = false;
$element["isError"] = true; $element["isError"] = true;
$result[$path] = $element; $result[$path] = $element;
@ -422,7 +422,7 @@ class PreferenceController extends Zend_Controller_Action
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams()); $num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
for ($i=1; $i<=$num_of_stream; $i++) { for ($i=1; $i<=$num_of_stream; $i++) {
$status = Application_Model_StreamSetting::getLiquidsoapError($i); $status = Application_Model_StreamSetting::getLiquidsoapError($i);
$status = $status == NULL?"Problem with Liquidsoap...":$status; $status = $status == NULL?_("Problem with Liquidsoap..."):$status;
if (!Application_Model_StreamSetting::getStreamEnabled($i)) { if (!Application_Model_StreamSetting::getStreamEnabled($i)) {
$status = "N/A"; $status = "N/A";
} }

View File

@ -250,7 +250,7 @@ class ScheduleController extends Zend_Controller_Action
$file = $instance->getRecordedFile(); $file = $instance->getRecordedFile();
$fileId = $file->getId(); $fileId = $file->getId();
$menu["view_recorded"] = array("name" => "View Recorded File Metadata", "icon" => "overview", $menu["view_recorded"] = array("name" => _("View Recorded File Metadata"), "icon" => "overview",
"url" => $baseUrl."/library/edit-file-md/id/".$fileId); "url" => $baseUrl."/library/edit-file-md/id/".$fileId);
} }
@ -259,17 +259,17 @@ class ScheduleController extends Zend_Controller_Action
&& !$instance->isRecorded() && !$instance->isRecorded()
&& !$instance->isRebroadcast()) { && !$instance->isRebroadcast()) {
$menu["schedule"] = array("name"=> "Add / Remove Content", "icon" => "add-remove-content", $menu["schedule"] = array("name"=> _("Add / Remove Content"), "icon" => "add-remove-content",
"url" => $baseUrl."/showbuilder/builder-dialog/"); "url" => $baseUrl."/showbuilder/builder-dialog/");
$menu["clear"] = array("name"=> "Remove All Content", "icon" => "remove-all-content", $menu["clear"] = array("name"=> _("Remove All Content"), "icon" => "remove-all-content",
"url" => $baseUrl."/schedule/clear-show"); "url" => $baseUrl."/schedule/clear-show");
} }
} }
if (!$instance->isRecorded()) { if (!$instance->isRecorded()) {
$menu["content"] = array("name"=> "Show Content", "icon" => "overview", "url" => $baseUrl."/schedule/show-content-dialog"); $menu["content"] = array("name"=> _("Show Content"), "icon" => "overview", "url" => $baseUrl."/schedule/show-content-dialog");
} }
if ($showEndLocalDT->getTimestamp() <= $epochNow if ($showEndLocalDT->getTimestamp() <= $epochNow
@ -282,10 +282,10 @@ class ScheduleController extends Zend_Controller_Action
if ($scid > 0) { if ($scid > 0) {
$url = $file->getSoundCloudLinkToFile(); $url = $file->getSoundCloudLinkToFile();
$menu["soundcloud_view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url); $menu["soundcloud_view"] = array("name" => _("View on Soundcloud"), "icon" => "soundcloud", "url" => $url);
} }
$text = is_null($scid) ? 'Upload to SoundCloud' : 'Re-upload to SoundCloud'; $text = is_null($scid) ? _('Upload to SoundCloud') : _('Re-upload to SoundCloud');
$menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud"); $menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud");
} }
@ -293,34 +293,34 @@ class ScheduleController extends Zend_Controller_Action
$epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) { $epochNow < $showEndLocalDT->getTimestamp() && $isAdminOrPM) {
if ($instance->isRecorded()) { if ($instance->isRecorded()) {
$menu["cancel_recorded"] = array("name"=> "Cancel Current Show", "icon" => "delete"); $menu["cancel_recorded"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
} else { } else {
if (!$instance->isRebroadcast()) { if (!$instance->isRebroadcast()) {
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/Schedule/populate-show-form"); $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/Schedule/populate-show-form");
} }
$menu["cancel"] = array("name"=> "Cancel Current Show", "icon" => "delete"); $menu["cancel"] = array("name"=> _("Cancel Current Show"), "icon" => "delete");
} }
} }
if ($epochNow < $showStartLocalDT->getTimestamp()) { if ($epochNow < $showStartLocalDT->getTimestamp()) {
if (!$instance->isRebroadcast() && $isAdminOrPM) { if (!$instance->isRebroadcast() && $isAdminOrPM) {
$menu["edit"] = array("name"=> "Edit Show", "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/Schedule/populate-show-form"); $menu["edit"] = array("name"=> _("Edit Show"), "icon" => "edit", "_type"=>"all", "url" => $baseUrl."/Schedule/populate-show-form");
} }
if ($instance->getShow()->isRepeating() && $isAdminOrPM) { if ($instance->getShow()->isRepeating() && $isAdminOrPM) {
//create delete sub menu. //create delete sub menu.
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "items" => array()); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "items" => array());
$menu["del"]["items"]["single"] = array("name"=> "Delete This Instance", "icon" => "delete", "url" => $baseUrl."/schedule/delete-show"); $menu["del"]["items"]["single"] = array("name"=> _("Delete This Instance"), "icon" => "delete", "url" => $baseUrl."/schedule/delete-show");
$menu["del"]["items"]["following"] = array("name"=> "Delete This Instance and All Following", "icon" => "delete", "url" => $baseUrl."/schedule/cancel-show"); $menu["del"]["items"]["following"] = array("name"=> _("Delete This Instance and All Following"), "icon" => "delete", "url" => $baseUrl."/schedule/cancel-show");
} elseif ($isAdminOrPM) { } elseif ($isAdminOrPM) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/schedule/delete-show"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/schedule/delete-show");
} }
} }
@ -443,8 +443,10 @@ class ScheduleController extends Zend_Controller_Action
$originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get())); $originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
//$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s")); //$timestamp = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s"));
$this->view->additionalShowInfo = $this->view->additionalShowInfo =
"Rebroadcast of show \"$originalShowName\" from " sprintf(_("Rebroadcast of show %s from %s at %s"),
.$originalDateTime->format("l, F jS")." at ".$originalDateTime->format("G:i"); $originalShowName,
$originalDateTime->format("l, F jS"),
$originalDateTime->format("G:i"));
} }
$this->view->showLength = $show->getShowLength(); $this->view->showLength = $show->getShowLength();
$this->view->timeFilled = $show->getTimeScheduled(); $this->view->timeFilled = $show->getTimeScheduled();
@ -895,7 +897,7 @@ class ScheduleController extends Zend_Controller_Action
$baseUrl = $this->getRequest()->getBaseUrl(); $baseUrl = $this->getRequest()->getBaseUrl();
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url), $menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
'title' => 'Download'); 'title' => _('Download'));
//returns format jjmenu is looking for. //returns format jjmenu is looking for.
die(json_encode($menu)); die(json_encode($menu));

View File

@ -187,15 +187,15 @@ class ShowbuilderController extends Zend_Controller_Action
$item = CcScheduleQuery::create()->findPK($id); $item = CcScheduleQuery::create()->findPK($id);
$instance = $item->getCcShowInstances(); $instance = $item->getCcShowInstances();
$menu["preview"] = array("name"=> "Preview", "icon" => "play"); $menu["preview"] = array("name"=> _("Preview"), "icon" => "play");
//select the cursor //select the cursor
$menu["selCurs"] = array("name"=> "Select cursor","icon" => "select-cursor"); $menu["selCurs"] = array("name"=> _("Select cursor"),"icon" => "select-cursor");
$menu["delCurs"] = array("name"=> "Remove cursor","icon" => "select-cursor"); $menu["delCurs"] = array("name"=> _("Remove cursor"),"icon" => "select-cursor");
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) { if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
//remove/truncate the item from the schedule //remove/truncate the item from the schedule
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/showbuilder/schedule-remove"); $menu["del"] = array("name"=> _("Delete"), "icon" => "delete", "url" => $baseUrl."/showbuilder/schedule-remove");
} }
$this->view->items = $menu; $this->view->items = $menu;
@ -209,7 +209,7 @@ class ShowbuilderController extends Zend_Controller_Action
$instance = CcShowInstancesQuery::create()->findPK($id); $instance = CcShowInstancesQuery::create()->findPK($id);
if (is_null($instance)) { if (is_null($instance)) {
$this->view->error = "show does not exist"; $this->view->error = _("show does not exist");
return; return;
} }

View File

@ -51,7 +51,7 @@ class UserController extends Zend_Controller_Action
&& $formData['login'] == 'admin' && $formData['login'] == 'admin'
&& $formData['user_id'] != 0) { && $formData['user_id'] != 0) {
$this->view->form = $form; $this->view->form = $form;
$this->view->successMessage = "<div class='errors'>Specific action is not allowed in demo version!</div>"; $this->view->successMessage = "<div class='errors'>_(Specific action is not allowed in demo version!)</div>";
die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml')))); die(json_encode(array("valid"=>"false", "html"=>$this->view->render('user/add-user.phtml'))));
} elseif ($form->validateLogin($formData)) { } elseif ($form->validateLogin($formData)) {
$user = new Application_Model_User($formData['user_id']); $user = new Application_Model_User($formData['user_id']);
@ -75,9 +75,9 @@ class UserController extends Zend_Controller_Action
$this->view->form = $form; $this->view->form = $form;
if (strlen($formData['user_id']) == 0) { if (strlen($formData['user_id']) == 0) {
$this->view->successMessage = "<div class='success'>User added successfully!</div>"; $this->view->successMessage = "<div class='success'>_(User added successfully!)</div>";
} else { } else {
$this->view->successMessage = "<div class='success'>User updated successfully!</div>"; $this->view->successMessage = "<div class='success'>_(User updated successfully!)</div>";
} }
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml')))); die(json_encode(array("valid"=>"true", "html"=>$this->view->render('user/add-user.phtml'))));

View File

@ -26,11 +26,11 @@ class WebstreamController extends Zend_Controller_Action
//we're not saving this primary key in the DB so it's OK to be -1 //we're not saving this primary key in the DB so it's OK to be -1
$webstream->setDbId(-1); $webstream->setDbId(-1);
$webstream->setDbName("Untitled Webstream"); $webstream->setDbName(_("Untitled Webstream"));
$webstream->setDbDescription(""); $webstream->setDbDescription("");
$webstream->setDbUrl("http://"); $webstream->setDbUrl("http://");
$webstream->setDbLength("00:30:00"); $webstream->setDbLength("00:30:00");
$webstream->setDbName("Untitled Webstream"); $webstream->setDbName(_("Untitled Webstream"));
$webstream->setDbCreatorId($userInfo->id); $webstream->setDbCreatorId($userInfo->id);
$webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->setDbUtime(new DateTime("now", new DateTimeZone('UTC')));
$webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC'))); $webstream->setDbMtime(new DateTime("now", new DateTimeZone('UTC')));
@ -135,7 +135,7 @@ class WebstreamController extends Zend_Controller_Action
Application_Model_Library::changePlaylist($streamId, "stream"); Application_Model_Library::changePlaylist($streamId, "stream");
$this->view->statusMessage = "<div class='success'>Webstream saved.</div>"; $this->view->statusMessage = "<div class='success'>_(Webstream saved.)</div>";
$this->view->streamId = $streamId; $this->view->streamId = $streamId;
$this->view->length = $di->format("%Hh %Im"); $this->view->length = $di->format("%Hh %Im");
} else { } else {
@ -143,7 +143,7 @@ class WebstreamController extends Zend_Controller_Action
} }
} catch (Exception $e) { } catch (Exception $e) {
Logging::debug($e->getMessage()); Logging::debug($e->getMessage());
$this->view->statusMessage = "<div class='errors'>Invalid form values.</div>"; $this->view->statusMessage = "<div class='errors'>_(Invalid form values.)</div>";
$this->view->streamId = -1; $this->view->streamId = -1;
$this->view->analysis = $analysis; $this->view->analysis = $analysis;
} }