CC-1960: Internationalize Airtime / Support translations
- added gettext wrapper function to all strings in controllers
This commit is contained in:
parent
e5f67c8b05
commit
5adadc2e91
12 changed files with 91 additions and 89 deletions
|
@ -42,7 +42,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$modified = $this->_getParam('modified', null);
|
||||
if ($obj->getLastModified("U") !== $modified) {
|
||||
$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)
|
||||
{
|
||||
$this->view->error = "You cannot add tracks to dynamic blocks.";
|
||||
$this->view->error = _("You cannot add tracks to dynamic blocks.");
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
private function playlistNotFound($p_type, $p_isJson = false)
|
||||
{
|
||||
$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");
|
||||
Application_Model_Library::changePlaylist(null, $p_type);
|
||||
|
@ -138,26 +138,26 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
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->createFullResponse(null);
|
||||
}
|
||||
|
||||
private function playlistUnknownError($e)
|
||||
{
|
||||
$this->view->error = "Something went wrong.";
|
||||
$this->view->error = _("Something went wrong.");
|
||||
Logging::info($e->getMessage());
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -169,9 +169,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||
|
||||
$name = 'Untitled Playlist';
|
||||
$name = _('Untitled Playlist');
|
||||
if ($type == 'block') {
|
||||
$name = 'Untitled Smart Block';
|
||||
$name = _('Untitled Smart Block');
|
||||
}
|
||||
|
||||
$obj = new $objInfo['className']();
|
||||
|
@ -434,7 +434,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function setPlaylistNameDescAction()
|
||||
{
|
||||
$name = $this->_getParam('name', 'Unknown Playlist');
|
||||
$name = $this->_getParam('name', _('Unknown Playlist'));
|
||||
$description = $this->_getParam('description', "");
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue