- Update Required
- To play the media you will need to either update your browser to a recent version or update your Flash plugin.
+ echo _("Update Required") ?>
+ To play the media you will need to either update your browser to a recent version or update your echo _("Flash plugin") ?>.
Click the box below to advertise your station on
- Sourcefabric.org.
+ echo _("Sourcefabric.org"); ?>.
In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback.
echo _("Update Required") ?>
- To play the media you will need to either update your browser to a recent version or update your echo _("Flash plugin") ?>.
+ sprintf(_("To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s."),
+ "",
+ "") ?>
Here's how you can get started using Airtime to automate your broadcasts:
+
+
-
Begin by adding your files to the library using the "Add Media" menu button. You can drag and drop your files to this window too.
-
Create a show by going to "Calendar" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins and program managers can add shows.
-
Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting "Add / Remove Content".
-
echo _("Select your media from the left pane and drag them to your show in the right pane."); ?>
\ No newline at end of file
diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
index 46c394ce3..e21347cb3 100644
--- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
+++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
@@ -105,7 +105,8 @@
- Help Airtime improve by letting us know how you are using it. This info
- will be collected regularly in order to enhance your user experience.
-
- Click "Yes, help Airtime" and we'll make sure the features you use are
- constantly improving.
+ ") ?>
@@ -23,9 +22,10 @@
- Click the box below to advertise your station on
- echo _("Sourcefabric.org"); ?>.
- In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback.
+ ",
+ "")?>
- Help Airtime improve by letting Sourcefabric know how you are using it. This information
- will be collected regularly in order to enhance your user experience.
- Click the "Send support feedback" box and we'll make sure the features you use are
- constantly improving.
+ ")?>
";
$this->view->streamId = -1;
$this->view->analysis = $analysis;
}
From ef626a71b1595a459b6e6b3692e19832c2451aea Mon Sep 17 00:00:00 2001
From: denise
Date: Thu, 15 Nov 2012 15:52:51 -0500
Subject: [PATCH 09/62] CC-1960: Internationalize Airtime / Support
translations
-added gettext wrapper to all strings in models
---
airtime_mvc/application/models/Auth.php | 2 +-
airtime_mvc/application/models/Block.php | 64 +++++++++----------
airtime_mvc/application/models/MusicDir.php | 18 +++---
airtime_mvc/application/models/Playlist.php | 12 ++--
airtime_mvc/application/models/Scheduler.php | 20 +++---
airtime_mvc/application/models/Show.php | 8 +--
.../application/models/ShowInstance.php | 18 +++---
airtime_mvc/application/models/StoredFile.php | 39 ++++++-----
airtime_mvc/application/models/Webstream.php | 22 +++----
9 files changed, 102 insertions(+), 101 deletions(-)
diff --git a/airtime_mvc/application/models/Auth.php b/airtime_mvc/application/models/Auth.php
index 2aef1ce81..ff27711bd 100644
--- a/airtime_mvc/application/models/Auth.php
+++ b/airtime_mvc/application/models/Auth.php
@@ -30,7 +30,7 @@ class Application_Model_Auth
$e_link_port = $_SERVER['SERVER_PORT'];
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
- $message = "Hi {$user->getDbLogin()}, \n\nClick this link to reset your password: ";
+ $message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
$success = Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php
index c41bc579f..f3ff7bf12 100644
--- a/airtime_mvc/application/models/Block.php
+++ b/airtime_mvc/application/models/Block.php
@@ -754,7 +754,7 @@ SQL;
try {
if (is_null($cueIn) && is_null($cueOut)) {
- $errArray["error"] = "Cue in and cue out are null.";
+ $errArray["error"] = _("Cue in and cue out are null.");
return $errArray;
}
@@ -789,7 +789,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -800,7 +800,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -821,7 +821,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -845,7 +845,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -856,7 +856,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be smaller than cue in.";
+ $errArray["error"] = _("Can't set cue out to be smaller than cue in.");
return $errArray;
}
@@ -1204,32 +1204,32 @@ SQL;
public function getCriteria()
{
$criteriaOptions = array(
- 0 => "Select criteria",
- "album_title" => "Album",
- "bit_rate" => "Bit Rate (Kbps)",
- "bpm" => "BPM",
- "composer" => "Composer",
- "conductor" => "Conductor",
- "copyright" => "Copyright",
- "artist_name" => "Creator",
- "encoded_by" => "Encoded By",
- "genre" => "Genre",
- "isrc_number" => "ISRC",
- "label" => "Label",
- "language" => "Language",
- "mtime" => "Last Modified",
- "lptime" => "Last Played",
- "length" => "Length",
- "mime" => "Mime",
- "mood" => "Mood",
- "owner_id" => "Owner",
- "replay_gain" => "Replay Gain",
- "sample_rate" => "Sample Rate (kHz)",
- "track_title" => "Title",
- "track_number" => "Track Number",
- "utime" => "Uploaded",
- "info_url" => "Website",
- "year" => "Year"
+ 0 => _("Select criteria"),
+ "album_title" => _("Album"),
+ "bit_rate" => _("Bit Rate (Kbps)"),
+ "bpm" => _("BPM"),
+ "composer" => _("Composer"),
+ "conductor" => _("Conductor"),
+ "copyright" => _("Copyright"),
+ "artist_name" => _("Creator"),
+ "encoded_by" => _("Encoded By"),
+ "genre" => _("Genre"),
+ "isrc_number" => _("ISRC"),
+ "label" => _("Label"),
+ "language" => _("Language"),
+ "mtime" => _("Last Modified"),
+ "lptime" => _("Last Played"),
+ "length" => _("Length"),
+ "mime" => _("Mime"),
+ "mood" => _("Mood"),
+ "owner_id" => _("Owner"),
+ "replay_gain" => _("Replay Gain"),
+ "sample_rate" => _("Sample Rate (kHz)"),
+ "track_title" => _("Title"),
+ "track_number" => _("Track Number"),
+ "utime" => _("Uploaded"),
+ "info_url" => _("Website"),
+ "year" => _("Year")
);
// Load criteria from db
diff --git a/airtime_mvc/application/models/MusicDir.php b/airtime_mvc/application/models/MusicDir.php
index 6ace56550..f26b33522 100644
--- a/airtime_mvc/application/models/MusicDir.php
+++ b/airtime_mvc/application/models/MusicDir.php
@@ -157,15 +157,15 @@ SQL;
$diff = strlen($dir) - strlen($p_path);
if ($diff == 0) {
if ($dir == $p_path) {
- throw new NestedDirectoryException("'$p_path' is already watched.");
+ throw new NestedDirectoryException(sprintf(_("%s is already watched."), $p_path));
}
} elseif ($diff > 0) {
if (self::isAncestorDir($p_path, $dir)) {
- throw new NestedDirectoryException("'$p_path' contains nested watched directory: '$dir'");
+ throw new NestedDirectoryException(sprintf(_("%s contains nested watched directory: %s"), $p_path, $dir));
}
} else { /* diff < 0*/
if (self::isAncestorDir($dir, $p_path)) {
- throw new NestedDirectoryException("'$p_path' is nested within existing watched directory: '$dir'");
+ throw new NestedDirectoryException(sprintf(_("%s is nested within existing watched directory: %s"), $p_path, $dir));
}
}
}
@@ -186,7 +186,7 @@ SQL;
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
{
if (!is_dir($p_path)) {
- return array("code"=>2, "error"=>"'$p_path' is not a valid directory.");
+ return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_path));
}
$real_path = Application_Common_OsPath::normpath($p_path)."/";
if ($real_path != "/") {
@@ -227,7 +227,8 @@ SQL;
return array("code"=>1, "error"=>"$msg");
} catch (Exception $e) {
- return array("code"=>1, "error"=>"'$p_path' is already set as the current storage dir or in the watched folders list");
+ return array("code"=>1,
+ "error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list"), $p_path));
}
}
@@ -359,7 +360,7 @@ SQL;
// path should always ends with trailing '/'
$p_dir = Application_Common_OsPath::normpath($p_dir)."/";
if (!is_dir($p_dir)) {
- return array("code"=>2, "error"=>"'$p_dir' is not a valid directory.");
+ return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_dir));
} elseif (Application_Model_Preference::GetImportTimestamp()+10 > time()) {
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
}
@@ -376,7 +377,8 @@ SQL;
return array("code"=>0);
} else {
- return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
+ return array("code"=>1,
+ "error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list."), $p_dir));
}
}
@@ -419,7 +421,7 @@ SQL;
}
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
if (is_null($dir)) {
- return array("code"=>1, "error"=>"'$p_dir' doesn't exist in the watched list.");
+ return array("code"=>1, "error"=>sprintf(_("%s doesn't exist in the watched list."), $p_dir));
} else {
$dir->remove($userAddedWatchedDir);
$data = array();
diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php
index 8abf649d1..b1b5879bc 100644
--- a/airtime_mvc/application/models/Playlist.php
+++ b/airtime_mvc/application/models/Playlist.php
@@ -721,7 +721,7 @@ SQL;
try {
if (is_null($cueIn) && is_null($cueOut)) {
- $errArray["error"] = "Cue in and cue out are null.";
+ $errArray["error"] = _("Cue in and cue out are null.");
return $errArray;
}
@@ -751,14 +751,14 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -774,7 +774,7 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -792,14 +792,14 @@ SQL;
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
- $errArray["error"] = "Can't set cue out to be smaller than cue in.";
+ $errArray["error"] = _("Can't set cue out to be smaller than cue in.");
return $errArray;
}
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php
index b36fc2223..fb5c2ebc4 100644
--- a/airtime_mvc/application/models/Scheduler.php
+++ b/airtime_mvc/application/models/Scheduler.php
@@ -79,12 +79,12 @@ class Application_Model_Scheduler
//an item has been deleted
if (count($schedIds) !== count($schedItems)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date! (sched mismatch)");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (sched mismatch)"));
}
//a show has been deleted
if (count($instanceIds) !== count($showInstances)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date! (instance mismatch)");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (instance mismatch)"));
}
foreach ($schedItems as $schedItem) {
@@ -92,7 +92,7 @@ class Application_Model_Scheduler
$instance = $schedItem->getCcShowInstances($this->con);
if (intval($schedInfo[$id]) !== $instance->getDbId()) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
}
}
@@ -102,24 +102,24 @@ class Application_Model_Scheduler
$show = $instance->getCcShow($this->con);
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
- throw new Exception("You are not allowed to schedule show {$show->getDbName()}.");
+ throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));
}
if ($instance->getDbRecord()) {
- throw new Exception("You cannot add files to recording shows.");
+ throw new Exception(_("You cannot add files to recording shows."));
}
$showEndEpoch = floatval($instance->getDbEnds("U.u"));
if ($showEndEpoch < $nowEpoch) {
- throw new OutDatedScheduleException("The show {$show->getDbName()} is over and cannot be scheduled.");
+ throw new OutDatedScheduleException(sprintf(_("The show %s is over and cannot be scheduled."), $show->getDbName()));
}
$ts = intval($instanceInfo[$id]);
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
if ($ts < $lastSchedTs) {
Logging::info("ts {$ts} last sched {$lastSchedTs}");
- throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!");
+ throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName()));
}
}
}
@@ -138,7 +138,7 @@ class Application_Model_Scheduler
$file = CcFilesQuery::create()->findPK($id, $this->con);
if (is_null($file) || !$file->visible()) {
- throw new Exception("A selected File does not exist!");
+ throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
@@ -219,7 +219,7 @@ class Application_Model_Scheduler
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
if (is_null($stream) /* || !$file->visible() */) {
- throw new Exception("A selected File does not exist!");
+ throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
@@ -343,7 +343,7 @@ class Application_Model_Scheduler
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
if (is_null($instance)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
}
$itemStartDT = $instance->getDbStarts(null);
diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php
index 6f088046d..7f55e8c2a 100644
--- a/airtime_mvc/application/models/Show.php
+++ b/airtime_mvc/application/models/Show.php
@@ -177,7 +177,7 @@ SQL;
$con = Propel::getConnection();
if ($deltaDay > 0) {
- return "Shows can have a max length of 24 hours.";
+ return _("Shows can have a max length of 24 hours.");
}
$utc = new DateTimeZone("UTC");
@@ -208,7 +208,7 @@ SQL;
$newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin);
if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
- return "End date/time cannot be in the past";
+ return _("End date/time cannot be in the past");
}
//convert our new starts/ends to UTC.
@@ -219,8 +219,8 @@ SQL;
$newStartsDateTime, $newEndsDateTime, true, $si->getDbId());
if ($overlapping) {
- return "Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
- "affects all of its repeats.";
+ return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
+ "affects all of its repeats.");
}
}
diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php
index e1cdbe5b6..9a5e8a7d4 100644
--- a/airtime_mvc/application/models/ShowInstance.php
+++ b/airtime_mvc/application/models/ShowInstance.php
@@ -242,7 +242,7 @@ SQL;
public function moveShow($deltaDay, $deltaMin)
{
if ($this->getShow()->isRepeating()) {
- return "Can't drag and drop repeating shows";
+ return _("Can't drag and drop repeating shows");
}
$today_timestamp = time();
@@ -250,7 +250,7 @@ SQL;
$endsDateTime = new DateTime($this->getShowInstanceEnd(), new DateTimeZone("UTC"));
if ($today_timestamp > $startsDateTime->getTimestamp()) {
- return "Can't move a past show";
+ return _("Can't move a past show");
}
//the user is moving the show on the calendar from the perspective of local time.
@@ -267,13 +267,13 @@ SQL;
$newEndsDateTime->setTimezone(new DateTimeZone("UTC"));
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
- return "Can't move show into past";
+ return _("Can't move show into past");
}
//check if show is overlapping
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
if ($overlapping) {
- return "Cannot schedule overlapping shows";
+ return _("Cannot schedule overlapping shows");
}
if ($this->isRecorded()) {
@@ -287,7 +287,7 @@ SQL;
->find();
if (count($rebroadcasts) > 0) {
- return "Can't move a recorded show less than 1 hour before its rebroadcasts.";
+ return _("Can't move a recorded show less than 1 hour before its rebroadcasts.");
}
}
@@ -300,14 +300,14 @@ SQL;
catch (Exception $e) {
$this->_showInstance->delete();
- return "Show was deleted because recorded show does not exist!";
+ return _("Show was deleted because recorded show does not exist!");
}
$recordEndDateTime = new DateTime($recordedShow->getShowInstanceEnd(), new DateTimeZone("UTC"));
$newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60);
if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) {
- return "Must wait 1 hour to rebroadcast.";
+ return _("Must wait 1 hour to rebroadcast.");
}
}
@@ -339,7 +339,7 @@ SQL;
$ends = $this->getShowInstanceEnd();
if (strtotime($today_timestamp) > strtotime($starts)) {
- return "can't resize a past show";
+ return _("can't resize a past show");
}
//$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
@@ -361,7 +361,7 @@ SQL;
if (count($overlap) > 0) {
// TODO : fix ghetto error handling -- RG
- return "Should not overlap shows";
+ return _("Should not overlap shows");
}
}
//with overbooking no longer need to check already scheduled content still fits.
diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php
index 8be6cd639..508e7eb3b 100644
--- a/airtime_mvc/application/models/StoredFile.php
+++ b/airtime_mvc/application/models/StoredFile.php
@@ -794,14 +794,14 @@ SQL;
// ugly
if ($type == "au") {
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "pl") {
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "st") {
$row['audioFile'] = $row['id'];
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "bl") {
- $row['image'] = '';
+ $row['image'] = '';
}
}
@@ -853,7 +853,7 @@ SQL;
closedir($dir);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": _("Failed to open temp directory.")}, "id" : "id"}');
// Look for the content type header
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
@@ -880,14 +880,14 @@ SQL;
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
fclose($out);
unlink($_FILES['file']['tmp_name']);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": _("Failed to move uploaded file.")}, "id" : "id"}');
} else {
// Open temp file
$out = fopen($tempFilePath, $chunk == 0 ? "wb" : "ab");
@@ -899,11 +899,11 @@ SQL;
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
fclose($out);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
}
return $tempFilePath;
@@ -934,7 +934,7 @@ SQL;
if (!mkdir($stor."/organize", 0777)) {
return array(
"code" => 109,
- "message" => "Failed to create 'organize' directory.");
+ "message" => _("Failed to create 'organize' directory."));
}
}
@@ -947,17 +947,17 @@ SQL;
$freeSpace = disk_free_space($stor);
return array("code" => 107,
- "message" => "The file was not uploaded, there is
- ".$freeSpace."MB of disk space left and the file you are
- uploading has a size of ".$fileSize."MB.");
+ "message" => sprintf(_("The file was not uploaded, there is "
+ ."%s MB of disk space left and the file you are "
+ ."uploading has a size of %s MB."), $freeSpace, $fileSize));
}
// Check if liquidsoap can play this file
if (!self::liquidsoapFilePlayabilityTest($audio_file)) {
return array(
"code" => 110,
- "message" => "This file appears to be corrupted and will not
- be added to media library.");
+ "message" => _("This file appears to be corrupted and will not "
+ ."be added to media library."));
}
// Did all the checks for real, now trying to copy
@@ -992,10 +992,9 @@ SQL;
return array(
"code" => 108,
- "message" => "
- The file was not uploaded, this error can occur if the computer
- hard drive does not have enough disk space or the stor
- directory does not have correct write permissions.");
+ "message" => _("The file was not uploaded, this error can occur if the computer "
+ ."hard drive does not have enough disk space or the stor "
+ ."directory does not have correct write permissions."));
}
// Now that we successfully added this file, we will add another tag
// file that will identify the user that owns it
diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php
index ef3f32605..9297cb1d9 100644
--- a/airtime_mvc/application/models/Webstream.php
+++ b/airtime_mvc/application/models/Webstream.php
@@ -154,12 +154,12 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
if ($totalMinutes == 0) {
$valid['length'][0] = false;
- $valid['length'][1] = 'Length needs to be greater than 0 minutes';
+ $valid['length'][1] = _('Length needs to be greater than 0 minutes');
}
} else {
$valid['length'][0] = false;
- $valid['length'][1] = 'Length should be of form "00h 00m"';
+ $valid['length'][1] = _('Length should be of form "00h 00m"');
}
$url = $parameters["url"];
@@ -172,16 +172,16 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$mediaUrl = null;
if ($result == 0) {
$valid['url'][0] = false;
- $valid['url'][1] = 'URL should be of form "http://domain"';
+ $valid['url'][1] = _('URL should be of form "http://domain"');
} elseif (strlen($url) > 512) {
$valid['url'][0] = false;
- $valid['url'][1] = 'URL should be 512 characters or less';
+ $valid['url'][1] = _('URL should be 512 characters or less');
} else {
try {
list($mime, $content_length_found) = self::discoverStreamMime($url);
if (is_null($mime)) {
- throw new Exception("No MIME type found for webstream.");
+ throw new Exception(_("No MIME type found for webstream."));
}
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
@@ -197,7 +197,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$name = $parameters["name"];
if (strlen($name) == 0) {
$valid['name'][0] = false;
- $valid['name'][1] = 'Webstream name cannot be empty';
+ $valid['name'][1] = _('Webstream name cannot be empty');
}
$id = $parameters["id"];
@@ -266,7 +266,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
}
}
- throw new Exception("Could not parse XSPF playlist");
+ throw new Exception(_("Could not parse XSPF playlist"));
}
private static function getPlsUrl($url)
@@ -278,7 +278,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return $ini["playlist"]["File1"];
}
- throw new Exception("Could not parse PLS playlist");
+ throw new Exception(_("Could not parse PLS playlist"));
}
private static function getM3uUrl($url)
@@ -297,7 +297,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return $lines[0];
}
- throw new Exception("Could not parse M3U playlist");
+ throw new Exception(_("Could not parse M3U playlist"));
}
private static function getMediaUrl($url, $mime, $content_length_found)
@@ -311,11 +311,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$media_url = self::getPlsUrl($url);
} elseif (preg_match("/(mpeg|ogg)/", $mime)) {
if ($content_length_found) {
- throw new Exception("Invalid webstream - This appears to be a file download.");
+ throw new Exception(_("Invalid webstream - This appears to be a file download."));
}
$media_url = $url;
} else {
- throw new Exception("Unrecognized stream type: $mime");
+ throw new Exception(sprintf(_("Unrecognized stream type: %s"), $mime));
}
return $media_url;
From 3f3b939ebe7c2973d800aa243d93d0a5bfb04c5c Mon Sep 17 00:00:00 2001
From: denise
Date: Thu, 15 Nov 2012 17:28:18 -0500
Subject: [PATCH 10/62] -extra quote typo
---
airtime_mvc/application/views/scripts/form/showbuilder.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/airtime_mvc/application/views/scripts/form/showbuilder.phtml b/airtime_mvc/application/views/scripts/form/showbuilder.phtml
index c4c344e10..af6791714 100644
--- a/airtime_mvc/application/views/scripts/form/showbuilder.phtml
+++ b/airtime_mvc/application/views/scripts/form/showbuilder.phtml
@@ -9,7 +9,7 @@
From 8c49540d3d776f87833092324988269e1cd6e1e9 Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 11:16:10 -0500
Subject: [PATCH 12/62] CC-1960: Internationalize Airtime / Support
translations
-added i18n jquery library
-created a Locale controller that returns a js dictionary of translations needed in js
-added jquery i18n wrapper function to all strings in js
---
airtime_mvc/application/Bootstrap.php | 3 +
airtime_mvc/application/configs/ACL.php | 4 +-
.../controllers/LocaleController.php | 262 ++++++++++++++++++
.../public/js/airtime/common/common.js | 2 +-
.../public/js/airtime/dashboard/dashboard.js | 14 +-
.../js/airtime/dashboard/versiontooltip.js | 8 +-
.../library/events/library_playlistbuilder.js | 14 +-
.../library/events/library_showbuilder.js | 4 +-
.../public/js/airtime/library/library.js | 99 +++----
.../public/js/airtime/library/plupload.js | 4 +-
airtime_mvc/public/js/airtime/library/spl.js | 24 +-
.../js/airtime/listenerstat/listenerstat.js | 4 +-
.../public/js/airtime/nowplaying/register.js | 8 +-
.../js/airtime/playlist/smart_blockbuilder.js | 43 ++-
.../js/airtime/playouthistory/historytable.js | 12 +-
.../js/airtime/preferences/musicdirs.js | 14 +-
.../js/airtime/preferences/streamsetting.js | 28 +-
.../js/airtime/preferences/support-setting.js | 2 +-
.../public/js/airtime/schedule/add-show.js | 10 +-
.../schedule/full-calendar-functions.js | 36 +--
.../public/js/airtime/schedule/schedule.js | 16 +-
.../public/js/airtime/showbuilder/builder.js | 56 ++--
.../js/airtime/showbuilder/main_builder.js | 2 +-
.../public/js/airtime/status/status.js | 4 +-
airtime_mvc/public/js/airtime/user/user.js | 8 +-
25 files changed, 472 insertions(+), 209 deletions(-)
create mode 100644 airtime_mvc/application/controllers/LocaleController.php
diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index f670353fa..06226cb8f 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -102,6 +102,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/js/i18n/jquery.i18n.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/locale/translation-table?'.$CC_CONFIG['airtime_version'].rand(5, 10),'text/javascript');
+ $view->headScript()->appendScript("$.i18n.setDictionary(lang_dict)");
$view->headScript()->appendScript("var baseUrl='$baseUrl'");
//scripts for now playing bar
diff --git a/airtime_mvc/application/configs/ACL.php b/airtime_mvc/application/configs/ACL.php
index 6687011a4..46ec0c6a3 100644
--- a/airtime_mvc/application/configs/ACL.php
+++ b/airtime_mvc/application/configs/ACL.php
@@ -26,7 +26,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('listenerstat'))
->add(new Zend_Acl_Resource('usersettings'))
->add(new Zend_Acl_Resource('audiopreview'))
- ->add(new Zend_Acl_Resource('webstream'));
+ ->add(new Zend_Acl_Resource('webstream'))
+ ->add(new Zend_Acl_Resource('locale'));
/** Creating permissions */
$ccAcl->allow('G', 'index')
@@ -38,6 +39,7 @@ $ccAcl->allow('G', 'index')
->allow('G', 'dashboard')
->allow('G', 'audiopreview')
->allow('G', 'webstream')
+ ->allow('G', 'locale')
->allow('H', 'preference', 'is-import-in-progress')
->allow('H', 'usersettings')
->allow('H', 'plupload')
diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
new file mode 100644
index 000000000..7f5ecc805
--- /dev/null
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -0,0 +1,262 @@
+_helper->getHelper('AjaxContext');
+ $ajaxContext->addActionContext('language-table', 'json')
+ ->initContext();
+ }
+
+ public function translationTableAction()
+ {
+ $translations = array (
+ //common/common.js
+ "Audio Player" => _("Audio Player"),
+ //dashboard/dashboard.js
+ "Recording:" => _("Recording:"),
+ "Master Stream" => _("Master Stream"),
+ "Live Stream" => _("Live Stream"),
+ "Nothing Scheduled" => _("Nothing Scheduled"),
+ "Current Show:" => _("Current Show:"),
+ //dashboard/versiontooltip.js
+ "You are running the latest version" => _("You are running the latest version"),
+ "New version available: " => _("New version available: "),
+ "This version will soon be obsolete." => _("This version will soon be obsolete."),
+ "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"),
+ "Adding 1 Item." => _("Adding 1 Item."),
+ /*****embedded variable*****/
+ "Adding " => _("Adding "),
+ " Items." => _(" Items."),
+ "You can only add tracks to smart blocks." => _("You can only add tracks to smart blocks."),
+ "You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."),
+ //library/events/library_showbuilder.js
+ "Adding 1 Item." => _("Adding 1 Item."),
+ /****string with variable*****/
+ "Adding " => _("Adding "),
+ " Items." => _(" Items."),
+ //library/library.js
+ "Select" => _("Select"),
+ "Select this page" => _("Select this page"),
+ "Deselect this page" => _("Deselect this page"),
+ "Deselect all" => _("Deselect all"),
+ "Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
+ "Title" => _("Title"),
+ "Creator" => _("Creator"),
+ "Album" => _("Album"),
+ "Bit Rate" => _("Bit Rate"),
+ "BPM" => _("BPM"),
+ "Composer" => _("Composer"),
+ "Conductor" => _("Conductor"),
+ "Copyright" => _("Copyright"),
+ "Encoded By" => _("Encoded By"),
+ "Genre" => _("Genre"),
+ "ISRC" => _("ISRC"),
+ "Label" => _("Label"),
+ "Language" => _("Language"),
+ "Last Modified" => _("Last Modified"),
+ "Last Played" => _("Last Played"),
+ "Length" => _("Length"),
+ "Mime" => _("Mime"),
+ "Mood" => _("Mood"),
+ "Owner" => _("Owner"),
+ "Replay Gain" => _("Replay Gain"),
+ "Sample Rate" => _("Sample Rate"),
+ "Track Number" => _("Track Number"),
+ "Uploaded" => _("Uploaded"),
+ "Website" => _("Webiste"),
+ "Year" => _("Year"),
+ "Loading..." => _("Loading..."),
+ "All" => _("All"),
+ "Files" => _("Files"),
+ "Playlists" => _("Playlists"),
+ "Smart Blocks" => _("Smart Blocks"),
+ "Web Streams" => _("Web Streams"),
+ "Unknown type: " => _("Unknown type: "),
+ "Are you sure you want to delete the selected item?" => _("Are you sure you want to delete the selected item?"),
+ "Uploading in progress..." => _("Uploading in progress..."),
+ "Retrieving data from the server..." => _("Retrieving data from the server..."),
+ "The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
+ "There was an error while uploading to soundcloud." => _("There was an error while uploading to soundcloud."),
+ "Error code: " => _("Error code: "),
+ "Error msg: " => _("Error msg: "),
+ "Input must be a positive number" => _("Input must be a positive number"),
+ "Input must be a number" => _("Input must be a number"),
+ "Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
+ "Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
+ //library/plupload.js
+ "You are currently uploading files." => _("You are currently uploading files."),
+ "Going to another screen will cancel the upload process." => _("Going to another screen will cancel the upload process."),
+ "Are you sure you want to leave the page?" => _("Are you sure you want to leave the page?"),
+ //library/spl.js
+ "please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
+ "please put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
+ "Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
+ "Dynamic block is not previewable" => _("Dynamic block is not previewable"),
+ "Limit to: " => _("Limit to: "),
+ "-error" => _("-error"),
+ "Playlist saved" => _("Playlist saved"),
+ "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
+ => _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
+ //listenerstat/listenerstat.js
+ "Listener Count on" => _("Listener Count on"),
+ "You clicked point " => _("You clicked point "),
+ "in" => _("in"),
+ //nowplaying/register.js
+ "Remind me in 1 week" => _("Remind me in 1 week"),
+ "Remind me never" => _("Remind me never"),
+ "Yes, help Airtime" => _("Yes, help Airtime"),
+ "Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
+ //playlist/smart_blockbuilder.js
+ "A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."
+ => _("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."),
+ "A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."
+ => _("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."),
+ "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once."
+ => _("If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once."),
+ "Smart block shuffled" => _("Smart block shuffled"),
+ "Smart block generated and criteria saved" => _("Smart block generated and criteria saved"),
+ "Smart block saved" => _("Smart block saved"),
+ "Processing..." => _("Processing..."),
+ "Select modifier" => _("Select modifier"),
+ "contains" => _("contains"),
+ "does not contain" => _("does not contain"),
+ "is" => _("is"),
+ "is not" => _("is not"),
+ "starts with" => _("starts with"),
+ "ends with" => _("ends with"),
+ "is greater than" => _("is greater than"),
+ "is less than" => _("is less than"),
+ "is in the range" => _("is in the range"),
+ //playouthistory/historytable.js
+ "Title" => _("Title"),
+ "Creator" => _("Creator"),
+ "Played" => _("Played"),
+ "Length" => _("Length"),
+ "Composer" => _("Composer"),
+ "Copyright" => _("Copyright"),
+ //preferences/musicdirs.js
+ "Choose Storage Folder" => _("Choose Storage Folder"),
+ "Choose Folder to Watch" => _("Choose Folder to Watch"),
+ "Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"
+ => _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
+ "Manage Media Folders" => _("Manage Media Folders"),
+ "Are you sure you want to remove the watched folder?" => _("Are you sure you want to remove the watched folder?"),
+ "This path is currently not accessible." => _("This path is currently not accessible."),
+ //preferences/streamsetting.js
+ "Connected to the streaming server" => _("Connected to the streaming server"),
+ "The stream is disabled" => _("The stream is disabled"),
+ "Getting information from the server..." => _("Getting information from the server..."),
+ "Can not connect to the streaming server" => _("Can not connect to the streaming server"),
+ "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."
+ => _("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
+ /*****embedded variable*****/
+ "For more details, please read the " => _("For more details, please read the "),
+ "Airtime manual" => _("Airtime manual"),
+ "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
+ => _("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."),
+ "Check this box to automatically switch off Master/Show source upon source disconnection." => _("Check this box to automatically switch off Master/Show source upon source disconnection."),
+ "Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
+ "If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
+ "If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
+ "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
+ => _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
+ //preferences/support-setting.js
+ "Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
+ //schedule/add-show.js
+ "No result found" => _("No result found"),
+ "This follows the same security pattern for the shows: only users assigned to the show can connect." => _("This follows the same security pattern for the shows: only users assigned to the show can connect."),
+ "Specify custom authentication which will work only for this show." => _("Specify custom authentication which will work only for this show."),
+ "If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
+ "The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ //schedule/full-calendar-functions
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ "Show" => _("Show"),
+ "Show is empty" => _("Show is empty"),
+ "1m" => _("1m"),
+ "5m" => _("5m"),
+ "10m" => _("10m"),
+ "15m" => _("15m"),
+ "30m" => _("30m"),
+ "60m" => _("60m"),
+ "Uploading in progress..." => _("Uploading in progress..."),
+ "Retreiving data from the server..." => _("Retreiving data from the server..."),
+ //already in library/library.js
+ //"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
+ //"There was error while uploading to soundcloud." => _("There was error while uploading to soundcloud."),
+ //"Error code: " => _("Error code: "),
+ //"Error msg: " => _("Error msg: "),
+ "This show has no scheduled content." => _("This show has no scheduled content."),
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ //schedule/schedule.js
+ "Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."),
+ "Cancel Current Show?" => _("Cancel Current Show?"),
+ "Stop recording current show?" => _("Stop recording current show?"),
+ "Ok" => _("Ok"),
+ "Contents of Show" => _("Contents of Show"),
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ "Remove all content?" => _("Remove all content?"),
+ //showbuilder/builder.js
+ "Delete selected item(s)?" => _("Delete selected item(s)?"),
+ "Start" => _("Start"),
+ "End" => _("End"),
+ "Duration" => _("Duration"),
+ //already in library/library.js
+ //"Title" => _("Title"),
+ //"Creator" => _("Creator"),
+ //"Album" => _("Album"),
+ //"Mime" => _("Mime"),
+ "Cue In" => _("Cue In"),
+ "Cue Out" => _("Cue Out"),
+ "Fade In" => _("Fade In"),
+ "Fade Out" => _("Fade Out"),
+ "Show Empty" => _("Show Empty"),
+ "Recording From Line In" => _("Recording From Line In"),
+ "Track preview" => _("Track preview"),
+ //already in library/spl/js
+ //"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
+ //=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
+ "Cannot schedule outside a show." => _("Cannot schedule outside a show."),
+ /*****embedded variable*****/
+ "Moving " => _("Moving "),
+ " Item." => _(" Item."),
+ " Items." => _(" Items."),
+ //already in library/library.js
+ "Select" => _("Select"),
+ "Select all" => _("Select all"),
+ "Select none" => _("Select none"),
+ "Remove overbooked tracks" => _("Remove overbooked tracks"),
+ "Remove selected scheduled items" => _("Remove selected scheduled items"),
+ "Jump to the current playing track" => _("Jump to the current playing track"),
+ "Cancel current show" => _("Cancel current show"),
+ //already in schedule/schedule.js
+ //"Cancel Current Show?" => _("Cancel Current Show?"),
+ "Stop recording current show?" => _("Stop recording current show?"),
+ //showbuilder/main_builder.js
+ "Open library to add or remove content" => _("Open library to add or remove content"),
+ "Add / Remove Content" => _("Add / Remove Content"),
+ //status/status.js
+ "in use" => _("in use"),
+ "Disk" => _("Disk"),
+ //user/user.js
+ "Admin" => _("Admin"),
+ "DJ" => _("DJ"),
+ "Program Manager" => _("Program Manager"),
+ "Guest" => _("Guest"),
+
+ );
+ $this->view->layout()->disableLayout();
+ $this->_helper->viewRenderer->setNoRender(true);
+ header("Content-type: text/javascript");
+ echo "var lang_dict=".json_encode($translations);
+
+ }
+}
\ No newline at end of file
diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js
index 984b9419e..a990f82a5 100644
--- a/airtime_mvc/public/js/airtime/common/common.js
+++ b/airtime_mvc/public/js/airtime/common/common.js
@@ -104,7 +104,7 @@ function open_show_preview(p_showID, p_showIndex) {
}
function openPreviewWindow(url) {
- _preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
+ _preview_window = window.open(url, $.i18n._('Audio Player'), 'width=450,height=100,scrollbars=yes');
return false;
}
diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js
index df107ef15..1f72a76b2 100644
--- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js
+++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js
@@ -143,24 +143,24 @@ function updatePlaybar(){
}
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
if (currentSong.record == "1")
- $('#current').html("Recording: "+currentSong.name+",");
+ $('#current').html(""+$.i18n._("Recording:")+""+currentSong.name+",");
else
$('#current').text(currentSong.name+",");
}else{
if (master_dj_on_air) {
if (showName) {
- $('#current').html("Current: "+showName+" - Master Stream");
+ $('#current').html("Current: "+showName+" - "+$.i18n._("Master Stream")+"");
} else {
- $('#current').html("Current: Master Stream");
+ $('#current').html("Current: "+$.i18n._("Master Stream")+"");
}
} else if (live_dj_on_air) {
if (showName) {
- $('#current').html("Current: "+showName+" - Live Stream");
+ $('#current').html("Current: "+showName+" - "+$.i18n._("Live Stream")+"");
} else {
- $('#current').html("Current: Live Stream");
+ $('#current').html("Current: "+$.i18n._("Live Stream")+"");
}
} else {
- $('#current').html("Current: Nothing Scheduled");
+ $('#current').html("Current: "+$.i18n._("Nothing Scheduled")+"");
}
}
@@ -191,7 +191,7 @@ function updatePlaybar(){
$('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs));
}
/* Column 1 update */
- $('#playlist').text("Current Show:");
+ $('#playlist').text($.i18n._("Current Show:"));
var recElem = $('.recording-show');
if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name);
diff --git a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
index 10afb2864..4b6675591 100644
--- a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
+++ b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
@@ -8,13 +8,13 @@ function getContent() {
var msg = "";
// See file airtime_mvc/application/views/helpers/VersionNotify.php for more info
if(isUpToDate()) {
- msg = "You are running the latest version";
+ msg = $.i18n._("You are running the latest version");
} else if (diff < 20) {
- msg = "New version available: " + link;
+ msg = $.i18n._("New version available: ") + link;
} else if (diff < 30) {
- msg = "This version will soon be obsolete. Please upgrade to " + link;
+ msg = $.i18n._("This version will soon be obsolete.")+" "+$.i18n._("Please upgrade to ") + link;
} else {
- msg = "This version is no longer supported. Please upgrade to " + link;
+ msg = $.i18n._("This version is no longer supported.")+" "+$.i18n._("Please upgrade to ") + link;
}
return msg;
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 457b219b7..ced6d852e 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 = ' Add to current playlist';
+ btnText = $.i18n._(' Add to current playlist');
} else if (objType === 'block') {
- btnText = ' Add to current smart block';
+ btnText = $.i18n._(' Add to current smart block');
} else {
- btnText = ' Add to current playlist';
+ btnText = $.i18n._(' Add to current playlist');
}
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
};
@@ -86,9 +86,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = "Adding 1 Item.";
+ message = $.i18n._("Adding 1 Item.");
} else {
- message = "Adding " + selected + " Items.";
+ message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
}
container = $('').append(
@@ -158,9 +158,9 @@ var AIRTIME = (function(AIRTIME) {
undefined, 'after');
} else {
if ($('#obj_type').val() == 'block') {
- alert('You can only add tracks to smart blocks.');
+ alert($.i18n._('You can only add tracks to smart blocks.'));
} else if ($('#obj_type').val() == 'playlist') {
- alert('You can only add tracks, smart blocks, and webstreams to playlists.');
+ alert($.i18n._('You can only add tracks, smart blocks, and webstreams to playlists.'));
}
}
});
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 ba03586d0..a0d5b4598 100644
--- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
+++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
@@ -66,9 +66,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = "Adding 1 Item.";
+ message = $.i18n._("Adding 1 Item.");
} else {
- message = "Adding " + selected + " Items.";
+ message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
}
container = $('').attr('id',
diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js
index 3b7c956be..72980ab15 100644
--- a/airtime_mvc/public/js/airtime/library/library.js
+++ b/airtime_mvc/public/js/airtime/library/library.js
@@ -109,12 +109,12 @@ var AIRTIME = (function(AIRTIME) {
$menu
.append("
" +
@@ -322,7 +322,7 @@ var AIRTIME = (function(AIRTIME) {
};
mod.fnDeleteSelectedItems = function() {
- if (confirm('Are you sure you want to delete the selected item(s)?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item(s)?'))) {
var aData = AIRTIME.library.getSelectedData(),
item,
temp,
@@ -439,31 +439,31 @@ var AIRTIME = (function(AIRTIME) {
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
- /* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
- /* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
- /* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
- /* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
- /* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
- /* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
- /* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
- /* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
- /* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
- /* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
- /* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
- /* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
- /* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
- /* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
- /* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
- /* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
- /* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
- /* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
- /* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
- /* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
- /* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
- /* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
- /* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
- /* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
- /* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
+ /* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
+ /* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
+ /* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
+ /* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
+ /* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
+ /* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
+ /* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
+ /* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
+ /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
+ /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
+ /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
+ /* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
+ /* Language */ { "sTitle" : $.i18n._("Language") , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
+ /* Last Modified */ { "sTitle" : $.i18n._("Last Modified") , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
+ /* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
+ /* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
+ /* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
+ /* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
+ /* Owner */ { "sTitle" : $.i18n._("Owner") , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
+ /* Replay Gain */ { "sTitle" : $.i18n._("Replay Gain") , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
+ /* Sample Rate */ { "sTitle" : $.i18n._("Sample Rate") , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
+ /* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
+ /* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
+ /* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
+ /* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
],
"bProcessing": true,
@@ -611,7 +611,7 @@ var AIRTIME = (function(AIRTIME) {
// icon.
$(nRow).find("td:not(.library_checkbox, .library_type)").qtip({
content: {
- text: "Loading...",
+ text: $.i18n._("Loading..."),
title: {
text: aData.track_title
},
@@ -725,11 +725,11 @@ var AIRTIME = (function(AIRTIME) {
.addClass("dataTables_type")
.append('')
.find("select")
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
.end()
.change(function(ev){
oTable.fnDraw();
@@ -812,7 +812,7 @@ var AIRTIME = (function(AIRTIME) {
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
}
} else {
- throw new Exception("Unknown type: " + data.ftype);
+ throw new Exception($.i18n._("Unknown type: ") + data.ftype);
}
oItems.edit.callback = callback;
}
@@ -854,7 +854,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() {
aMedia = [];
aMedia.push({"id": data.id, "type": data.ftype});
- if (confirm('Are you sure you want to delete the selected item?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
AIRTIME.library.fnDeleteItems(aMedia);
}
};
@@ -863,7 +863,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() {
var media = [];
- if (confirm('Are you sure you want to delete the selected item?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
media.push({"id": data.id, "type": data.ftype});
$.post(oItems.del.url, {format: "json", media: media }, function(json){
@@ -1010,7 +1010,7 @@ function addQtipToSCIcons(){
if ($(this).hasClass("progress")){
$(this).qtip({
content: {
- text: "Uploading in progress..."
+ text: $.i18n._("Uploading in progress...")
},
position:{
adjust: {
@@ -1030,13 +1030,13 @@ function addQtipToSCIcons(){
else if($(this).hasClass("soundcloud")){
$(this).qtip({
content: {
- text: "Retrieving data from the server...",
+ text: $.i18n._("Retrieving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "The soundcloud id for this file is: "+json.sc_id);
+ this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
}
}
},
@@ -1057,14 +1057,15 @@ function addQtipToSCIcons(){
}else if($(this).hasClass("sc-error")){
$(this).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n._("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "There was error while uploading to soundcloud. "+"Error code: "+json.error_code+
- " "+"Error msg: "+json.error_msg+" ");
+ this.set('content.text', $.i18n._("There was an error while uploading to soundcloud.")+" "+
+ $.i18n._("Error code: ")+json.error_code+
+ " "+$.i18n._("Error msg: ")+json.error_msg+" ");
}
}
},
@@ -1167,13 +1168,13 @@ function validateAdvancedSearch(divs) {
function addRemoveValidationIcons(valid, field, searchTermType) {
var title = '';
if (searchTermType === 'i') {
- title = 'Input must be a positive number';
+ title = $.i18n._('Input must be a positive number');
} else if (searchTermType === 'n') {
- title = 'Input must be a number';
+ title = $.i18n._('Input must be a number');
} else if (searchTermType === 't') {
- title = 'Input must be in the format: yyyy-mm-dd';
+ title = $.i18n._('Input must be in the format: yyyy-mm-dd');
} else if (searchTermType === 'l') {
- title = 'Input must be in the format: hh:mm:ss.t';
+ title = $.i18n._('Input must be in the format: hh:mm:ss.t');
}
var validIndicator = " ",
diff --git a/airtime_mvc/public/js/airtime/library/plupload.js b/airtime_mvc/public/js/airtime/library/plupload.js
index 89b442217..de12ed800 100644
--- a/airtime_mvc/public/js/airtime/library/plupload.js
+++ b/airtime_mvc/public/js/airtime/library/plupload.js
@@ -56,7 +56,9 @@ $(document).ready(function() {
$(window).bind('beforeunload', function(){
if(uploadProgress){
- return "You are currently uploading files.\nGoing to another screen will cancel the upload process.\nAre you sure you want to leave the page?";
+ return $.i18n._("You are currently uploading files.")+"\n"+
+ $.i18n._("Going to another screen will cancel the upload process.")+"\n"+
+ $.i18n._("Are you sure you want to leave the page?");
}
});
diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js
index 21a11218b..b1ac5534b 100644
--- a/airtime_mvc/public/js/airtime/library/spl.js
+++ b/airtime_mvc/public/js/airtime/library/spl.js
@@ -74,7 +74,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueIn)){
- showError(span, "please put in a time '00:00:00 (.0)'");
+ showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
$.post(url,
@@ -111,7 +111,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueOut)){
- showError(span, "please put in a time '00:00:00 (.0)'");
+ showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
@@ -150,7 +150,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -188,7 +188,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -378,7 +378,7 @@ var AIRTIME = (function(AIRTIME){
} else {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
- content: 'Your browser does not support playing this file type: "'+ mime +'"',
+ content: $.i18n._("Your browser does not support playing this file type: ")+ mime,
show: 'mouseover',
hide: {
delay: 500,
@@ -402,7 +402,7 @@ var AIRTIME = (function(AIRTIME){
if ($(value).attr('blocktype') === 'dynamic') {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
- content: 'Dynamic block is not previewable',
+ content: $.i18n._('Dynamic block is not previewable'),
show: 'mouseover',
hide: {
delay: 500,
@@ -483,7 +483,7 @@ var AIRTIME = (function(AIRTIME){
"";
});
}
- $html += "
Limit to: "+data.limit.value+" "+data.limit.modifier+"
";
+ $html += "
"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"
";
}
$pl.find("#block_"+id+"_info").html($html).show();
mod.enableUI();
@@ -575,7 +575,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -599,7 +599,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -662,7 +662,7 @@ var AIRTIME = (function(AIRTIME){
var field = json.analysis[s];
if (!field[0]) {
- var elemId = "#"+s+"-error";
+ var elemId = "#"+s+$.i18n._("-error");
var $div = $("#side_playlist " + elemId).text(field[1]).show();
}
}
@@ -718,7 +718,7 @@ var AIRTIME = (function(AIRTIME){
if (obj_type == "block") {
callback(data, "save");
} else {
- $('.success').text('Playlist saved');
+ $('.success').text($.i18n._('Playlist saved'));
$('.success').show();
setTimeout(removeSuccessMsg, 5000);
dt.fnStandingRedraw();
@@ -1055,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){
$pl.find(".ui-icon-alert").qtip({
content: {
- text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
+ text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore.")
},
position:{
adjust: {
diff --git a/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js b/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
index a410acf62..b33e4e51a 100644
--- a/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
+++ b/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
@@ -134,7 +134,7 @@ function plot(datasets){
var y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY,
- "Listener Count on '"+item.series.label + "': " + Math.floor(y));
+ $.i18n._("Listener Count on")+" '"+item.series.label + "': " + Math.floor(y));
}
}
else {
@@ -145,7 +145,7 @@ function plot(datasets){
$("#placeholder").bind("plotclick", function (event, pos, item) {
if (item) {
- $("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + ".");
+ $("#clickdata").text($.i18n._("You clicked point ") + item.dataIndex + " "+$.i18n._("in")+" " + item.series.label + ".");
plot.highlight(item.series, item.datapoint);
}
});
diff --git a/airtime_mvc/public/js/airtime/nowplaying/register.js b/airtime_mvc/public/js/airtime/nowplaying/register.js
index c91a285b8..018252bbf 100644
--- a/airtime_mvc/public/js/airtime/nowplaying/register.js
+++ b/airtime_mvc/public/js/airtime/nowplaying/register.js
@@ -16,7 +16,7 @@ $(document).ready(function(){
buttons: [
{
id: "remind_me",
- text: "Remind me in 1 week",
+ text: $.i18n._("Remind me in 1 week"),
"class": "btn",
click: function() {
var url = baseUrl+'/Usersettings/remindme';
@@ -29,7 +29,7 @@ $(document).ready(function(){
},
{
id: "remind_never",
- text: "Remind me never",
+ text: $.i18n._("Remind me never"),
"class": "btn",
click: function() {
var url =baseUrl+'/Usersettings/remindme-never';
@@ -42,7 +42,7 @@ $(document).ready(function(){
},
{
id: "help_airtime",
- text: "Yes, help Airtime",
+ text: $.i18n._("Yes, help Airtime"),
"class": "btn",
click: function() {
$("#register-form").submit();
@@ -129,7 +129,7 @@ $(document).ready(function(){
var ul, li;
ul = logoEl.find('.errors');
- li = $("").append("Image must be one of jpg, jpeg, png, or gif");
+ li = $("").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created.
if (ul.length > 0) {
diff --git a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
index f963ab9cd..4dd5c0f23 100644
--- a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
+++ b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
@@ -378,10 +378,8 @@ function setupUI() {
$(".playlist_type_help_icon").qtip({
content: {
- text: "A static smart block will save the criteria and generate the block content immediately. " +
- "This allows you to edit and view it in the Library before adding it to a show.
" +
- "A dynamic smart block will only save the criteria. The block content will get generated upon " +
- "adding it to a show. You will not be able to view and edit the content in the Library."
+ text: $.i18n._("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.")+"
" +
+ $.i18n._("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.")
},
hide: {
delay: 500,
@@ -402,8 +400,7 @@ function setupUI() {
$(".repeat_tracks_help_icon").qtip({
content: {
- text: "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length." +
- " Hence, if you check this option, tracks will be used more than once."
+ text: $.i18n._("If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once.")
},
hide: {
delay: 500,
@@ -495,9 +492,9 @@ function callback(data, type) {
var form = $('#smart-block-form');
if (json.result == "0") {
if (type == 'shuffle') {
- form.find('.success').text('Smart block shuffled');
+ form.find('.success').text($.i18n._('Smart block shuffled'));
} else if (type == 'generate') {
- form.find('.success').text('Smart block generated and criteria saved');
+ form.find('.success').text($.i18n._('Smart block generated and criteria saved'));
//redraw library table so the length gets updated
dt.fnStandingRedraw();
}
@@ -508,7 +505,7 @@ function callback(data, type) {
AIRTIME.playlist.fnOpenPlaylist(json);
var form = $('#smart-block-form');
if (json.result == "0") {
- $('#sp-success-saved').text('Smart block saved');
+ $('#sp-success-saved').text($.i18n._('Smart block saved'));
$('#sp-success-saved').show();
//redraw library table so the length gets updated
@@ -553,7 +550,7 @@ function removeButtonCheck() {
function enableLoadingIcon() {
$("#side_playlist").block({
- message: "Processing...",
+ message: $.i18n._("Processing..."),
theme: true,
allowBodyStretch: true,
applyPlatformOpacityRules: false
@@ -594,20 +591,20 @@ var criteriaTypes = {
};
var stringCriteriaOptions = {
- "0" : "Select modifier",
- "contains" : "contains",
- "does not contain" : "does not contain",
- "is" : "is",
- "is not" : "is not",
- "starts with" : "starts with",
- "ends with" : "ends with"
+ "0" : $.i18n._("Select modifier"),
+ "contains" : $.i18n._("contains"),
+ "does not contain" : $.i18n._("does not contain"),
+ "is" : $.i18n._("is"),
+ "is not" : $.i18n._("is not"),
+ "starts with" : $.i18n._("starts with"),
+ "ends with" : $.i18n._("ends with")
};
var numericCriteriaOptions = {
- "0" : "Select modifier",
- "is" : "is",
- "is not" : "is not",
- "is greater than" : "is greater than",
- "is less than" : "is less than",
- "is in the range" : "is in the range"
+ "0" : $.i18n._("Select modifier"),
+ "is" : $.i18n._("is"),
+ "is not" : $.i18n._("is not"),
+ "is greater than" : $.i18n._("is greater than"),
+ "is less than" : $.i18n._("is less than"),
+ "is in the range" : $.i18n._("is in the range")
};
diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js
index 321b32581..26d2ccebe 100644
--- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js
+++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js
@@ -65,12 +65,12 @@ var AIRTIME = (function(AIRTIME) {
oTable = historyTableDiv.dataTable( {
"aoColumns": [
- {"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */
- {"sTitle": "Creator", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
- {"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */
- {"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
- {"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
- {"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
+ {"sTitle": $.i18n._("Title"), "mDataProp": "title", "sClass": "his_title"}, /* Title */
+ {"sTitle": $.i18n._("Creator"), "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
+ {"sTitle": $.i18n._("Played"), "mDataProp": "played", "sClass": "his_artist"}, /* times played */
+ {"sTitle": $.i18n._("Length"), "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
+ {"sTitle": $.i18n._("Composer"), "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
+ {"sTitle": $.i18n._("Copyright"), "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
],
"bProcessing": true,
diff --git a/airtime_mvc/public/js/airtime/preferences/musicdirs.js b/airtime_mvc/public/js/airtime/preferences/musicdirs.js
index 55e335cd6..072359492 100644
--- a/airtime_mvc/public/js/airtime/preferences/musicdirs.js
+++ b/airtime_mvc/public/js/airtime/preferences/musicdirs.js
@@ -15,7 +15,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
- title: 'Choose Storage Folder',
+ title: $.i18n._('Choose Storage Folder'),
basePath: '',
requestMethod: 'POST',
});
@@ -35,7 +35,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
- title: 'Choose Folder to Watch',
+ title: $.i18n._('Choose Folder to Watch'),
basePath: '',
requestMethod: 'POST',
});
@@ -43,7 +43,7 @@ function setWatchedDirEvents() {
$('#storageFolder-ok').click(function(){
var url, chosen;
- if(confirm("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!")){
+ if(confirm($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"))){
url = baseUrl+"/Preference/change-stor-directory";
chosen = $('#storageFolder').val();
@@ -72,7 +72,7 @@ function setWatchedDirEvents() {
function(json) {
$("#watched-folder-section").empty();
- $("#watched-folder-section").append("
Manage Media Folders
");
+ $("#watched-folder-section").append("
"+$.i18n._("Manage Media Folders")+"
");
$("#watched-folder-section").append(json.subform);
setWatchedDirEvents();
});
@@ -84,7 +84,7 @@ function setWatchedDirEvents() {
});
$('.selected-item').find('.ui-icon-close').click(function(){
- if(confirm("Are you sure you want to remove the watched folder?")){
+ if(confirm($.i18n._("Are you sure you want to remove the watched folder?"))){
var row = $(this).parent();
var folder = row.find('#folderPath').text();
@@ -95,7 +95,7 @@ function setWatchedDirEvents() {
function(json) {
$("#watched-folder-section").empty();
- $("#watched-folder-section").append("
Manage Media Folders
");
+ $("#watched-folder-section").append("
"+$.i18n._("Manage Media Folders")+"
");
$("#watched-folder-section").append(json.subform);
setWatchedDirEvents();
});
@@ -108,7 +108,7 @@ $(document).ready(function() {
setWatchedDirEvents();
$(".ui-icon-alert").qtip({
content: {
- text: "This path is currently not accessible."
+ text: $.i18n._("This path is currently not accessible.")
},
position:{
adjust: {
diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
index 973c66356..1362fb456 100644
--- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js
+++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
@@ -93,13 +93,13 @@ function checkLiquidsoapStatus(){
}
var html;
if(status == "OK"){
- html = '
Connected to the streaming server
';
+ html = '
'+$.i18n._("Connected to the streaming server")+'
';
}else if(status == "N/A"){
- html = '
The stream is disabled
';
+ html = '
'+$.i18n._("The stream is disabled")+'
';
}else if(status == "waiting"){
- html = '
Getting information from the server...
';
+ html = '
'+$.i18n._("Getting information from the server...")+'
';
}else{
- html = '
Can not connect to the streaming server
'+status+'
';
+ html = '
'+$.i18n._("Can not connect to the streaming server")+'
'+status+'
';
}
$("#s"+id+"Liquidsoap-error-msg-element").html(html);
}
@@ -250,7 +250,8 @@ function setupEventListeners() {
// qtip for help text
$(".override_help_icon").qtip({
content: {
- text: "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151. For more detail, please read the Airtime manual."
+ text: $.i18n._("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151.")+" "+
+ $.i18n._("For more details, please read the ")+""+$.i18n._("Airtime manual")+"."
},
hide: {
delay: 500,
@@ -271,7 +272,7 @@ function setupEventListeners() {
$(".icecast_metadata_help_icon").qtip({
content: {
- text: "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
+ text: $.i18n._("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.")
},
hide: {
delay: 500,
@@ -292,7 +293,7 @@ function setupEventListeners() {
$("#auto_transition_help").qtip({
content: {
- text: "Check this box to automatically switch off Master/Show source upon source disconnection."
+ text: $.i18n._("Check this box to automatically switch off Master/Show source upon source disconnection.")
},
hide: {
delay: 500,
@@ -313,7 +314,7 @@ function setupEventListeners() {
$("#auto_switch_help").qtip({
content: {
- text: "Check this box to automatically switch on Master/Show source upon source connection."
+ text: $.i18n._("Check this box to automatically switch on Master/Show source upon source connection.")
},
hide: {
delay: 500,
@@ -334,7 +335,7 @@ function setupEventListeners() {
$(".stream_username_help_icon").qtip({
content: {
- text: "If your Icecast server expects a username of 'source', this field can be left blank."
+ text: $.i18n._("If your Icecast server expects a username of 'source', this field can be left blank.")
},
hide: {
delay: 500,
@@ -355,7 +356,7 @@ function setupEventListeners() {
$(".master_username_help_icon").qtip({
content: {
- text: "If your live streaming client does not ask for a username, this field should be 'source'."
+ text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
},
hide: {
delay: 500,
@@ -375,12 +376,7 @@ function setupEventListeners() {
})
$('#stream_save').live('click', function(){
- var confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the "
- + "playout engine will be rebooted and your listeners will hear silence for"
- + "5-10 seconds. Changing the following fields will NOT cause a reboot: "
- + "Stream Label (Global Settings), and Switch Transition Fade(s), Master "
- + "Username, and Master Password (Input Stream Settings). If Airtime is recording"
- + ", and if the change causes a playout engine restart, the recording will be interrupted.";
+ var confirm_pypo_restart_text = $.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting';
diff --git a/airtime_mvc/public/js/airtime/preferences/support-setting.js b/airtime_mvc/public/js/airtime/preferences/support-setting.js
index 7e4331960..0e72daf9f 100644
--- a/airtime_mvc/public/js/airtime/preferences/support-setting.js
+++ b/airtime_mvc/public/js/airtime/preferences/support-setting.js
@@ -61,7 +61,7 @@ $(document).ready(function() {
var ul, li;
ul = logoEl.find('.errors');
- li = $("").append("Image must be one of jpg, jpeg, png, or gif");
+ li = $("").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created.
if (ul.length > 0) {
diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js
index b7659504d..f3bcc07ca 100644
--- a/airtime_mvc/public/js/airtime/schedule/add-show.js
+++ b/airtime_mvc/public/js/airtime/schedule/add-show.js
@@ -53,7 +53,7 @@ function findHosts(request, callback) {
var noResult = new Array();
noResult[0] = new Array();
noResult[0]['value'] = $("#add_show_hosts_autocomplete").val();
- noResult[0]['label'] = "No result found";
+ noResult[0]['label'] = $.i18n._("No result found");
noResult[0]['index'] = null;
$.post(url,
@@ -226,7 +226,7 @@ function setAddShowEvents() {
form.find(".airtime_auth_help_icon").qtip({
content: {
- text: "This follows the same security pattern for the shows: only users assigned to the show can connect."
+ text: $.i18n._("This follows the same security pattern for the shows: only users assigned to the show can connect.")
},
hide: {
delay: 500,
@@ -246,7 +246,7 @@ function setAddShowEvents() {
});
form.find(".custom_auth_help_icon").qtip({
content: {
- text: "Specify custom authentication which will work only for this show."
+ text: $.i18n._("Specify custom authentication which will work only for this show.")
},
hide: {
delay: 500,
@@ -266,7 +266,7 @@ function setAddShowEvents() {
});
form.find(".stream_username_help_icon").qtip({
content: {
- text: "If your live streaming client does not ask for a username, this field should be 'source'."
+ text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
},
hide: {
delay: 500,
@@ -628,7 +628,7 @@ $(document).ready(function() {
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload();
}
diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
index 006954154..4bfaabf56 100644
--- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
+++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
@@ -6,7 +6,7 @@
function scheduleRefetchEvents(json) {
if(json.show_error == true){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
}
if(json.show_id) {
var dialog_id = parseInt($("#add_show_id").val(), 10);
@@ -41,7 +41,7 @@ function openAddShowForm() {
function makeAddShowButton(){
$('.fc-header-left')
.append('')
- .append('Show')
+ .append(''+$.i18n._("Show")+'')
.find('span.fc-button:last > a')
.click(function(){
openAddShowForm();
@@ -154,12 +154,12 @@ function viewDisplay( view ) {
var calendarEl = this;
var select = $('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
.change(function(){
var slotMin = $(this).val();
var opt = view.calendar.options;
@@ -261,7 +261,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) {
$(element)
.find(".fc-event-time")
- .before('');
+ .before('');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@@ -275,7 +275,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) {
$(element)
.find(".fc-event-title")
- .after('');
+ .after('');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@@ -424,7 +424,7 @@ function addQtipToSCIcons(ele){
if($(ele).hasClass("progress")){
$(ele).qtip({
content: {
- text: "Uploading in progress..."
+ text: $.i18n.("Uploading in progress...")
},
position:{
adjust: {
@@ -442,13 +442,13 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("soundcloud")){
$(ele).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n.("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "The soundcloud id for this file is: "+json.sc_id);
+ this.set('content.text', $.i18n.("The soundcloud id for this file is: ")+json.sc_id);
}
}
},
@@ -468,14 +468,14 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("sc-error")){
$(ele).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n.("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "show"}),
success: function(json, status){
- this.set('content.text', "There was error while uploading to soundcloud. "+"Error code: "+json.error_code+
- " "+"Error msg: "+json.error_msg+" ");
+ this.set('content.text', $.i18n.("There was error while uploading to soundcloud.")+" "+$.i18n._("Error code: ")+json.error_code+
+ " "+$.i18n._("Error msg: ")+json.error_msg+" ");
}
}
},
@@ -495,7 +495,7 @@ function addQtipToSCIcons(ele){
}else if ($(ele).hasClass("show-empty")){
$(ele).qtip({
content: {
- text: "This show has no scheduled content."
+ text: $.i18n._("This show has no scheduled content.")
},
position:{
adjust: {
@@ -548,7 +548,7 @@ function checkEmptyShowStatus(e) {
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n.("The show instance doesn't exist anymore!"));
window.location.reload();
}
diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js
index e91f65c34..8c92c528f 100644
--- a/airtime_mvc/public/js/airtime/schedule/schedule.js
+++ b/airtime_mvc/public/js/airtime/schedule/schedule.js
@@ -22,7 +22,7 @@ function checkShowLength(json) {
if (percent > 100){
$("#show_time_warning")
- .text("Shows longer than their scheduled time will be cut off by a following show.")
+ .text($.i18n._("Shows longer than their scheduled time will be cut off by a following show."))
.show();
}
else {
@@ -33,7 +33,7 @@ function checkShowLength(json) {
}
function confirmCancelShow(show_instance_id){
- if (confirm('Cancel Current Show?')) {
+ if (confirm($.i18n._('Cancel Current Show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@@ -46,7 +46,7 @@ function confirmCancelShow(show_instance_id){
}
function confirmCancelRecordedShow(show_instance_id){
- if (confirm('Stop recording current show?')) {
+ if (confirm($.i18n._('Stop recording current show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@@ -165,7 +165,7 @@ function buildScheduleDialog (json) {
close: closeDialog,
buttons: [
{
- text: "Ok",
+ text: $.i18n._("Ok"),
"class": "btn",
click: function() {
$(this).dialog("close");
@@ -207,14 +207,14 @@ function buildContentDialog (json){
dialog.dialog({
autoOpen: false,
- title: "Contents of Show \"" + json.showTitle + "\"",
+ title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
width: width,
height: height,
modal: true,
close: closeDialog,
buttons: [
{
- text: "Ok",
+ text: $.i18n._("Ok"),
"class": "btn",
click: function() {
dialog.remove();
@@ -283,7 +283,7 @@ function createFullCalendar(data){
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload();
}
@@ -324,7 +324,7 @@ $(document).ready(function() {
if (oItems.clear !== undefined) {
callback = function() {
- if (confirm("Remove all content?")) {
+ if (confirm($.i18n._("Remove all content?"))) {
$.post(oItems.clear.url, {format: "json", id: data.id}, function(json){
scheduleRefetchEvents(json);
});
diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js
index 7fd4fa5b4..e410ba739 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js
@@ -283,7 +283,7 @@ var AIRTIME = (function(AIRTIME){
mod.fnRemove = function(aItems) {
mod.disableUI();
- if (confirm("Delete selected item(s)?")) {
+ if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"/showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
@@ -360,17 +360,17 @@ var AIRTIME = (function(AIRTIME){
"aoColumns": [
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
- /* starts */ {"mDataProp": "starts", "sTitle": "Start", "sClass": "sb-starts", "sWidth": "60px"},
- /* ends */ {"mDataProp": "ends", "sTitle": "End", "sClass": "sb-ends", "sWidth": "60px"},
- /* runtime */ {"mDataProp": "runtime", "sTitle": "Duration", "sClass": "library_length sb-length", "sWidth": "65px"},
- /* title */ {"mDataProp": "title", "sTitle": "Title", "sClass": "sb-title"},
- /* creator */ {"mDataProp": "creator", "sTitle": "Creator", "sClass": "sb-creator"},
- /* album */ {"mDataProp": "album", "sTitle": "Album", "sClass": "sb-album"},
- /* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"},
- /* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"},
- /* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"},
- /* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"},
- /* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"}
+ /* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
+ /* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
+ /* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
+ /* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
+ /* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
+ /* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
+ /* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
+ /* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
+ /* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
+ /* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
+ /* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
],
"bJQueryUI": true,
@@ -527,7 +527,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]);
$node.html('');
- sSeparatorHTML = 'Show Empty';
+ sSeparatorHTML = ''+$.i18n._("Show Empty")+'';
cl = cl + " sb-empty odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@@ -539,7 +539,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]);
$node.html('');
- sSeparatorHTML = 'Recording From Line In';
+ sSeparatorHTML = ''+$.i18n._("Recording From Line In")+'';
cl = cl + " sb-record odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@@ -554,7 +554,7 @@ var AIRTIME = (function(AIRTIME){
if (!isAudioSupported(aData.mime)) {
$image.html('');
} else {
- $image.html('')
+ $image.html('')
.click(function() {
open_show_preview(aData.instance, aData.pos);
return false;
@@ -565,7 +565,7 @@ var AIRTIME = (function(AIRTIME){
$image.html('');
$image.find(".ui-icon-alert").qtip({
content: {
- text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
+ text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore.")
},
style: {
classes: "ui-tooltip-dark"
@@ -877,7 +877,7 @@ var AIRTIME = (function(AIRTIME){
//can't add items outside of shows.
if (prev.find("td:first").hasClass("dataTables_empty")
|| prev.length === 0) {
- alert("Cannot schedule outside a show.");
+ alert($.i18n._("Cannot schedule outside a show."));
ui.item.remove();
return;
}
@@ -932,10 +932,10 @@ var AIRTIME = (function(AIRTIME){
}
if (selected.length === 1) {
- message = "Moving "+selected.length+" Item.";
+ message = $.i18n._("Moving ")+selected.length+$.i18n._(" Item.");
}
else {
- message = "Moving "+selected.length+" Items.";
+ message = $.i18n._("Moving ")+selected.length+$.i18n._(" Items.");
}
draggingContainer = $('
");
//if 'Add/Remove content' was chosen from the context menu
//in the Calendar do not append these buttons
if ($(".ui-dialog-content").length === 0) {
$menu.append("
" +
- "" +
+ "" +
"
")
.append("
" +
- "" +
+ "" +
"
");
}
@@ -1019,7 +1019,7 @@ var AIRTIME = (function(AIRTIME){
.click(function() {
var $tr,
data,
- msg = 'Cancel Current Show?';
+ msg = $.i18n._('Cancel Current Show?');
if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
return;
@@ -1031,7 +1031,7 @@ var AIRTIME = (function(AIRTIME){
data = $tr.data("aData");
if (data.record === true) {
- msg = 'Stop recording current show?';
+ msg = $.i18n._('Stop recording current show?');
}
if (confirm(msg)) {
diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
index 74358a99d..70be61183 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
@@ -15,7 +15,7 @@ AIRTIME = (function(AIRTIME) {
timeStartId = "#sb_time_start",
dateEndId = "#sb_date_end",
timeEndId = "#sb_time_end",
- $toggleLib = $("Add / Remove Content"),
+ $toggleLib = $(""+$.i18n._("Add / Remove Content")+""),
$libClose = $('', {
"class": "close-round",
"href": "#",
diff --git a/airtime_mvc/public/js/airtime/status/status.js b/airtime_mvc/public/js/airtime/status/status.js
index 9223b247a..cd0699e3a 100644
--- a/airtime_mvc/public/js/airtime/status/status.js
+++ b/airtime_mvc/public/js/airtime/status/status.js
@@ -2,7 +2,7 @@ function generatePartitions(partitions){
var rowTemplate =
'
'+
- '
Disk #%s'+
+ '
'+$.i18n._("Disk")+' #%s'+
'
'+
'
'+
'
'+
@@ -12,7 +12,7 @@ function generatePartitions(partitions){
'
- Update Required
- To play the media you will need to either update your browser to a recent version or update your Flash plugin.
+ echo _("Update Required") ?>
+ To play the media you will need to either update your browser to a recent version or update your echo _("Flash plugin") ?>.
Click the box below to advertise your station on
- Sourcefabric.org.
+ echo _("Sourcefabric.org"); ?>.
In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback.
echo _("Update Required") ?>
- To play the media you will need to either update your browser to a recent version or update your echo _("Flash plugin") ?>.
+ sprintf(_("To play the media you will need to either update your browser to a recent version or update your %sFlash plugin%s."),
+ "",
+ "") ?>
Here's how you can get started using Airtime to automate your broadcasts:
+
+
-
Begin by adding your files to the library using the "Add Media" menu button. You can drag and drop your files to this window too.
-
Create a show by going to "Calendar" in the menu bar, and then clicking the "+ Show" icon. This can be either a one-time or repeating show. Only admins and program managers can add shows.
-
Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting "Add / Remove Content".
-
echo _("Select your media from the left pane and drag them to your show in the right pane."); ?>
\ No newline at end of file
diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
index 46c394ce3..e21347cb3 100644
--- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
+++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml
@@ -105,7 +105,8 @@
- Help Airtime improve by letting us know how you are using it. This info
- will be collected regularly in order to enhance your user experience.
-
- Click "Yes, help Airtime" and we'll make sure the features you use are
- constantly improving.
+ ") ?>
@@ -23,9 +22,10 @@
- Click the box below to advertise your station on
- echo _("Sourcefabric.org"); ?>.
- In order to promote your station, "Send support feedback" must be enabled. This data will be collected in addition to the support feedback.
+ ",
+ "")?>
- Help Airtime improve by letting Sourcefabric know how you are using it. This information
- will be collected regularly in order to enhance your user experience.
- Click the "Send support feedback" box and we'll make sure the features you use are
- constantly improving.
+ ")?>
";
$this->view->streamId = -1;
$this->view->analysis = $analysis;
}
From a76b9b305fd5f051ed842f4fa54390285c3e0266 Mon Sep 17 00:00:00 2001
From: denise
Date: Thu, 15 Nov 2012 15:52:51 -0500
Subject: [PATCH 20/62] CC-1960: Internationalize Airtime / Support
translations
-added gettext wrapper to all strings in models
---
airtime_mvc/application/models/Auth.php | 2 +-
airtime_mvc/application/models/Block.php | 64 +++++++++----------
airtime_mvc/application/models/MusicDir.php | 18 +++---
airtime_mvc/application/models/Playlist.php | 12 ++--
airtime_mvc/application/models/Scheduler.php | 20 +++---
airtime_mvc/application/models/Show.php | 8 +--
.../application/models/ShowInstance.php | 18 +++---
airtime_mvc/application/models/StoredFile.php | 39 ++++++-----
airtime_mvc/application/models/Webstream.php | 22 +++----
9 files changed, 102 insertions(+), 101 deletions(-)
diff --git a/airtime_mvc/application/models/Auth.php b/airtime_mvc/application/models/Auth.php
index 2aef1ce81..ff27711bd 100644
--- a/airtime_mvc/application/models/Auth.php
+++ b/airtime_mvc/application/models/Auth.php
@@ -30,7 +30,7 @@ class Application_Model_Auth
$e_link_port = $_SERVER['SERVER_PORT'];
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
- $message = "Hi {$user->getDbLogin()}, \n\nClick this link to reset your password: ";
+ $message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
$success = Application_Model_Email::send('Airtime Password Reset', $message, $user->getDbEmail());
diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php
index c41bc579f..f3ff7bf12 100644
--- a/airtime_mvc/application/models/Block.php
+++ b/airtime_mvc/application/models/Block.php
@@ -754,7 +754,7 @@ SQL;
try {
if (is_null($cueIn) && is_null($cueOut)) {
- $errArray["error"] = "Cue in and cue out are null.";
+ $errArray["error"] = _("Cue in and cue out are null.");
return $errArray;
}
@@ -789,7 +789,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -800,7 +800,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -821,7 +821,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -845,7 +845,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -856,7 +856,7 @@ SQL;
);
$result = Application_Common_Database::prepareAndExecute($sql, $params, 'column');
if ($result) {
- $errArray["error"] = "Can't set cue out to be smaller than cue in.";
+ $errArray["error"] = _("Can't set cue out to be smaller than cue in.");
return $errArray;
}
@@ -1204,32 +1204,32 @@ SQL;
public function getCriteria()
{
$criteriaOptions = array(
- 0 => "Select criteria",
- "album_title" => "Album",
- "bit_rate" => "Bit Rate (Kbps)",
- "bpm" => "BPM",
- "composer" => "Composer",
- "conductor" => "Conductor",
- "copyright" => "Copyright",
- "artist_name" => "Creator",
- "encoded_by" => "Encoded By",
- "genre" => "Genre",
- "isrc_number" => "ISRC",
- "label" => "Label",
- "language" => "Language",
- "mtime" => "Last Modified",
- "lptime" => "Last Played",
- "length" => "Length",
- "mime" => "Mime",
- "mood" => "Mood",
- "owner_id" => "Owner",
- "replay_gain" => "Replay Gain",
- "sample_rate" => "Sample Rate (kHz)",
- "track_title" => "Title",
- "track_number" => "Track Number",
- "utime" => "Uploaded",
- "info_url" => "Website",
- "year" => "Year"
+ 0 => _("Select criteria"),
+ "album_title" => _("Album"),
+ "bit_rate" => _("Bit Rate (Kbps)"),
+ "bpm" => _("BPM"),
+ "composer" => _("Composer"),
+ "conductor" => _("Conductor"),
+ "copyright" => _("Copyright"),
+ "artist_name" => _("Creator"),
+ "encoded_by" => _("Encoded By"),
+ "genre" => _("Genre"),
+ "isrc_number" => _("ISRC"),
+ "label" => _("Label"),
+ "language" => _("Language"),
+ "mtime" => _("Last Modified"),
+ "lptime" => _("Last Played"),
+ "length" => _("Length"),
+ "mime" => _("Mime"),
+ "mood" => _("Mood"),
+ "owner_id" => _("Owner"),
+ "replay_gain" => _("Replay Gain"),
+ "sample_rate" => _("Sample Rate (kHz)"),
+ "track_title" => _("Title"),
+ "track_number" => _("Track Number"),
+ "utime" => _("Uploaded"),
+ "info_url" => _("Website"),
+ "year" => _("Year")
);
// Load criteria from db
diff --git a/airtime_mvc/application/models/MusicDir.php b/airtime_mvc/application/models/MusicDir.php
index 6ace56550..f26b33522 100644
--- a/airtime_mvc/application/models/MusicDir.php
+++ b/airtime_mvc/application/models/MusicDir.php
@@ -157,15 +157,15 @@ SQL;
$diff = strlen($dir) - strlen($p_path);
if ($diff == 0) {
if ($dir == $p_path) {
- throw new NestedDirectoryException("'$p_path' is already watched.");
+ throw new NestedDirectoryException(sprintf(_("%s is already watched."), $p_path));
}
} elseif ($diff > 0) {
if (self::isAncestorDir($p_path, $dir)) {
- throw new NestedDirectoryException("'$p_path' contains nested watched directory: '$dir'");
+ throw new NestedDirectoryException(sprintf(_("%s contains nested watched directory: %s"), $p_path, $dir));
}
} else { /* diff < 0*/
if (self::isAncestorDir($dir, $p_path)) {
- throw new NestedDirectoryException("'$p_path' is nested within existing watched directory: '$dir'");
+ throw new NestedDirectoryException(sprintf(_("%s is nested within existing watched directory: %s"), $p_path, $dir));
}
}
}
@@ -186,7 +186,7 @@ SQL;
public static function addDir($p_path, $p_type, $userAddedWatchedDir=true, $nestedWatch=false)
{
if (!is_dir($p_path)) {
- return array("code"=>2, "error"=>"'$p_path' is not a valid directory.");
+ return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_path));
}
$real_path = Application_Common_OsPath::normpath($p_path)."/";
if ($real_path != "/") {
@@ -227,7 +227,8 @@ SQL;
return array("code"=>1, "error"=>"$msg");
} catch (Exception $e) {
- return array("code"=>1, "error"=>"'$p_path' is already set as the current storage dir or in the watched folders list");
+ return array("code"=>1,
+ "error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list"), $p_path));
}
}
@@ -359,7 +360,7 @@ SQL;
// path should always ends with trailing '/'
$p_dir = Application_Common_OsPath::normpath($p_dir)."/";
if (!is_dir($p_dir)) {
- return array("code"=>2, "error"=>"'$p_dir' is not a valid directory.");
+ return array("code"=>2, "error"=>sprintf(_("%s is not a valid directory."), $p_dir));
} elseif (Application_Model_Preference::GetImportTimestamp()+10 > time()) {
return array("code"=>3, "error"=>"Airtime is currently importing files. Please wait until this is complete before changing the storage directory.");
}
@@ -376,7 +377,8 @@ SQL;
return array("code"=>0);
} else {
- return array("code"=>1, "error"=>"'$p_dir' is already set as the current storage dir or in the watched folders list.");
+ return array("code"=>1,
+ "error"=>sprintf(_("%s is already set as the current storage dir or in the watched folders list."), $p_dir));
}
}
@@ -419,7 +421,7 @@ SQL;
}
$dir = Application_Model_MusicDir::getDirByPath($p_dir);
if (is_null($dir)) {
- return array("code"=>1, "error"=>"'$p_dir' doesn't exist in the watched list.");
+ return array("code"=>1, "error"=>sprintf(_("%s doesn't exist in the watched list."), $p_dir));
} else {
$dir->remove($userAddedWatchedDir);
$data = array();
diff --git a/airtime_mvc/application/models/Playlist.php b/airtime_mvc/application/models/Playlist.php
index 4e9562c72..fc1099837 100644
--- a/airtime_mvc/application/models/Playlist.php
+++ b/airtime_mvc/application/models/Playlist.php
@@ -721,7 +721,7 @@ SQL;
try {
if (is_null($cueIn) && is_null($cueOut)) {
- $errArray["error"] = "Cue in and cue out are null.";
+ $errArray["error"] = _("Cue in and cue out are null.");
return $errArray;
}
@@ -751,14 +751,14 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :cueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':cueOut'=>$cueOut), 'column')) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
@@ -774,7 +774,7 @@ SQL;
$sql = "SELECT :cueIn::INTERVAL > :oldCueOut::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueIn'=>$cueIn, ':oldCueOut'=>$oldCueOut), 'column')) {
- $errArray["error"] = "Can't set cue in to be larger than cue out.";
+ $errArray["error"] = _("Can't set cue in to be larger than cue out.");
return $errArray;
}
@@ -792,14 +792,14 @@ SQL;
$sql = "SELECT :cueOut::INTERVAL < :oldCueIn::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':oldCueIn'=>$oldCueIn), 'column')) {
- $errArray["error"] = "Can't set cue out to be smaller than cue in.";
+ $errArray["error"] = _("Can't set cue out to be smaller than cue in.");
return $errArray;
}
$sql = "SELECT :cueOut::INTERVAL > :origLength::INTERVAL";
if (Application_Common_Database::prepareAndExecute($sql, array(':cueOut'=>$cueOut, ':origLength'=>$origLength), 'column')) {
- $errArray["error"] = "Can't set cue out to be greater than file length.";
+ $errArray["error"] = _("Can't set cue out to be greater than file length.");
return $errArray;
}
diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php
index b36fc2223..fb5c2ebc4 100644
--- a/airtime_mvc/application/models/Scheduler.php
+++ b/airtime_mvc/application/models/Scheduler.php
@@ -79,12 +79,12 @@ class Application_Model_Scheduler
//an item has been deleted
if (count($schedIds) !== count($schedItems)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date! (sched mismatch)");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (sched mismatch)"));
}
//a show has been deleted
if (count($instanceIds) !== count($showInstances)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date! (instance mismatch)");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date! (instance mismatch)"));
}
foreach ($schedItems as $schedItem) {
@@ -92,7 +92,7 @@ class Application_Model_Scheduler
$instance = $schedItem->getCcShowInstances($this->con);
if (intval($schedInfo[$id]) !== $instance->getDbId()) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
}
}
@@ -102,24 +102,24 @@ class Application_Model_Scheduler
$show = $instance->getCcShow($this->con);
if ($this->checkUserPermissions && $this->user->canSchedule($show->getDbId()) === false) {
- throw new Exception("You are not allowed to schedule show {$show->getDbName()}.");
+ throw new Exception(sprintf(_("You are not allowed to schedule show %s."), $show->getDbName()));
}
if ($instance->getDbRecord()) {
- throw new Exception("You cannot add files to recording shows.");
+ throw new Exception(_("You cannot add files to recording shows."));
}
$showEndEpoch = floatval($instance->getDbEnds("U.u"));
if ($showEndEpoch < $nowEpoch) {
- throw new OutDatedScheduleException("The show {$show->getDbName()} is over and cannot be scheduled.");
+ throw new OutDatedScheduleException(sprintf(_("The show %s is over and cannot be scheduled."), $show->getDbName()));
}
$ts = intval($instanceInfo[$id]);
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
if ($ts < $lastSchedTs) {
Logging::info("ts {$ts} last sched {$lastSchedTs}");
- throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!");
+ throw new OutDatedScheduleException(sprintf(_("The show %s has been previously updated!"), $show->getDbName()));
}
}
}
@@ -138,7 +138,7 @@ class Application_Model_Scheduler
$file = CcFilesQuery::create()->findPK($id, $this->con);
if (is_null($file) || !$file->visible()) {
- throw new Exception("A selected File does not exist!");
+ throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
@@ -219,7 +219,7 @@ class Application_Model_Scheduler
$stream = CcWebstreamQuery::create()->findPK($id, $this->con);
if (is_null($stream) /* || !$file->visible() */) {
- throw new Exception("A selected File does not exist!");
+ throw new Exception(_("A selected File does not exist!"));
} else {
$data = $this->fileInfo;
$data["id"] = $id;
@@ -343,7 +343,7 @@ class Application_Model_Scheduler
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
if (is_null($instance)) {
- throw new OutDatedScheduleException("The schedule you're viewing is out of date!");
+ throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
}
$itemStartDT = $instance->getDbStarts(null);
diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php
index 6f088046d..7f55e8c2a 100644
--- a/airtime_mvc/application/models/Show.php
+++ b/airtime_mvc/application/models/Show.php
@@ -177,7 +177,7 @@ SQL;
$con = Propel::getConnection();
if ($deltaDay > 0) {
- return "Shows can have a max length of 24 hours.";
+ return _("Shows can have a max length of 24 hours.");
}
$utc = new DateTimeZone("UTC");
@@ -208,7 +208,7 @@ SQL;
$newEndsDateTime = Application_Model_ShowInstance::addDeltas($endsDateTime, $deltaDay, $deltaMin);
if ($newEndsDateTime->getTimestamp() < $nowDateTime->getTimestamp()) {
- return "End date/time cannot be in the past";
+ return _("End date/time cannot be in the past");
}
//convert our new starts/ends to UTC.
@@ -219,8 +219,8 @@ SQL;
$newStartsDateTime, $newEndsDateTime, true, $si->getDbId());
if ($overlapping) {
- return "Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
- "affects all of its repeats.";
+ return _("Cannot schedule overlapping shows.\nNote: Resizing a repeating show ".
+ "affects all of its repeats.");
}
}
diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php
index e1cdbe5b6..9a5e8a7d4 100644
--- a/airtime_mvc/application/models/ShowInstance.php
+++ b/airtime_mvc/application/models/ShowInstance.php
@@ -242,7 +242,7 @@ SQL;
public function moveShow($deltaDay, $deltaMin)
{
if ($this->getShow()->isRepeating()) {
- return "Can't drag and drop repeating shows";
+ return _("Can't drag and drop repeating shows");
}
$today_timestamp = time();
@@ -250,7 +250,7 @@ SQL;
$endsDateTime = new DateTime($this->getShowInstanceEnd(), new DateTimeZone("UTC"));
if ($today_timestamp > $startsDateTime->getTimestamp()) {
- return "Can't move a past show";
+ return _("Can't move a past show");
}
//the user is moving the show on the calendar from the perspective of local time.
@@ -267,13 +267,13 @@ SQL;
$newEndsDateTime->setTimezone(new DateTimeZone("UTC"));
if ($today_timestamp > $newStartsDateTime->getTimestamp()) {
- return "Can't move show into past";
+ return _("Can't move show into past");
}
//check if show is overlapping
$overlapping = Application_Model_Schedule::checkOverlappingShows($newStartsDateTime, $newEndsDateTime, true, $this->getShowInstanceId());
if ($overlapping) {
- return "Cannot schedule overlapping shows";
+ return _("Cannot schedule overlapping shows");
}
if ($this->isRecorded()) {
@@ -287,7 +287,7 @@ SQL;
->find();
if (count($rebroadcasts) > 0) {
- return "Can't move a recorded show less than 1 hour before its rebroadcasts.";
+ return _("Can't move a recorded show less than 1 hour before its rebroadcasts.");
}
}
@@ -300,14 +300,14 @@ SQL;
catch (Exception $e) {
$this->_showInstance->delete();
- return "Show was deleted because recorded show does not exist!";
+ return _("Show was deleted because recorded show does not exist!");
}
$recordEndDateTime = new DateTime($recordedShow->getShowInstanceEnd(), new DateTimeZone("UTC"));
$newRecordEndDateTime = self::addDeltas($recordEndDateTime, 0, 60);
if ($newStartsDateTime->getTimestamp() < $newRecordEndDateTime->getTimestamp()) {
- return "Must wait 1 hour to rebroadcast.";
+ return _("Must wait 1 hour to rebroadcast.");
}
}
@@ -339,7 +339,7 @@ SQL;
$ends = $this->getShowInstanceEnd();
if (strtotime($today_timestamp) > strtotime($starts)) {
- return "can't resize a past show";
+ return _("can't resize a past show");
}
//$sql = "SELECT timestamp '{$ends}' + interval '{$deltaDay} days' + interval '{$hours}:{$mins}'";
@@ -361,7 +361,7 @@ SQL;
if (count($overlap) > 0) {
// TODO : fix ghetto error handling -- RG
- return "Should not overlap shows";
+ return _("Should not overlap shows");
}
}
//with overbooking no longer need to check already scheduled content still fits.
diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php
index 8be6cd639..508e7eb3b 100644
--- a/airtime_mvc/application/models/StoredFile.php
+++ b/airtime_mvc/application/models/StoredFile.php
@@ -794,14 +794,14 @@ SQL;
// ugly
if ($type == "au") {
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "pl") {
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "st") {
$row['audioFile'] = $row['id'];
- $row['image'] = '';
+ $row['image'] = '';
} elseif ($type == "bl") {
- $row['image'] = '';
+ $row['image'] = '';
}
}
@@ -853,7 +853,7 @@ SQL;
closedir($dir);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": _("Failed to open temp directory.")}, "id" : "id"}');
// Look for the content type header
if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
@@ -880,14 +880,14 @@ SQL;
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
fclose($out);
unlink($_FILES['file']['tmp_name']);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": _("Failed to move uploaded file.")}, "id" : "id"}');
} else {
// Open temp file
$out = fopen($tempFilePath, $chunk == 0 ? "wb" : "ab");
@@ -899,11 +899,11 @@ SQL;
while ($buff = fread($in, 4096))
fwrite($out, $buff);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": _("Failed to open input stream.")}, "id" : "id"}');
fclose($out);
} else
- die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
+ die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": _("Failed to open output stream.")}, "id" : "id"}');
}
return $tempFilePath;
@@ -934,7 +934,7 @@ SQL;
if (!mkdir($stor."/organize", 0777)) {
return array(
"code" => 109,
- "message" => "Failed to create 'organize' directory.");
+ "message" => _("Failed to create 'organize' directory."));
}
}
@@ -947,17 +947,17 @@ SQL;
$freeSpace = disk_free_space($stor);
return array("code" => 107,
- "message" => "The file was not uploaded, there is
- ".$freeSpace."MB of disk space left and the file you are
- uploading has a size of ".$fileSize."MB.");
+ "message" => sprintf(_("The file was not uploaded, there is "
+ ."%s MB of disk space left and the file you are "
+ ."uploading has a size of %s MB."), $freeSpace, $fileSize));
}
// Check if liquidsoap can play this file
if (!self::liquidsoapFilePlayabilityTest($audio_file)) {
return array(
"code" => 110,
- "message" => "This file appears to be corrupted and will not
- be added to media library.");
+ "message" => _("This file appears to be corrupted and will not "
+ ."be added to media library."));
}
// Did all the checks for real, now trying to copy
@@ -992,10 +992,9 @@ SQL;
return array(
"code" => 108,
- "message" => "
- The file was not uploaded, this error can occur if the computer
- hard drive does not have enough disk space or the stor
- directory does not have correct write permissions.");
+ "message" => _("The file was not uploaded, this error can occur if the computer "
+ ."hard drive does not have enough disk space or the stor "
+ ."directory does not have correct write permissions."));
}
// Now that we successfully added this file, we will add another tag
// file that will identify the user that owns it
diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php
index ef3f32605..9297cb1d9 100644
--- a/airtime_mvc/application/models/Webstream.php
+++ b/airtime_mvc/application/models/Webstream.php
@@ -154,12 +154,12 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
if ($totalMinutes == 0) {
$valid['length'][0] = false;
- $valid['length'][1] = 'Length needs to be greater than 0 minutes';
+ $valid['length'][1] = _('Length needs to be greater than 0 minutes');
}
} else {
$valid['length'][0] = false;
- $valid['length'][1] = 'Length should be of form "00h 00m"';
+ $valid['length'][1] = _('Length should be of form "00h 00m"');
}
$url = $parameters["url"];
@@ -172,16 +172,16 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$mediaUrl = null;
if ($result == 0) {
$valid['url'][0] = false;
- $valid['url'][1] = 'URL should be of form "http://domain"';
+ $valid['url'][1] = _('URL should be of form "http://domain"');
} elseif (strlen($url) > 512) {
$valid['url'][0] = false;
- $valid['url'][1] = 'URL should be 512 characters or less';
+ $valid['url'][1] = _('URL should be 512 characters or less');
} else {
try {
list($mime, $content_length_found) = self::discoverStreamMime($url);
if (is_null($mime)) {
- throw new Exception("No MIME type found for webstream.");
+ throw new Exception(_("No MIME type found for webstream."));
}
$mediaUrl = self::getMediaUrl($url, $mime, $content_length_found);
@@ -197,7 +197,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$name = $parameters["name"];
if (strlen($name) == 0) {
$valid['name'][0] = false;
- $valid['name'][1] = 'Webstream name cannot be empty';
+ $valid['name'][1] = _('Webstream name cannot be empty');
}
$id = $parameters["id"];
@@ -266,7 +266,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
}
}
- throw new Exception("Could not parse XSPF playlist");
+ throw new Exception(_("Could not parse XSPF playlist"));
}
private static function getPlsUrl($url)
@@ -278,7 +278,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return $ini["playlist"]["File1"];
}
- throw new Exception("Could not parse PLS playlist");
+ throw new Exception(_("Could not parse PLS playlist"));
}
private static function getM3uUrl($url)
@@ -297,7 +297,7 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
return $lines[0];
}
- throw new Exception("Could not parse M3U playlist");
+ throw new Exception(_("Could not parse M3U playlist"));
}
private static function getMediaUrl($url, $mime, $content_length_found)
@@ -311,11 +311,11 @@ class Application_Model_Webstream implements Application_Model_LibraryEditable
$media_url = self::getPlsUrl($url);
} elseif (preg_match("/(mpeg|ogg)/", $mime)) {
if ($content_length_found) {
- throw new Exception("Invalid webstream - This appears to be a file download.");
+ throw new Exception(_("Invalid webstream - This appears to be a file download."));
}
$media_url = $url;
} else {
- throw new Exception("Unrecognized stream type: $mime");
+ throw new Exception(sprintf(_("Unrecognized stream type: %s"), $mime));
}
return $media_url;
From 43a797058c216f84f717cecae9d6b29623b81c96 Mon Sep 17 00:00:00 2001
From: denise
Date: Thu, 15 Nov 2012 17:28:18 -0500
Subject: [PATCH 21/62] -extra quote typo
---
airtime_mvc/application/views/scripts/form/showbuilder.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/airtime_mvc/application/views/scripts/form/showbuilder.phtml b/airtime_mvc/application/views/scripts/form/showbuilder.phtml
index c4c344e10..af6791714 100644
--- a/airtime_mvc/application/views/scripts/form/showbuilder.phtml
+++ b/airtime_mvc/application/views/scripts/form/showbuilder.phtml
@@ -9,7 +9,7 @@
From 57fdab0ddf935d3482555b3b3c94272d4a8d7f2c Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 11:16:10 -0500
Subject: [PATCH 23/62] CC-1960: Internationalize Airtime / Support
translations
-added i18n jquery library
-created a Locale controller that returns a js dictionary of translations needed in js
-added jquery i18n wrapper function to all strings in js
---
airtime_mvc/application/Bootstrap.php | 3 +
airtime_mvc/application/configs/ACL.php | 4 +-
.../controllers/LocaleController.php | 262 ++++++++++++++++++
.../public/js/airtime/common/common.js | 2 +-
.../public/js/airtime/dashboard/dashboard.js | 14 +-
.../js/airtime/dashboard/versiontooltip.js | 8 +-
.../library/events/library_playlistbuilder.js | 14 +-
.../library/events/library_showbuilder.js | 4 +-
.../public/js/airtime/library/library.js | 99 +++----
.../public/js/airtime/library/plupload.js | 4 +-
airtime_mvc/public/js/airtime/library/spl.js | 24 +-
.../js/airtime/listenerstat/listenerstat.js | 4 +-
.../public/js/airtime/nowplaying/register.js | 8 +-
.../js/airtime/playlist/smart_blockbuilder.js | 43 ++-
.../js/airtime/playouthistory/historytable.js | 12 +-
.../js/airtime/preferences/musicdirs.js | 14 +-
.../js/airtime/preferences/streamsetting.js | 28 +-
.../js/airtime/preferences/support-setting.js | 2 +-
.../public/js/airtime/schedule/add-show.js | 10 +-
.../schedule/full-calendar-functions.js | 36 +--
.../public/js/airtime/schedule/schedule.js | 16 +-
.../public/js/airtime/showbuilder/builder.js | 56 ++--
.../js/airtime/showbuilder/main_builder.js | 2 +-
.../public/js/airtime/status/status.js | 4 +-
airtime_mvc/public/js/airtime/user/user.js | 8 +-
25 files changed, 472 insertions(+), 209 deletions(-)
create mode 100644 airtime_mvc/application/controllers/LocaleController.php
diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index f670353fa..06226cb8f 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -102,6 +102,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/js/i18n/jquery.i18n.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/locale/translation-table?'.$CC_CONFIG['airtime_version'].rand(5, 10),'text/javascript');
+ $view->headScript()->appendScript("$.i18n.setDictionary(lang_dict)");
$view->headScript()->appendScript("var baseUrl='$baseUrl'");
//scripts for now playing bar
diff --git a/airtime_mvc/application/configs/ACL.php b/airtime_mvc/application/configs/ACL.php
index 6687011a4..46ec0c6a3 100644
--- a/airtime_mvc/application/configs/ACL.php
+++ b/airtime_mvc/application/configs/ACL.php
@@ -26,7 +26,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('listenerstat'))
->add(new Zend_Acl_Resource('usersettings'))
->add(new Zend_Acl_Resource('audiopreview'))
- ->add(new Zend_Acl_Resource('webstream'));
+ ->add(new Zend_Acl_Resource('webstream'))
+ ->add(new Zend_Acl_Resource('locale'));
/** Creating permissions */
$ccAcl->allow('G', 'index')
@@ -38,6 +39,7 @@ $ccAcl->allow('G', 'index')
->allow('G', 'dashboard')
->allow('G', 'audiopreview')
->allow('G', 'webstream')
+ ->allow('G', 'locale')
->allow('H', 'preference', 'is-import-in-progress')
->allow('H', 'usersettings')
->allow('H', 'plupload')
diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
new file mode 100644
index 000000000..7f5ecc805
--- /dev/null
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -0,0 +1,262 @@
+_helper->getHelper('AjaxContext');
+ $ajaxContext->addActionContext('language-table', 'json')
+ ->initContext();
+ }
+
+ public function translationTableAction()
+ {
+ $translations = array (
+ //common/common.js
+ "Audio Player" => _("Audio Player"),
+ //dashboard/dashboard.js
+ "Recording:" => _("Recording:"),
+ "Master Stream" => _("Master Stream"),
+ "Live Stream" => _("Live Stream"),
+ "Nothing Scheduled" => _("Nothing Scheduled"),
+ "Current Show:" => _("Current Show:"),
+ //dashboard/versiontooltip.js
+ "You are running the latest version" => _("You are running the latest version"),
+ "New version available: " => _("New version available: "),
+ "This version will soon be obsolete." => _("This version will soon be obsolete."),
+ "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"),
+ "Adding 1 Item." => _("Adding 1 Item."),
+ /*****embedded variable*****/
+ "Adding " => _("Adding "),
+ " Items." => _(" Items."),
+ "You can only add tracks to smart blocks." => _("You can only add tracks to smart blocks."),
+ "You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."),
+ //library/events/library_showbuilder.js
+ "Adding 1 Item." => _("Adding 1 Item."),
+ /****string with variable*****/
+ "Adding " => _("Adding "),
+ " Items." => _(" Items."),
+ //library/library.js
+ "Select" => _("Select"),
+ "Select this page" => _("Select this page"),
+ "Deselect this page" => _("Deselect this page"),
+ "Deselect all" => _("Deselect all"),
+ "Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
+ "Title" => _("Title"),
+ "Creator" => _("Creator"),
+ "Album" => _("Album"),
+ "Bit Rate" => _("Bit Rate"),
+ "BPM" => _("BPM"),
+ "Composer" => _("Composer"),
+ "Conductor" => _("Conductor"),
+ "Copyright" => _("Copyright"),
+ "Encoded By" => _("Encoded By"),
+ "Genre" => _("Genre"),
+ "ISRC" => _("ISRC"),
+ "Label" => _("Label"),
+ "Language" => _("Language"),
+ "Last Modified" => _("Last Modified"),
+ "Last Played" => _("Last Played"),
+ "Length" => _("Length"),
+ "Mime" => _("Mime"),
+ "Mood" => _("Mood"),
+ "Owner" => _("Owner"),
+ "Replay Gain" => _("Replay Gain"),
+ "Sample Rate" => _("Sample Rate"),
+ "Track Number" => _("Track Number"),
+ "Uploaded" => _("Uploaded"),
+ "Website" => _("Webiste"),
+ "Year" => _("Year"),
+ "Loading..." => _("Loading..."),
+ "All" => _("All"),
+ "Files" => _("Files"),
+ "Playlists" => _("Playlists"),
+ "Smart Blocks" => _("Smart Blocks"),
+ "Web Streams" => _("Web Streams"),
+ "Unknown type: " => _("Unknown type: "),
+ "Are you sure you want to delete the selected item?" => _("Are you sure you want to delete the selected item?"),
+ "Uploading in progress..." => _("Uploading in progress..."),
+ "Retrieving data from the server..." => _("Retrieving data from the server..."),
+ "The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
+ "There was an error while uploading to soundcloud." => _("There was an error while uploading to soundcloud."),
+ "Error code: " => _("Error code: "),
+ "Error msg: " => _("Error msg: "),
+ "Input must be a positive number" => _("Input must be a positive number"),
+ "Input must be a number" => _("Input must be a number"),
+ "Input must be in the format: yyyy-mm-dd" => _("Input must be in the format: yyyy-mm-dd"),
+ "Input must be in the format: hh:mm:ss.t" => _("Input must be in the format: hh:mm:ss.t"),
+ //library/plupload.js
+ "You are currently uploading files." => _("You are currently uploading files."),
+ "Going to another screen will cancel the upload process." => _("Going to another screen will cancel the upload process."),
+ "Are you sure you want to leave the page?" => _("Are you sure you want to leave the page?"),
+ //library/spl.js
+ "please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
+ "please put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
+ "Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
+ "Dynamic block is not previewable" => _("Dynamic block is not previewable"),
+ "Limit to: " => _("Limit to: "),
+ "-error" => _("-error"),
+ "Playlist saved" => _("Playlist saved"),
+ "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
+ => _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
+ //listenerstat/listenerstat.js
+ "Listener Count on" => _("Listener Count on"),
+ "You clicked point " => _("You clicked point "),
+ "in" => _("in"),
+ //nowplaying/register.js
+ "Remind me in 1 week" => _("Remind me in 1 week"),
+ "Remind me never" => _("Remind me never"),
+ "Yes, help Airtime" => _("Yes, help Airtime"),
+ "Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
+ //playlist/smart_blockbuilder.js
+ "A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."
+ => _("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show."),
+ "A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."
+ => _("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library."),
+ "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once."
+ => _("If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once."),
+ "Smart block shuffled" => _("Smart block shuffled"),
+ "Smart block generated and criteria saved" => _("Smart block generated and criteria saved"),
+ "Smart block saved" => _("Smart block saved"),
+ "Processing..." => _("Processing..."),
+ "Select modifier" => _("Select modifier"),
+ "contains" => _("contains"),
+ "does not contain" => _("does not contain"),
+ "is" => _("is"),
+ "is not" => _("is not"),
+ "starts with" => _("starts with"),
+ "ends with" => _("ends with"),
+ "is greater than" => _("is greater than"),
+ "is less than" => _("is less than"),
+ "is in the range" => _("is in the range"),
+ //playouthistory/historytable.js
+ "Title" => _("Title"),
+ "Creator" => _("Creator"),
+ "Played" => _("Played"),
+ "Length" => _("Length"),
+ "Composer" => _("Composer"),
+ "Copyright" => _("Copyright"),
+ //preferences/musicdirs.js
+ "Choose Storage Folder" => _("Choose Storage Folder"),
+ "Choose Folder to Watch" => _("Choose Folder to Watch"),
+ "Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"
+ => _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
+ "Manage Media Folders" => _("Manage Media Folders"),
+ "Are you sure you want to remove the watched folder?" => _("Are you sure you want to remove the watched folder?"),
+ "This path is currently not accessible." => _("This path is currently not accessible."),
+ //preferences/streamsetting.js
+ "Connected to the streaming server" => _("Connected to the streaming server"),
+ "The stream is disabled" => _("The stream is disabled"),
+ "Getting information from the server..." => _("Getting information from the server..."),
+ "Can not connect to the streaming server" => _("Can not connect to the streaming server"),
+ "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."
+ => _("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
+ /*****embedded variable*****/
+ "For more details, please read the " => _("For more details, please read the "),
+ "Airtime manual" => _("Airtime manual"),
+ "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
+ => _("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."),
+ "Check this box to automatically switch off Master/Show source upon source disconnection." => _("Check this box to automatically switch off Master/Show source upon source disconnection."),
+ "Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
+ "If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
+ "If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
+ "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
+ => _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
+ //preferences/support-setting.js
+ "Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
+ //schedule/add-show.js
+ "No result found" => _("No result found"),
+ "This follows the same security pattern for the shows: only users assigned to the show can connect." => _("This follows the same security pattern for the shows: only users assigned to the show can connect."),
+ "Specify custom authentication which will work only for this show." => _("Specify custom authentication which will work only for this show."),
+ "If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
+ "The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ //schedule/full-calendar-functions
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ "Show" => _("Show"),
+ "Show is empty" => _("Show is empty"),
+ "1m" => _("1m"),
+ "5m" => _("5m"),
+ "10m" => _("10m"),
+ "15m" => _("15m"),
+ "30m" => _("30m"),
+ "60m" => _("60m"),
+ "Uploading in progress..." => _("Uploading in progress..."),
+ "Retreiving data from the server..." => _("Retreiving data from the server..."),
+ //already in library/library.js
+ //"The soundcloud id for this file is: " => _("The soundcloud id for this file is: "),
+ //"There was error while uploading to soundcloud." => _("There was error while uploading to soundcloud."),
+ //"Error code: " => _("Error code: "),
+ //"Error msg: " => _("Error msg: "),
+ "This show has no scheduled content." => _("This show has no scheduled content."),
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ //schedule/schedule.js
+ "Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."),
+ "Cancel Current Show?" => _("Cancel Current Show?"),
+ "Stop recording current show?" => _("Stop recording current show?"),
+ "Ok" => _("Ok"),
+ "Contents of Show" => _("Contents of Show"),
+ //already in schedule/add-show.js
+ //"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
+ "Remove all content?" => _("Remove all content?"),
+ //showbuilder/builder.js
+ "Delete selected item(s)?" => _("Delete selected item(s)?"),
+ "Start" => _("Start"),
+ "End" => _("End"),
+ "Duration" => _("Duration"),
+ //already in library/library.js
+ //"Title" => _("Title"),
+ //"Creator" => _("Creator"),
+ //"Album" => _("Album"),
+ //"Mime" => _("Mime"),
+ "Cue In" => _("Cue In"),
+ "Cue Out" => _("Cue Out"),
+ "Fade In" => _("Fade In"),
+ "Fade Out" => _("Fade Out"),
+ "Show Empty" => _("Show Empty"),
+ "Recording From Line In" => _("Recording From Line In"),
+ "Track preview" => _("Track preview"),
+ //already in library/spl/js
+ //"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
+ //=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
+ "Cannot schedule outside a show." => _("Cannot schedule outside a show."),
+ /*****embedded variable*****/
+ "Moving " => _("Moving "),
+ " Item." => _(" Item."),
+ " Items." => _(" Items."),
+ //already in library/library.js
+ "Select" => _("Select"),
+ "Select all" => _("Select all"),
+ "Select none" => _("Select none"),
+ "Remove overbooked tracks" => _("Remove overbooked tracks"),
+ "Remove selected scheduled items" => _("Remove selected scheduled items"),
+ "Jump to the current playing track" => _("Jump to the current playing track"),
+ "Cancel current show" => _("Cancel current show"),
+ //already in schedule/schedule.js
+ //"Cancel Current Show?" => _("Cancel Current Show?"),
+ "Stop recording current show?" => _("Stop recording current show?"),
+ //showbuilder/main_builder.js
+ "Open library to add or remove content" => _("Open library to add or remove content"),
+ "Add / Remove Content" => _("Add / Remove Content"),
+ //status/status.js
+ "in use" => _("in use"),
+ "Disk" => _("Disk"),
+ //user/user.js
+ "Admin" => _("Admin"),
+ "DJ" => _("DJ"),
+ "Program Manager" => _("Program Manager"),
+ "Guest" => _("Guest"),
+
+ );
+ $this->view->layout()->disableLayout();
+ $this->_helper->viewRenderer->setNoRender(true);
+ header("Content-type: text/javascript");
+ echo "var lang_dict=".json_encode($translations);
+
+ }
+}
\ No newline at end of file
diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js
index 984b9419e..a990f82a5 100644
--- a/airtime_mvc/public/js/airtime/common/common.js
+++ b/airtime_mvc/public/js/airtime/common/common.js
@@ -104,7 +104,7 @@ function open_show_preview(p_showID, p_showIndex) {
}
function openPreviewWindow(url) {
- _preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
+ _preview_window = window.open(url, $.i18n._('Audio Player'), 'width=450,height=100,scrollbars=yes');
return false;
}
diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js
index df107ef15..1f72a76b2 100644
--- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js
+++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js
@@ -143,24 +143,24 @@ function updatePlaybar(){
}
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
if (currentSong.record == "1")
- $('#current').html("Recording: "+currentSong.name+",");
+ $('#current').html(""+$.i18n._("Recording:")+""+currentSong.name+",");
else
$('#current').text(currentSong.name+",");
}else{
if (master_dj_on_air) {
if (showName) {
- $('#current').html("Current: "+showName+" - Master Stream");
+ $('#current').html("Current: "+showName+" - "+$.i18n._("Master Stream")+"");
} else {
- $('#current').html("Current: Master Stream");
+ $('#current').html("Current: "+$.i18n._("Master Stream")+"");
}
} else if (live_dj_on_air) {
if (showName) {
- $('#current').html("Current: "+showName+" - Live Stream");
+ $('#current').html("Current: "+showName+" - "+$.i18n._("Live Stream")+"");
} else {
- $('#current').html("Current: Live Stream");
+ $('#current').html("Current: "+$.i18n._("Live Stream")+"");
}
} else {
- $('#current').html("Current: Nothing Scheduled");
+ $('#current').html("Current: "+$.i18n._("Nothing Scheduled")+"");
}
}
@@ -191,7 +191,7 @@ function updatePlaybar(){
$('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs));
}
/* Column 1 update */
- $('#playlist').text("Current Show:");
+ $('#playlist').text($.i18n._("Current Show:"));
var recElem = $('.recording-show');
if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name);
diff --git a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
index 10afb2864..4b6675591 100644
--- a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
+++ b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js
@@ -8,13 +8,13 @@ function getContent() {
var msg = "";
// See file airtime_mvc/application/views/helpers/VersionNotify.php for more info
if(isUpToDate()) {
- msg = "You are running the latest version";
+ msg = $.i18n._("You are running the latest version");
} else if (diff < 20) {
- msg = "New version available: " + link;
+ msg = $.i18n._("New version available: ") + link;
} else if (diff < 30) {
- msg = "This version will soon be obsolete. Please upgrade to " + link;
+ msg = $.i18n._("This version will soon be obsolete.")+" "+$.i18n._("Please upgrade to ") + link;
} else {
- msg = "This version is no longer supported. Please upgrade to " + link;
+ msg = $.i18n._("This version is no longer supported.")+" "+$.i18n._("Please upgrade to ") + link;
}
return msg;
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 457b219b7..ced6d852e 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 = ' Add to current playlist';
+ btnText = $.i18n._(' Add to current playlist');
} else if (objType === 'block') {
- btnText = ' Add to current smart block';
+ btnText = $.i18n._(' Add to current smart block');
} else {
- btnText = ' Add to current playlist';
+ btnText = $.i18n._(' Add to current playlist');
}
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
};
@@ -86,9 +86,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = "Adding 1 Item.";
+ message = $.i18n._("Adding 1 Item.");
} else {
- message = "Adding " + selected + " Items.";
+ message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
}
container = $('').append(
@@ -158,9 +158,9 @@ var AIRTIME = (function(AIRTIME) {
undefined, 'after');
} else {
if ($('#obj_type').val() == 'block') {
- alert('You can only add tracks to smart blocks.');
+ alert($.i18n._('You can only add tracks to smart blocks.'));
} else if ($('#obj_type').val() == 'playlist') {
- alert('You can only add tracks, smart blocks, and webstreams to playlists.');
+ alert($.i18n._('You can only add tracks, smart blocks, and webstreams to playlists.'));
}
}
});
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 ba03586d0..a0d5b4598 100644
--- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
+++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
@@ -66,9 +66,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = "Adding 1 Item.";
+ message = $.i18n._("Adding 1 Item.");
} else {
- message = "Adding " + selected + " Items.";
+ message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
}
container = $('').attr('id',
diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js
index 3b7c956be..72980ab15 100644
--- a/airtime_mvc/public/js/airtime/library/library.js
+++ b/airtime_mvc/public/js/airtime/library/library.js
@@ -109,12 +109,12 @@ var AIRTIME = (function(AIRTIME) {
$menu
.append("
" +
@@ -322,7 +322,7 @@ var AIRTIME = (function(AIRTIME) {
};
mod.fnDeleteSelectedItems = function() {
- if (confirm('Are you sure you want to delete the selected item(s)?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item(s)?'))) {
var aData = AIRTIME.library.getSelectedData(),
item,
temp,
@@ -439,31 +439,31 @@ var AIRTIME = (function(AIRTIME) {
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
- /* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
- /* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
- /* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
- /* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
- /* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
- /* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
- /* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
- /* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
- /* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
- /* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
- /* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
- /* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
- /* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
- /* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
- /* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
- /* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
- /* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
- /* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
- /* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
- /* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
- /* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
- /* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
- /* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
- /* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
- /* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
+ /* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
+ /* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
+ /* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
+ /* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
+ /* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
+ /* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
+ /* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
+ /* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
+ /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
+ /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
+ /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
+ /* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
+ /* Language */ { "sTitle" : $.i18n._("Language") , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
+ /* Last Modified */ { "sTitle" : $.i18n._("Last Modified") , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
+ /* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
+ /* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
+ /* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
+ /* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
+ /* Owner */ { "sTitle" : $.i18n._("Owner") , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
+ /* Replay Gain */ { "sTitle" : $.i18n._("Replay Gain") , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
+ /* Sample Rate */ { "sTitle" : $.i18n._("Sample Rate") , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
+ /* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
+ /* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
+ /* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
+ /* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
],
"bProcessing": true,
@@ -611,7 +611,7 @@ var AIRTIME = (function(AIRTIME) {
// icon.
$(nRow).find("td:not(.library_checkbox, .library_type)").qtip({
content: {
- text: "Loading...",
+ text: $.i18n._("Loading..."),
title: {
text: aData.track_title
},
@@ -725,11 +725,11 @@ var AIRTIME = (function(AIRTIME) {
.addClass("dataTables_type")
.append('')
.find("select")
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
.end()
.change(function(ev){
oTable.fnDraw();
@@ -812,7 +812,7 @@ var AIRTIME = (function(AIRTIME) {
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
}
} else {
- throw new Exception("Unknown type: " + data.ftype);
+ throw new Exception($.i18n._("Unknown type: ") + data.ftype);
}
oItems.edit.callback = callback;
}
@@ -854,7 +854,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() {
aMedia = [];
aMedia.push({"id": data.id, "type": data.ftype});
- if (confirm('Are you sure you want to delete the selected item?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
AIRTIME.library.fnDeleteItems(aMedia);
}
};
@@ -863,7 +863,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() {
var media = [];
- if (confirm('Are you sure you want to delete the selected item?')) {
+ if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
media.push({"id": data.id, "type": data.ftype});
$.post(oItems.del.url, {format: "json", media: media }, function(json){
@@ -1010,7 +1010,7 @@ function addQtipToSCIcons(){
if ($(this).hasClass("progress")){
$(this).qtip({
content: {
- text: "Uploading in progress..."
+ text: $.i18n._("Uploading in progress...")
},
position:{
adjust: {
@@ -1030,13 +1030,13 @@ function addQtipToSCIcons(){
else if($(this).hasClass("soundcloud")){
$(this).qtip({
content: {
- text: "Retrieving data from the server...",
+ text: $.i18n._("Retrieving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "The soundcloud id for this file is: "+json.sc_id);
+ this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
}
}
},
@@ -1057,14 +1057,15 @@ function addQtipToSCIcons(){
}else if($(this).hasClass("sc-error")){
$(this).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n._("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "There was error while uploading to soundcloud. "+"Error code: "+json.error_code+
- " "+"Error msg: "+json.error_msg+" ");
+ this.set('content.text', $.i18n._("There was an error while uploading to soundcloud.")+" "+
+ $.i18n._("Error code: ")+json.error_code+
+ " "+$.i18n._("Error msg: ")+json.error_msg+" ");
}
}
},
@@ -1167,13 +1168,13 @@ function validateAdvancedSearch(divs) {
function addRemoveValidationIcons(valid, field, searchTermType) {
var title = '';
if (searchTermType === 'i') {
- title = 'Input must be a positive number';
+ title = $.i18n._('Input must be a positive number');
} else if (searchTermType === 'n') {
- title = 'Input must be a number';
+ title = $.i18n._('Input must be a number');
} else if (searchTermType === 't') {
- title = 'Input must be in the format: yyyy-mm-dd';
+ title = $.i18n._('Input must be in the format: yyyy-mm-dd');
} else if (searchTermType === 'l') {
- title = 'Input must be in the format: hh:mm:ss.t';
+ title = $.i18n._('Input must be in the format: hh:mm:ss.t');
}
var validIndicator = " ",
diff --git a/airtime_mvc/public/js/airtime/library/plupload.js b/airtime_mvc/public/js/airtime/library/plupload.js
index 89b442217..de12ed800 100644
--- a/airtime_mvc/public/js/airtime/library/plupload.js
+++ b/airtime_mvc/public/js/airtime/library/plupload.js
@@ -56,7 +56,9 @@ $(document).ready(function() {
$(window).bind('beforeunload', function(){
if(uploadProgress){
- return "You are currently uploading files.\nGoing to another screen will cancel the upload process.\nAre you sure you want to leave the page?";
+ return $.i18n._("You are currently uploading files.")+"\n"+
+ $.i18n._("Going to another screen will cancel the upload process.")+"\n"+
+ $.i18n._("Are you sure you want to leave the page?");
}
});
diff --git a/airtime_mvc/public/js/airtime/library/spl.js b/airtime_mvc/public/js/airtime/library/spl.js
index b5a808986..f291b467b 100644
--- a/airtime_mvc/public/js/airtime/library/spl.js
+++ b/airtime_mvc/public/js/airtime/library/spl.js
@@ -74,7 +74,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueIn)){
- showError(span, "please put in a time '00:00:00 (.0)'");
+ showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
$.post(url,
@@ -111,7 +111,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueOut)){
- showError(span, "please put in a time '00:00:00 (.0)'");
+ showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
@@ -150,7 +150,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -188,7 +188,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -378,7 +378,7 @@ var AIRTIME = (function(AIRTIME){
} else {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
- content: 'Your browser does not support playing this file type: "'+ mime +'"',
+ content: $.i18n._("Your browser does not support playing this file type: ")+ mime,
show: 'mouseover',
hide: {
delay: 500,
@@ -402,7 +402,7 @@ var AIRTIME = (function(AIRTIME){
if ($(value).attr('blocktype') === 'dynamic') {
$(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({
- content: 'Dynamic block is not previewable',
+ content: $.i18n._('Dynamic block is not previewable'),
show: 'mouseover',
hide: {
delay: 500,
@@ -483,7 +483,7 @@ var AIRTIME = (function(AIRTIME){
"";
});
}
- $html += "
Limit to: "+data.limit.value+" "+data.limit.modifier+"
";
+ $html += "
"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"
";
}
$pl.find("#block_"+id+"_info").html($html).show();
mod.enableUI();
@@ -575,7 +575,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -599,7 +599,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){
- showError(span, "please put in a time in seconds '00 (.0)'");
+ showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
return;
}
@@ -682,7 +682,7 @@ var AIRTIME = (function(AIRTIME){
var field = json.analysis[s];
if (!field[0]) {
- var elemId = "#"+s+"-error";
+ var elemId = "#"+s+$.i18n._("-error");
var $div = $("#side_playlist " + elemId).text(field[1]).show();
}
}
@@ -738,7 +738,7 @@ var AIRTIME = (function(AIRTIME){
if (obj_type == "block") {
callback(data, "save");
} else {
- $('.success').text('Playlist saved');
+ $('.success').text($.i18n._('Playlist saved'));
$('.success').show();
setTimeout(removeSuccessMsg, 5000);
dt.fnStandingRedraw();
@@ -1075,7 +1075,7 @@ var AIRTIME = (function(AIRTIME){
$pl.find(".ui-icon-alert").qtip({
content: {
- text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
+ text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore.")
},
position:{
adjust: {
diff --git a/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js b/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
index a410acf62..b33e4e51a 100644
--- a/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
+++ b/airtime_mvc/public/js/airtime/listenerstat/listenerstat.js
@@ -134,7 +134,7 @@ function plot(datasets){
var y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY,
- "Listener Count on '"+item.series.label + "': " + Math.floor(y));
+ $.i18n._("Listener Count on")+" '"+item.series.label + "': " + Math.floor(y));
}
}
else {
@@ -145,7 +145,7 @@ function plot(datasets){
$("#placeholder").bind("plotclick", function (event, pos, item) {
if (item) {
- $("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + ".");
+ $("#clickdata").text($.i18n._("You clicked point ") + item.dataIndex + " "+$.i18n._("in")+" " + item.series.label + ".");
plot.highlight(item.series, item.datapoint);
}
});
diff --git a/airtime_mvc/public/js/airtime/nowplaying/register.js b/airtime_mvc/public/js/airtime/nowplaying/register.js
index c91a285b8..018252bbf 100644
--- a/airtime_mvc/public/js/airtime/nowplaying/register.js
+++ b/airtime_mvc/public/js/airtime/nowplaying/register.js
@@ -16,7 +16,7 @@ $(document).ready(function(){
buttons: [
{
id: "remind_me",
- text: "Remind me in 1 week",
+ text: $.i18n._("Remind me in 1 week"),
"class": "btn",
click: function() {
var url = baseUrl+'/Usersettings/remindme';
@@ -29,7 +29,7 @@ $(document).ready(function(){
},
{
id: "remind_never",
- text: "Remind me never",
+ text: $.i18n._("Remind me never"),
"class": "btn",
click: function() {
var url =baseUrl+'/Usersettings/remindme-never';
@@ -42,7 +42,7 @@ $(document).ready(function(){
},
{
id: "help_airtime",
- text: "Yes, help Airtime",
+ text: $.i18n._("Yes, help Airtime"),
"class": "btn",
click: function() {
$("#register-form").submit();
@@ -129,7 +129,7 @@ $(document).ready(function(){
var ul, li;
ul = logoEl.find('.errors');
- li = $("").append("Image must be one of jpg, jpeg, png, or gif");
+ li = $("").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created.
if (ul.length > 0) {
diff --git a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
index c472448aa..978141a7d 100644
--- a/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
+++ b/airtime_mvc/public/js/airtime/playlist/smart_blockbuilder.js
@@ -378,10 +378,8 @@ function setupUI() {
$(".playlist_type_help_icon").qtip({
content: {
- text: "A static smart block will save the criteria and generate the block content immediately. " +
- "This allows you to edit and view it in the Library before adding it to a show.
" +
- "A dynamic smart block will only save the criteria. The block content will get generated upon " +
- "adding it to a show. You will not be able to view and edit the content in the Library."
+ text: $.i18n._("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.")+"
" +
+ $.i18n._("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.")
},
hide: {
delay: 500,
@@ -402,8 +400,7 @@ function setupUI() {
$(".repeat_tracks_help_icon").qtip({
content: {
- text: "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length." +
- " Hence, if you check this option, tracks will be used more than once."
+ text: $.i18n._("If your criteria is too strict, Airtime may not be able to fill up the desired smart block length. Hence, if you check this option, tracks will be used more than once.")
},
hide: {
delay: 500,
@@ -495,9 +492,9 @@ function callback(data, type) {
var form = $('#smart-block-form');
if (json.result == "0") {
if (type == 'shuffle') {
- form.find('.success').text('Smart block shuffled');
+ form.find('.success').text($.i18n._('Smart block shuffled'));
} else if (type == 'generate') {
- form.find('.success').text('Smart block generated and criteria saved');
+ form.find('.success').text($.i18n._('Smart block generated and criteria saved'));
//redraw library table so the length gets updated
dt.fnStandingRedraw();
}
@@ -508,7 +505,7 @@ function callback(data, type) {
AIRTIME.playlist.fnOpenPlaylist(json);
var form = $('#smart-block-form');
if (json.result == "0") {
- $('#sp-success-saved').text('Smart block saved');
+ $('#sp-success-saved').text($.i18n._('Smart block saved'));
$('#sp-success-saved').show();
//redraw library table so the length gets updated
@@ -553,7 +550,7 @@ function removeButtonCheck() {
function enableLoadingIcon() {
$("#side_playlist").block({
- message: "Processing...",
+ message: $.i18n._("Processing..."),
theme: true,
allowBodyStretch: true,
applyPlatformOpacityRules: false
@@ -594,20 +591,20 @@ var criteriaTypes = {
};
var stringCriteriaOptions = {
- "0" : "Select modifier",
- "contains" : "contains",
- "does not contain" : "does not contain",
- "is" : "is",
- "is not" : "is not",
- "starts with" : "starts with",
- "ends with" : "ends with"
+ "0" : $.i18n._("Select modifier"),
+ "contains" : $.i18n._("contains"),
+ "does not contain" : $.i18n._("does not contain"),
+ "is" : $.i18n._("is"),
+ "is not" : $.i18n._("is not"),
+ "starts with" : $.i18n._("starts with"),
+ "ends with" : $.i18n._("ends with")
};
var numericCriteriaOptions = {
- "0" : "Select modifier",
- "is" : "is",
- "is not" : "is not",
- "is greater than" : "is greater than",
- "is less than" : "is less than",
- "is in the range" : "is in the range"
+ "0" : $.i18n._("Select modifier"),
+ "is" : $.i18n._("is"),
+ "is not" : $.i18n._("is not"),
+ "is greater than" : $.i18n._("is greater than"),
+ "is less than" : $.i18n._("is less than"),
+ "is in the range" : $.i18n._("is in the range")
};
diff --git a/airtime_mvc/public/js/airtime/playouthistory/historytable.js b/airtime_mvc/public/js/airtime/playouthistory/historytable.js
index 321b32581..26d2ccebe 100644
--- a/airtime_mvc/public/js/airtime/playouthistory/historytable.js
+++ b/airtime_mvc/public/js/airtime/playouthistory/historytable.js
@@ -65,12 +65,12 @@ var AIRTIME = (function(AIRTIME) {
oTable = historyTableDiv.dataTable( {
"aoColumns": [
- {"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */
- {"sTitle": "Creator", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
- {"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */
- {"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
- {"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
- {"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
+ {"sTitle": $.i18n._("Title"), "mDataProp": "title", "sClass": "his_title"}, /* Title */
+ {"sTitle": $.i18n._("Creator"), "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
+ {"sTitle": $.i18n._("Played"), "mDataProp": "played", "sClass": "his_artist"}, /* times played */
+ {"sTitle": $.i18n._("Length"), "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
+ {"sTitle": $.i18n._("Composer"), "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
+ {"sTitle": $.i18n._("Copyright"), "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
],
"bProcessing": true,
diff --git a/airtime_mvc/public/js/airtime/preferences/musicdirs.js b/airtime_mvc/public/js/airtime/preferences/musicdirs.js
index 55e335cd6..072359492 100644
--- a/airtime_mvc/public/js/airtime/preferences/musicdirs.js
+++ b/airtime_mvc/public/js/airtime/preferences/musicdirs.js
@@ -15,7 +15,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
- title: 'Choose Storage Folder',
+ title: $.i18n._('Choose Storage Folder'),
basePath: '',
requestMethod: 'POST',
});
@@ -35,7 +35,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
- title: 'Choose Folder to Watch',
+ title: $.i18n._('Choose Folder to Watch'),
basePath: '',
requestMethod: 'POST',
});
@@ -43,7 +43,7 @@ function setWatchedDirEvents() {
$('#storageFolder-ok').click(function(){
var url, chosen;
- if(confirm("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!")){
+ if(confirm($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"))){
url = baseUrl+"/Preference/change-stor-directory";
chosen = $('#storageFolder').val();
@@ -72,7 +72,7 @@ function setWatchedDirEvents() {
function(json) {
$("#watched-folder-section").empty();
- $("#watched-folder-section").append("
Manage Media Folders
");
+ $("#watched-folder-section").append("
"+$.i18n._("Manage Media Folders")+"
");
$("#watched-folder-section").append(json.subform);
setWatchedDirEvents();
});
@@ -84,7 +84,7 @@ function setWatchedDirEvents() {
});
$('.selected-item').find('.ui-icon-close').click(function(){
- if(confirm("Are you sure you want to remove the watched folder?")){
+ if(confirm($.i18n._("Are you sure you want to remove the watched folder?"))){
var row = $(this).parent();
var folder = row.find('#folderPath').text();
@@ -95,7 +95,7 @@ function setWatchedDirEvents() {
function(json) {
$("#watched-folder-section").empty();
- $("#watched-folder-section").append("
Manage Media Folders
");
+ $("#watched-folder-section").append("
"+$.i18n._("Manage Media Folders")+"
");
$("#watched-folder-section").append(json.subform);
setWatchedDirEvents();
});
@@ -108,7 +108,7 @@ $(document).ready(function() {
setWatchedDirEvents();
$(".ui-icon-alert").qtip({
content: {
- text: "This path is currently not accessible."
+ text: $.i18n._("This path is currently not accessible.")
},
position:{
adjust: {
diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
index 973c66356..1362fb456 100644
--- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js
+++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
@@ -93,13 +93,13 @@ function checkLiquidsoapStatus(){
}
var html;
if(status == "OK"){
- html = '
Connected to the streaming server
';
+ html = '
'+$.i18n._("Connected to the streaming server")+'
';
}else if(status == "N/A"){
- html = '
The stream is disabled
';
+ html = '
'+$.i18n._("The stream is disabled")+'
';
}else if(status == "waiting"){
- html = '
Getting information from the server...
';
+ html = '
'+$.i18n._("Getting information from the server...")+'
';
}else{
- html = '
Can not connect to the streaming server
'+status+'
';
+ html = '
'+$.i18n._("Can not connect to the streaming server")+'
'+status+'
';
}
$("#s"+id+"Liquidsoap-error-msg-element").html(html);
}
@@ -250,7 +250,8 @@ function setupEventListeners() {
// qtip for help text
$(".override_help_icon").qtip({
content: {
- text: "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151. For more detail, please read the Airtime manual."
+ text: $.i18n._("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151.")+" "+
+ $.i18n._("For more details, please read the ")+""+$.i18n._("Airtime manual")+"."
},
hide: {
delay: 500,
@@ -271,7 +272,7 @@ function setupEventListeners() {
$(".icecast_metadata_help_icon").qtip({
content: {
- text: "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
+ text: $.i18n._("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.")
},
hide: {
delay: 500,
@@ -292,7 +293,7 @@ function setupEventListeners() {
$("#auto_transition_help").qtip({
content: {
- text: "Check this box to automatically switch off Master/Show source upon source disconnection."
+ text: $.i18n._("Check this box to automatically switch off Master/Show source upon source disconnection.")
},
hide: {
delay: 500,
@@ -313,7 +314,7 @@ function setupEventListeners() {
$("#auto_switch_help").qtip({
content: {
- text: "Check this box to automatically switch on Master/Show source upon source connection."
+ text: $.i18n._("Check this box to automatically switch on Master/Show source upon source connection.")
},
hide: {
delay: 500,
@@ -334,7 +335,7 @@ function setupEventListeners() {
$(".stream_username_help_icon").qtip({
content: {
- text: "If your Icecast server expects a username of 'source', this field can be left blank."
+ text: $.i18n._("If your Icecast server expects a username of 'source', this field can be left blank.")
},
hide: {
delay: 500,
@@ -355,7 +356,7 @@ function setupEventListeners() {
$(".master_username_help_icon").qtip({
content: {
- text: "If your live streaming client does not ask for a username, this field should be 'source'."
+ text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
},
hide: {
delay: 500,
@@ -375,12 +376,7 @@ function setupEventListeners() {
})
$('#stream_save').live('click', function(){
- var confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the "
- + "playout engine will be rebooted and your listeners will hear silence for"
- + "5-10 seconds. Changing the following fields will NOT cause a reboot: "
- + "Stream Label (Global Settings), and Switch Transition Fade(s), Master "
- + "Username, and Master Password (Input Stream Settings). If Airtime is recording"
- + ", and if the change causes a playout engine restart, the recording will be interrupted.";
+ var confirm_pypo_restart_text = $.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting';
diff --git a/airtime_mvc/public/js/airtime/preferences/support-setting.js b/airtime_mvc/public/js/airtime/preferences/support-setting.js
index 7e4331960..0e72daf9f 100644
--- a/airtime_mvc/public/js/airtime/preferences/support-setting.js
+++ b/airtime_mvc/public/js/airtime/preferences/support-setting.js
@@ -61,7 +61,7 @@ $(document).ready(function() {
var ul, li;
ul = logoEl.find('.errors');
- li = $("").append("Image must be one of jpg, jpeg, png, or gif");
+ li = $("").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created.
if (ul.length > 0) {
diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js
index b7659504d..f3bcc07ca 100644
--- a/airtime_mvc/public/js/airtime/schedule/add-show.js
+++ b/airtime_mvc/public/js/airtime/schedule/add-show.js
@@ -53,7 +53,7 @@ function findHosts(request, callback) {
var noResult = new Array();
noResult[0] = new Array();
noResult[0]['value'] = $("#add_show_hosts_autocomplete").val();
- noResult[0]['label'] = "No result found";
+ noResult[0]['label'] = $.i18n._("No result found");
noResult[0]['index'] = null;
$.post(url,
@@ -226,7 +226,7 @@ function setAddShowEvents() {
form.find(".airtime_auth_help_icon").qtip({
content: {
- text: "This follows the same security pattern for the shows: only users assigned to the show can connect."
+ text: $.i18n._("This follows the same security pattern for the shows: only users assigned to the show can connect.")
},
hide: {
delay: 500,
@@ -246,7 +246,7 @@ function setAddShowEvents() {
});
form.find(".custom_auth_help_icon").qtip({
content: {
- text: "Specify custom authentication which will work only for this show."
+ text: $.i18n._("Specify custom authentication which will work only for this show.")
},
hide: {
delay: 500,
@@ -266,7 +266,7 @@ function setAddShowEvents() {
});
form.find(".stream_username_help_icon").qtip({
content: {
- text: "If your live streaming client does not ask for a username, this field should be 'source'."
+ text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
},
hide: {
delay: 500,
@@ -628,7 +628,7 @@ $(document).ready(function() {
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload();
}
diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
index 006954154..4bfaabf56 100644
--- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
+++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
@@ -6,7 +6,7 @@
function scheduleRefetchEvents(json) {
if(json.show_error == true){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
}
if(json.show_id) {
var dialog_id = parseInt($("#add_show_id").val(), 10);
@@ -41,7 +41,7 @@ function openAddShowForm() {
function makeAddShowButton(){
$('.fc-header-left')
.append('')
- .append('Show')
+ .append(''+$.i18n._("Show")+'')
.find('span.fc-button:last > a')
.click(function(){
openAddShowForm();
@@ -154,12 +154,12 @@ function viewDisplay( view ) {
var calendarEl = this;
var select = $('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
.change(function(){
var slotMin = $(this).val();
var opt = view.calendar.options;
@@ -261,7 +261,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) {
$(element)
.find(".fc-event-time")
- .before('');
+ .before('');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@@ -275,7 +275,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) {
$(element)
.find(".fc-event-title")
- .after('');
+ .after('');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@@ -424,7 +424,7 @@ function addQtipToSCIcons(ele){
if($(ele).hasClass("progress")){
$(ele).qtip({
content: {
- text: "Uploading in progress..."
+ text: $.i18n.("Uploading in progress...")
},
position:{
adjust: {
@@ -442,13 +442,13 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("soundcloud")){
$(ele).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n.("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', "The soundcloud id for this file is: "+json.sc_id);
+ this.set('content.text', $.i18n.("The soundcloud id for this file is: ")+json.sc_id);
}
}
},
@@ -468,14 +468,14 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("sc-error")){
$(ele).qtip({
content: {
- text: "Retreiving data from the server...",
+ text: $.i18n.("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "show"}),
success: function(json, status){
- this.set('content.text', "There was error while uploading to soundcloud. "+"Error code: "+json.error_code+
- " "+"Error msg: "+json.error_msg+" ");
+ this.set('content.text', $.i18n.("There was error while uploading to soundcloud.")+" "+$.i18n._("Error code: ")+json.error_code+
+ " "+$.i18n._("Error msg: ")+json.error_msg+" ");
}
}
},
@@ -495,7 +495,7 @@ function addQtipToSCIcons(ele){
}else if ($(ele).hasClass("show-empty")){
$(ele).qtip({
content: {
- text: "This show has no scheduled content."
+ text: $.i18n._("This show has no scheduled content.")
},
position:{
adjust: {
@@ -548,7 +548,7 @@ function checkEmptyShowStatus(e) {
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n.("The show instance doesn't exist anymore!"));
window.location.reload();
}
diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js
index e91f65c34..8c92c528f 100644
--- a/airtime_mvc/public/js/airtime/schedule/schedule.js
+++ b/airtime_mvc/public/js/airtime/schedule/schedule.js
@@ -22,7 +22,7 @@ function checkShowLength(json) {
if (percent > 100){
$("#show_time_warning")
- .text("Shows longer than their scheduled time will be cut off by a following show.")
+ .text($.i18n._("Shows longer than their scheduled time will be cut off by a following show."))
.show();
}
else {
@@ -33,7 +33,7 @@ function checkShowLength(json) {
}
function confirmCancelShow(show_instance_id){
- if (confirm('Cancel Current Show?')) {
+ if (confirm($.i18n._('Cancel Current Show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@@ -46,7 +46,7 @@ function confirmCancelShow(show_instance_id){
}
function confirmCancelRecordedShow(show_instance_id){
- if (confirm('Stop recording current show?')) {
+ if (confirm($.i18n._('Stop recording current show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@@ -165,7 +165,7 @@ function buildScheduleDialog (json) {
close: closeDialog,
buttons: [
{
- text: "Ok",
+ text: $.i18n._("Ok"),
"class": "btn",
click: function() {
$(this).dialog("close");
@@ -207,14 +207,14 @@ function buildContentDialog (json){
dialog.dialog({
autoOpen: false,
- title: "Contents of Show \"" + json.showTitle + "\"",
+ title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
width: width,
height: height,
modal: true,
close: closeDialog,
buttons: [
{
- text: "Ok",
+ text: $.i18n._("Ok"),
"class": "btn",
click: function() {
dialog.remove();
@@ -283,7 +283,7 @@ function createFullCalendar(data){
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert("The show instance doesn't exist anymore!");
+ alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload();
}
@@ -324,7 +324,7 @@ $(document).ready(function() {
if (oItems.clear !== undefined) {
callback = function() {
- if (confirm("Remove all content?")) {
+ if (confirm($.i18n._("Remove all content?"))) {
$.post(oItems.clear.url, {format: "json", id: data.id}, function(json){
scheduleRefetchEvents(json);
});
diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js
index 7fd4fa5b4..e410ba739 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js
@@ -283,7 +283,7 @@ var AIRTIME = (function(AIRTIME){
mod.fnRemove = function(aItems) {
mod.disableUI();
- if (confirm("Delete selected item(s)?")) {
+ if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"/showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
@@ -360,17 +360,17 @@ var AIRTIME = (function(AIRTIME){
"aoColumns": [
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
- /* starts */ {"mDataProp": "starts", "sTitle": "Start", "sClass": "sb-starts", "sWidth": "60px"},
- /* ends */ {"mDataProp": "ends", "sTitle": "End", "sClass": "sb-ends", "sWidth": "60px"},
- /* runtime */ {"mDataProp": "runtime", "sTitle": "Duration", "sClass": "library_length sb-length", "sWidth": "65px"},
- /* title */ {"mDataProp": "title", "sTitle": "Title", "sClass": "sb-title"},
- /* creator */ {"mDataProp": "creator", "sTitle": "Creator", "sClass": "sb-creator"},
- /* album */ {"mDataProp": "album", "sTitle": "Album", "sClass": "sb-album"},
- /* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"},
- /* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"},
- /* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"},
- /* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"},
- /* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"}
+ /* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
+ /* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
+ /* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
+ /* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
+ /* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
+ /* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
+ /* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
+ /* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
+ /* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
+ /* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
+ /* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
],
"bJQueryUI": true,
@@ -527,7 +527,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]);
$node.html('');
- sSeparatorHTML = 'Show Empty';
+ sSeparatorHTML = ''+$.i18n._("Show Empty")+'';
cl = cl + " sb-empty odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@@ -539,7 +539,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]);
$node.html('');
- sSeparatorHTML = 'Recording From Line In';
+ sSeparatorHTML = ''+$.i18n._("Recording From Line In")+'';
cl = cl + " sb-record odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@@ -554,7 +554,7 @@ var AIRTIME = (function(AIRTIME){
if (!isAudioSupported(aData.mime)) {
$image.html('');
} else {
- $image.html('')
+ $image.html('')
.click(function() {
open_show_preview(aData.instance, aData.pos);
return false;
@@ -565,7 +565,7 @@ var AIRTIME = (function(AIRTIME){
$image.html('');
$image.find(".ui-icon-alert").qtip({
content: {
- text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
+ text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore.")
},
style: {
classes: "ui-tooltip-dark"
@@ -877,7 +877,7 @@ var AIRTIME = (function(AIRTIME){
//can't add items outside of shows.
if (prev.find("td:first").hasClass("dataTables_empty")
|| prev.length === 0) {
- alert("Cannot schedule outside a show.");
+ alert($.i18n._("Cannot schedule outside a show."));
ui.item.remove();
return;
}
@@ -932,10 +932,10 @@ var AIRTIME = (function(AIRTIME){
}
if (selected.length === 1) {
- message = "Moving "+selected.length+" Item.";
+ message = $.i18n._("Moving ")+selected.length+$.i18n._(" Item.");
}
else {
- message = "Moving "+selected.length+" Items.";
+ message = $.i18n._("Moving ")+selected.length+$.i18n._(" Items.");
}
draggingContainer = $('
");
//if 'Add/Remove content' was chosen from the context menu
//in the Calendar do not append these buttons
if ($(".ui-dialog-content").length === 0) {
$menu.append("
" +
- "" +
+ "" +
"
")
.append("
" +
- "" +
+ "" +
"
");
}
@@ -1019,7 +1019,7 @@ var AIRTIME = (function(AIRTIME){
.click(function() {
var $tr,
data,
- msg = 'Cancel Current Show?';
+ msg = $.i18n._('Cancel Current Show?');
if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
return;
@@ -1031,7 +1031,7 @@ var AIRTIME = (function(AIRTIME){
data = $tr.data("aData");
if (data.record === true) {
- msg = 'Stop recording current show?';
+ msg = $.i18n._('Stop recording current show?');
}
if (confirm(msg)) {
diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
index 74358a99d..70be61183 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js
@@ -15,7 +15,7 @@ AIRTIME = (function(AIRTIME) {
timeStartId = "#sb_time_start",
dateEndId = "#sb_date_end",
timeEndId = "#sb_time_end",
- $toggleLib = $("Add / Remove Content"),
+ $toggleLib = $(""+$.i18n._("Add / Remove Content")+""),
$libClose = $('', {
"class": "close-round",
"href": "#",
diff --git a/airtime_mvc/public/js/airtime/status/status.js b/airtime_mvc/public/js/airtime/status/status.js
index 9223b247a..cd0699e3a 100644
--- a/airtime_mvc/public/js/airtime/status/status.js
+++ b/airtime_mvc/public/js/airtime/status/status.js
@@ -2,7 +2,7 @@ function generatePartitions(partitions){
var rowTemplate =
'
'+
- '
Disk #%s'+
+ '
'+$.i18n._("Disk")+' #%s'+
'
'+
'
'+
'
'+
@@ -12,7 +12,7 @@ function generatePartitions(partitions){
'
'+
'
'+
''+
- '
%s%% in use
'+
+ '
%s%% '+$.i18n._("in use")+'
'+
''+
'
';
diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js
index 637666719..18d1d7d7a 100644
--- a/airtime_mvc/public/js/airtime/user/user.js
+++ b/airtime_mvc/public/js/airtime/user/user.js
@@ -45,16 +45,16 @@ function rowCallback( nRow, aData, iDisplayIndex ){
if ( aData['type'] == "A" )
{
- $('td:eq(3)', nRow).html( 'Admin' );
+ $('td:eq(3)', nRow).html( $.i18n._('Admin') );
} else if ( aData['type'] == "H" )
{
- $('td:eq(3)', nRow).html( 'DJ' );
+ $('td:eq(3)', nRow).html( $.i18n._('DJ') );
} else if ( aData['type'] == "G" )
{
- $('td:eq(3)', nRow).html( 'Guest' );
+ $('td:eq(3)', nRow).html( $.i18n._('Guest') );
} else if ( aData['type'] == "P" )
{
- $('td:eq(3)', nRow).html( 'Program Manager' );
+ $('td:eq(3)', nRow).html( $.i18n._('Program Manager') );
}
return nRow;
From f40d1f8dd462167977d9ced7bb905e07e59dd543 Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 16:40:02 -0500
Subject: [PATCH 24/62] CC-1960: Internationalize Airtime / Support
translations
-enabled i18n for datatables, colVis, columnFilter, and fullCalendar
-fixed typos in full-calendar-functions.js
---
airtime_mvc/application/Bootstrap.php | 5 +-
.../controllers/LocaleController.php | 69 +++++++++++++++++--
.../views/scripts/playlist/playlist.phtml | 4 +-
.../public/js/airtime/library/library.js | 6 +-
.../schedule/full-calendar-functions.js | 24 +++----
.../public/js/airtime/schedule/schedule.js | 52 ++++++++++++++
airtime_mvc/public/js/airtime/user/user.js | 4 +-
.../plugin/AIRTIME_DEV_README_COL_VIS | 6 +-
.../js/datatables/plugin/dataTables.ColVis.js | 2 +-
.../plugin/dataTables.columnFilter.js | 2 +-
10 files changed, 142 insertions(+), 32 deletions(-)
diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php
index 06226cb8f..c6bc3bd31 100644
--- a/airtime_mvc/application/Bootstrap.php
+++ b/airtime_mvc/application/Bootstrap.php
@@ -103,8 +103,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/bootstrap/bootstrap.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$view->headScript()->appendFile($baseUrl.'/js/i18n/jquery.i18n.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
- $view->headScript()->appendFile($baseUrl.'/locale/translation-table?'.$CC_CONFIG['airtime_version'].rand(5, 10),'text/javascript');
- $view->headScript()->appendScript("$.i18n.setDictionary(lang_dict)");
+ $view->headScript()->appendFile($baseUrl.'/locale/general-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendFile($baseUrl.'/locale/datatables-translation-table?'.$CC_CONFIG['airtime_version'],'text/javascript');
+ $view->headScript()->appendScript("$.i18n.setDictionary(general_dict)");
$view->headScript()->appendScript("var baseUrl='$baseUrl'");
//scripts for now playing bar
diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
index 7f5ecc805..4fa34b8d4 100644
--- a/airtime_mvc/application/controllers/LocaleController.php
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -5,11 +5,23 @@ class LocaleController extends Zend_Controller_Action
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
- $ajaxContext->addActionContext('language-table', 'json')
+ $ajaxContext->addActionContext('general-translation-table', 'json')
+ ->addActionContext('datatables-translation-table', 'json')
->initContext();
}
- public function translationTableAction()
+ public function datatablesTranslationTableAction()
+ {
+ $this->view->layout()->disableLayout();
+ $this->_helper->viewRenderer->setNoRender(true);
+ header("Content-type: text/javascript");
+
+ $baseUrl = Application_Common_OsPath::getBaseDir();
+ echo "var datatables_dict =" .
+ file_get_contents($_SERVER['DOCUMENT_ROOT'].$baseUrl.'/js/datatables/i18n/de_DE.txt');
+ }
+
+ public function generalTranslationTableAction()
{
$translations = array (
//common/common.js
@@ -196,6 +208,48 @@ class LocaleController extends Zend_Controller_Action
//already in schedule/add-show.js
//"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
//schedule/schedule.js
+ "January" => _("January"),
+ "February" => _("February"),
+ "March" => _("March"),
+ "April" => _("April"),
+ "May" => _("May"),
+ "June" => _("June"),
+ "July" => _("July"),
+ "August" => _("August"),
+ "September" => _("September"),
+ "October" => _("October"),
+ "November" => _("November"),
+ "December" => _("December"),
+ "Jan" => _("Jan"),
+ "Feb" => _("Feb"),
+ "Mar" => _("Mar"),
+ "Apr" => _("Apr"),
+ "May" => _("May"),
+ "Jun" => _("Jun"),
+ "Jul" => _("Jul"),
+ "Aug" => _("Aug"),
+ "Sep" => _("Sep"),
+ "Oct" => _("Oct"),
+ "Nov" => _("Nov"),
+ "Dec" => _("Dec"),
+ "today" => _("today"),
+ "day" => _("day"),
+ "week" => _("week"),
+ "month" => _("month"),
+ "Sunday" => _("Sunday"),
+ "Monday" => _("Monday"),
+ "Tuesday" => _("Tuesday"),
+ "Wednesday" => _("Wednesday"),
+ "Thursday" => _("Thursday"),
+ "Friday" => _("Friday"),
+ "Saturday" => _("Saturday"),
+ "Sun" => _("Sun"),
+ "Mon" => _("Mon"),
+ "Tue" => _("Tue"),
+ "Wed" => _("Wed"),
+ "Thu" => _("Thu"),
+ "Fri" => _("Fri"),
+ "Sat" => _("Sat"),
"Shows longer than their scheduled time will be cut off by a following show." => _("Shows longer than their scheduled time will be cut off by a following show."),
"Cancel Current Show?" => _("Cancel Current Show?"),
"Stop recording current show?" => _("Stop recording current show?"),
@@ -221,7 +275,7 @@ class LocaleController extends Zend_Controller_Action
"Show Empty" => _("Show Empty"),
"Recording From Line In" => _("Recording From Line In"),
"Track preview" => _("Track preview"),
- //already in library/spl/js
+ //already in library/spl.js
//"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
"Cannot schedule outside a show." => _("Cannot schedule outside a show."),
@@ -230,7 +284,7 @@ class LocaleController extends Zend_Controller_Action
" Item." => _(" Item."),
" Items." => _(" Items."),
//already in library/library.js
- "Select" => _("Select"),
+ //"Select" => _("Select"),
"Select all" => _("Select all"),
"Select none" => _("Select none"),
"Remove overbooked tracks" => _("Remove overbooked tracks"),
@@ -251,12 +305,15 @@ class LocaleController extends Zend_Controller_Action
"DJ" => _("DJ"),
"Program Manager" => _("Program Manager"),
"Guest" => _("Guest"),
-
+ //dataTables/ColVis.js
+ "Show / hide columns" => _("Show / hide columns"),
+ //datatables.columnFilter.js
+ "From {from} to {to}" => _("From {from} to {to}")
);
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
header("Content-type: text/javascript");
- echo "var lang_dict=".json_encode($translations);
+ echo "var general_dict=".json_encode($translations);
}
}
\ No newline at end of file
diff --git a/airtime_mvc/application/views/scripts/playlist/playlist.phtml b/airtime_mvc/application/views/scripts/playlist/playlist.phtml
index 216cb5ac4..f8496d926 100644
--- a/airtime_mvc/application/views/scripts/playlist/playlist.phtml
+++ b/airtime_mvc/application/views/scripts/playlist/playlist.phtml
@@ -17,10 +17,10 @@ if (isset($this->obj)) {
obj)) : ?>
- Shuffle
+ echo _("Shuffle") ?>
- echo _("Save") ?>
+ echo _("Save") ?>
echo _("Delete") ?>
diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js
index 72980ab15..e9ece9a37 100644
--- a/airtime_mvc/public/js/airtime/library/library.js
+++ b/airtime_mvc/public/js/airtime/library/library.js
@@ -465,6 +465,7 @@ var AIRTIME = (function(AIRTIME) {
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
],
+
"bProcessing": true,
"bServerSide": true,
@@ -664,10 +665,7 @@ var AIRTIME = (function(AIRTIME) {
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"bAutoWidth": false,
- "oLanguage": {
- "sSearch": "",
- "sLengthMenu": "Show _MENU_"
- },
+ "oLanguage": datatables_dict,
// R = ColReorder, C = ColVis
"sDom": 'Rl<"#library_display_type">f<"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
index 4bfaabf56..e045248e9 100644
--- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
+++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js
@@ -154,12 +154,12 @@ function viewDisplay( view ) {
var calendarEl = this;
var select = $('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
- .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
+ .append('')
.change(function(){
var slotMin = $(this).val();
var opt = view.calendar.options;
@@ -424,7 +424,7 @@ function addQtipToSCIcons(ele){
if($(ele).hasClass("progress")){
$(ele).qtip({
content: {
- text: $.i18n.("Uploading in progress...")
+ text: $.i18n._("Uploading in progress...")
},
position:{
adjust: {
@@ -442,13 +442,13 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("soundcloud")){
$(ele).qtip({
content: {
- text: $.i18n.("Retreiving data from the server..."),
+ text: $.i18n._("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
success: function(json, status){
- this.set('content.text', $.i18n.("The soundcloud id for this file is: ")+json.sc_id);
+ this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
}
}
},
@@ -468,13 +468,13 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("sc-error")){
$(ele).qtip({
content: {
- text: $.i18n.("Retreiving data from the server..."),
+ text: $.i18n._("Retreiving data from the server..."),
ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "show"}),
success: function(json, status){
- this.set('content.text', $.i18n.("There was error while uploading to soundcloud.")+" "+$.i18n._("Error code: ")+json.error_code+
+ this.set('content.text', $.i18n._("There was error while uploading to soundcloud.")+" "+$.i18n._("Error code: ")+json.error_code+
" "+$.i18n._("Error msg: ")+json.error_msg+" ");
}
}
@@ -548,7 +548,7 @@ function checkEmptyShowStatus(e) {
//Alert the error and reload the page
//this function is used to resolve concurrency issue
function alertShowErrorAndReload(){
- alert($.i18n.("The show instance doesn't exist anymore!"));
+ alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload();
}
diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js
index 8c92c528f..475c17001 100644
--- a/airtime_mvc/public/js/airtime/schedule/schedule.js
+++ b/airtime_mvc/public/js/airtime/schedule/schedule.js
@@ -262,6 +262,58 @@ function createFullCalendar(data){
agenda: 'H:mm{ - H:mm}',
month: 'H:mm{ - H:mm}'
},
+ monthNames: [
+ $.i18n._('January'),
+ $.i18n._('February'),
+ $.i18n._('March'),
+ $.i18n._('April'),
+ $.i18n._('May'),
+ $.i18n._('June'),
+ $.i18n._('July'),
+ $.i18n._('August'),
+ $.i18n._('September'),
+ $.i18n._('October'),
+ $.i18n._('November'),
+ $.i18n._('December')
+ ],
+ monthNamesShort: [
+ $.i18n._('Jan'),
+ $.i18n._('Feb'),
+ $.i18n._('Mar'),
+ $.i18n._('Apr'),
+ $.i18n._('May'),
+ $.i18n._('Jun'),
+ $.i18n._('Jul'),
+ $.i18n._('Aug'),
+ $.i18n._('Sep'),
+ $.i18n._('Oct'),
+ $.i18n._('Nov'),
+ $.i18n._('Dec')
+ ],
+ buttonText: {
+ today: $.i18n._('today'),
+ month: $.i18n._('month'),
+ week: $.i18n._('week'),
+ day: $.i18n._('day')
+ },
+ dayNames: [
+ $.i18n._('Sunday'),
+ $.i18n._('Monday'),
+ $.i18n._('Tuesday'),
+ $.i18n._('Wednesday'),
+ $.i18n._('Thursday'),
+ $.i18n._('Friday'),
+ $.i18n._('Saturday')
+ ],
+ dayNamesShort: [
+ $.i18n._('Sun'),
+ $.i18n._('Mon'),
+ $.i18n._('Tue'),
+ $.i18n._('Wed'),
+ $.i18n._('Thu'),
+ $.i18n._('Fri'),
+ $.i18n._('Sat')
+ ],
contentHeight: mainHeight,
theme: true,
lazyFetching: false,
diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js
index 18d1d7d7a..35d4e16dd 100644
--- a/airtime_mvc/public/js/airtime/user/user.js
+++ b/airtime_mvc/public/js/airtime/user/user.js
@@ -86,9 +86,7 @@ function populateUserTable() {
"bJQueryUI": true,
"bAutoWidth": false,
"bLengthChange": false,
- "oLanguage": {
- "sSearch": ""
- },
+ "oLanguage": datatables_dict,
"sDom": '<"H"lf<"dt-process-rel"r>>t<"F"ip>',
});
diff --git a/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COL_VIS b/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COL_VIS
index c332d036e..2a04f4f0d 100644
--- a/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COL_VIS
+++ b/airtime_mvc/public/js/datatables/plugin/AIRTIME_DEV_README_COL_VIS
@@ -30,4 +30,8 @@ The new _fnDomBaseButton looks like this:
return nButton;
},
-
\ No newline at end of file
+
+--------------------------------------------------------------------------------
+* Line 96 has changed
+- "buttonText": "Show / hide columns",
++ "buttonText": $.i18n._("Show / hide columns"),
\ No newline at end of file
diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js b/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js
index 2f1c8ed02..4c5c3bfaf 100644
--- a/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js
+++ b/airtime_mvc/public/js/datatables/plugin/dataTables.ColVis.js
@@ -95,7 +95,7 @@ ColVis = function( oDTSettings, oInit )
* @type String
* @default Show / hide columns
*/
- "buttonText": "Show / hide columns",
+ "buttonText": $.i18n._("Show / hide columns"),
/**
* Flag to say if the collection is hidden
diff --git a/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js b/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js
index 80cb011cf..7e64409fd 100644
--- a/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js
+++ b/airtime_mvc/public/js/datatables/plugin/dataTables.columnFilter.js
@@ -585,7 +585,7 @@
sRangeSeparator: "~",
iFilteringDelay: 500,
aoColumns: null,
- sRangeFormat: "From {from} to {to}"
+ sRangeFormat: $.i18n._("From {from} to {to}")
};
properties = $.extend(defaults, options);
From e9b9f636302815e66b5ada32f4b16bae59a61b64 Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 16:42:06 -0500
Subject: [PATCH 25/62] CC-1960: Internationalize Airtime / Support
translations
-added english translation file for datatables
---
.../public/js/datatables/i18n/en_CA.txt | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 airtime_mvc/public/js/datatables/i18n/en_CA.txt
diff --git a/airtime_mvc/public/js/datatables/i18n/en_CA.txt b/airtime_mvc/public/js/datatables/i18n/en_CA.txt
new file mode 100644
index 000000000..ff3cf6be4
--- /dev/null
+++ b/airtime_mvc/public/js/datatables/i18n/en_CA.txt
@@ -0,0 +1,23 @@
+{
+"sEmptyTable": "No data available in table",
+"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
+"sInfoEmpty": "Showing 0 to 0 of 0 entries",
+"sInfoFiltered": "(filtered from _MAX_ total entries)",
+"sInfoPostFix": "",
+"sInfoThousands": ",",
+"sLengthMenu": "Show _MENU_",
+"sLoadingRecords": "Loading...",
+"sProcessing": "Processing...",
+"sSearch": "",
+"sZeroRecords": "No matching records found",
+"oPaginate": {
+ "sFirst": "First",
+ "sLast": "Last",
+ "sNext": "Next",
+ "sPrevious": "Previous"
+},
+"oAria": {
+ "sSortAscending": ": activate to sort column ascending",
+ "sSortDescending": ": activate to sort column descending"
+}
+}
\ No newline at end of file
From 06c3dcb69e695d89433591990c7750d54b487991 Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 16:43:42 -0500
Subject: [PATCH 26/62] CC-1960: Internationalize Airtime / Support
translations
-added jquery.i18n library
---
airtime_mvc/public/js/i18n/jquery.i18n.js | 117 ++++++++++++++++++++++
1 file changed, 117 insertions(+)
create mode 100644 airtime_mvc/public/js/i18n/jquery.i18n.js
diff --git a/airtime_mvc/public/js/i18n/jquery.i18n.js b/airtime_mvc/public/js/i18n/jquery.i18n.js
new file mode 100644
index 000000000..eff9b0d04
--- /dev/null
+++ b/airtime_mvc/public/js/i18n/jquery.i18n.js
@@ -0,0 +1,117 @@
+/*
+ * jQuery i18n plugin
+ * @requires jQuery v1.1 or later
+ *
+ * See http://recursive-design.com/projects/jquery-i18n/
+ *
+ * Licensed under the MIT license:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Version: 1.0.0 (201210141329)
+ */
+ (function($) {
+ /**
+ * i18n provides a mechanism for translating strings using a jscript dictionary.
+ *
+ */
+
+ /*
+ * i18n property list
+ */
+ $.i18n = {
+
+ dict: null,
+
+ /**
+ * setDictionary()
+ *
+ * Initialises the dictionary.
+ *
+ * @param property_list i18n_dict : The dictionary to use for translation.
+ */
+ setDictionary: function(i18n_dict) {
+ this.dict = i18n_dict;
+ },
+
+ /**
+ * _()
+ *
+ * Looks the given string up in the dictionary and returns the translation if
+ * one exists. If a translation is not found, returns the original word.
+ *
+ * @param string str : The string to translate.
+ * @param property_list params : params for using printf() on the string.
+ *
+ * @return string : Translated word.
+ */
+ _: function (str, params) {
+ var result = str;
+ if (this.dict && this.dict[str]) {
+ result = this.dict[str];
+ }
+
+ // Substitute any params.
+ return this.printf(result, params);
+ },
+
+ /*
+ * printf()
+ *
+ * Substitutes %s with parameters given in list. %%s is used to escape %s.
+ *
+ * @param string str : String to perform printf on.
+ * @param string args : Array of arguments for printf.
+ *
+ * @return string result : Substituted string
+ */
+ printf: function(str, args) {
+ if (!args) return str;
+
+ var result = '';
+ var search = /%(\d+)\$s/g;
+
+ // Replace %n1$ where n is a number.
+ var matches = search.exec(str);
+ while (matches) {
+ var index = parseInt(matches[1], 10) - 1;
+ str = str.replace('%' + matches[1] + '\$s', (args[index]));
+ matches = search.exec(str);
+ }
+ var parts = str.split('%s');
+
+ if (parts.length > 1) {
+ for(var i = 0; i < args.length; i++) {
+ // If the part ends with a '%' chatacter, we've encountered a literal
+ // '%%s', which we should output as a '%s'. To achieve this, add an
+ // 's' on the end and merge it with the next part.
+ if (parts[i].length > 0 && parts[i].lastIndexOf('%') == (parts[i].length - 1)) {
+ parts[i] += 's' + parts.splice(i + 1, 1)[0];
+ }
+
+ // Append the part and the substitution to the result.
+ result += parts[i] + args[i];
+ }
+ }
+
+ return result + parts[parts.length - 1];
+ }
+
+ };
+
+ /*
+ * _t()
+ *
+ * Allows you to translate a jQuery selector.
+ *
+ * eg $('h1')._t('some text')
+ *
+ * @param string str : The string to translate .
+ * @param property_list params : Params for using printf() on the string.
+ *
+ * @return element : Chained and translated element(s).
+ */
+ $.fn._t = function(str, params) {
+ return $(this).text($.i18n._(str, params));
+ };
+
+})(jQuery);
\ No newline at end of file
From 10cd31fa5676e891fc2d6c04495186f7182fbe12 Mon Sep 17 00:00:00 2001
From: denise
Date: Tue, 20 Nov 2012 17:42:26 -0500
Subject: [PATCH 27/62] CC-1960: Internationalize Airtime / Support
translations
- channged all js strings with embedded variables to use sprintf
---
.../controllers/LocaleController.php | 23 +++++++------------
.../library/events/library_playlistbuilder.js | 4 ++--
.../library/events/library_showbuilder.js | 4 ++--
.../js/airtime/preferences/streamsetting.js | 3 ++-
.../public/js/airtime/showbuilder/builder.js | 4 ++--
5 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php
index 1b0b53648..eb92a1034 100644
--- a/airtime_mvc/application/controllers/LocaleController.php
+++ b/airtime_mvc/application/controllers/LocaleController.php
@@ -41,17 +41,14 @@ class LocaleController extends Zend_Controller_Action
//library/events/library_playlistbuilder.js
" Add to current playlist" => _(" Add to current playlist"),
" Add to current smart block" => _(" Add to current smart block"),
- "Adding 1 Item." => _("Adding 1 Item."),
- /*****embedded variable*****/
- "Adding " => _("Adding "),
- " Items." => _(" Items."),
+ "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."),
"You can only add tracks, smart blocks, and webstreams to playlists." => _("You can only add tracks, smart blocks, and webstreams to playlists."),
//library/events/library_showbuilder.js
- "Adding 1 Item." => _("Adding 1 Item."),
- /****string with variable*****/
- "Adding " => _("Adding "),
- " Items." => _(" Items."),
+ //already in library/events/library_playlistbuilder.js
+ //"Adding 1 Item" => _("Adding 1 Item"),
+ //"Adding %s Items" => _("Adding %s Items"),
//library/library.js
"Select" => _("Select"),
"Select this page" => _("Select this page"),
@@ -167,9 +164,7 @@ class LocaleController extends Zend_Controller_Action
"Can not connect to the streaming server" => _("Can not connect to the streaming server"),
"If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."
=> _("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151."),
- /*****embedded variable*****/
- "For more details, please read the " => _("For more details, please read the "),
- "Airtime manual" => _("Airtime manual"),
+ "For more details, please read the %sAirtime Manual%s" => _("For more details, please read the %sAirtime Manual%s"),
"Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
=> _("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."),
"Check this box to automatically switch off Master/Show source upon source disconnection." => _("Check this box to automatically switch off Master/Show source upon source disconnection."),
@@ -279,10 +274,8 @@ class LocaleController extends Zend_Controller_Action
//"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
"Cannot schedule outside a show." => _("Cannot schedule outside a show."),
- /*****embedded variable*****/
- "Moving " => _("Moving "),
- " Item." => _(" Item."),
- " Items." => _(" Items."),
+ "Moving 1 Item" => _("Moving 1 Item"),
+ "Moving %s Items" => _("Moving %s Items"),
//already in library/library.js
//"Select" => _("Select"),
"Select all" => _("Select all"),
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 ced6d852e..d25ad32c6 100644
--- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js
+++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js
@@ -86,9 +86,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = $.i18n._("Adding 1 Item.");
+ message = $.i18n._("Adding 1 Item");
} else {
- message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
+ message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('').append(
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 a0d5b4598..b0ab1b042 100644
--- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
+++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js
@@ -66,9 +66,9 @@ var AIRTIME = (function(AIRTIME) {
}
if (selected === 1) {
- message = $.i18n._("Adding 1 Item.");
+ message = $.i18n._("Adding 1 Item");
} else {
- message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
+ message = sprintf($.i18n._("Adding %s Items"), selected);
}
container = $('').attr('id',
diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
index 1362fb456..5c1734772 100644
--- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js
+++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js
@@ -251,7 +251,8 @@ function setupEventListeners() {
$(".override_help_icon").qtip({
content: {
text: $.i18n._("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151.")+" "+
- $.i18n._("For more details, please read the ")+""+$.i18n._("Airtime manual")+"."
+ sprintf($.i18n._(
+ "For more details, please read the %sAirtime Manual%s"), "", "")
},
hide: {
delay: 500,
diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js
index e410ba739..7e3de9ac2 100644
--- a/airtime_mvc/public/js/airtime/showbuilder/builder.js
+++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js
@@ -932,10 +932,10 @@ var AIRTIME = (function(AIRTIME){
}
if (selected.length === 1) {
- message = $.i18n._("Moving ")+selected.length+$.i18n._(" Item.");
+ message = $.i18n._("Moving 1 Item");
}
else {
- message = $.i18n._("Moving ")+selected.length+$.i18n._(" Items.");
+ message = sprintf($.i18n._("Moving %s Items"), selected.length);
}
draggingContainer = $('