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
This commit is contained in:
denise 2012-11-20 11:16:10 -05:00
parent b801235c99
commit 57fdab0ddf
25 changed files with 472 additions and 209 deletions

View File

@ -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/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/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/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'"); $view->headScript()->appendScript("var baseUrl='$baseUrl'");
//scripts for now playing bar //scripts for now playing bar

View File

@ -26,7 +26,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
->add(new Zend_Acl_Resource('listenerstat')) ->add(new Zend_Acl_Resource('listenerstat'))
->add(new Zend_Acl_Resource('usersettings')) ->add(new Zend_Acl_Resource('usersettings'))
->add(new Zend_Acl_Resource('audiopreview')) ->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 */ /** Creating permissions */
$ccAcl->allow('G', 'index') $ccAcl->allow('G', 'index')
@ -38,6 +39,7 @@ $ccAcl->allow('G', 'index')
->allow('G', 'dashboard') ->allow('G', 'dashboard')
->allow('G', 'audiopreview') ->allow('G', 'audiopreview')
->allow('G', 'webstream') ->allow('G', 'webstream')
->allow('G', 'locale')
->allow('H', 'preference', 'is-import-in-progress') ->allow('H', 'preference', 'is-import-in-progress')
->allow('H', 'usersettings') ->allow('H', 'usersettings')
->allow('H', 'plupload') ->allow('H', 'plupload')

View File

@ -0,0 +1,262 @@
<?php
class LocaleController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_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);
}
}

View File

@ -104,7 +104,7 @@ function open_show_preview(p_showID, p_showIndex) {
} }
function openPreviewWindow(url) { 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; return false;
} }

View File

@ -143,24 +143,24 @@ function updatePlaybar(){
} }
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){ if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
if (currentSong.record == "1") if (currentSong.record == "1")
$('#current').html("<span style='color:red; font-weight:bold'>Recording: </span>"+currentSong.name+","); $('#current').html("<span style='color:red; font-weight:bold'>"+$.i18n._("Recording:")+"</span>"+currentSong.name+",");
else else
$('#current').text(currentSong.name+","); $('#current').text(currentSong.name+",");
}else{ }else{
if (master_dj_on_air) { if (master_dj_on_air) {
if (showName) { if (showName) {
$('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Master Stream</span>"); $('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Master Stream")+"</span>");
} else { } else {
$('#current').html("Current: <span style='color:red; font-weight:bold'>Master Stream</span>"); $('#current').html("Current: <span style='color:red; font-weight:bold'>"+$.i18n._("Master Stream")+"</span>");
} }
} else if (live_dj_on_air) { } else if (live_dj_on_air) {
if (showName) { if (showName) {
$('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Live Stream</span>"); $('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Live Stream")+"</span>");
} else { } else {
$('#current').html("Current: <span style='color:red; font-weight:bold'>Live Stream</span>"); $('#current').html("Current: <span style='color:red; font-weight:bold'>"+$.i18n._("Live Stream")+"</span>");
} }
} else { } else {
$('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>"); $('#current').html("Current: <span style='color:red; font-weight:bold'>"+$.i18n._("Nothing Scheduled")+"</span>");
} }
} }
@ -191,7 +191,7 @@ function updatePlaybar(){
$('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs)); $('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs));
} }
/* Column 1 update */ /* Column 1 update */
$('#playlist').text("Current Show:"); $('#playlist').text($.i18n._("Current Show:"));
var recElem = $('.recording-show'); var recElem = $('.recording-show');
if (currentShow.length > 0){ if (currentShow.length > 0){
$('#playlist').text(currentShow[0].name); $('#playlist').text(currentShow[0].name);

View File

@ -8,13 +8,13 @@ function getContent() {
var msg = ""; var msg = "";
// See file airtime_mvc/application/views/helpers/VersionNotify.php for more info // See file airtime_mvc/application/views/helpers/VersionNotify.php for more info
if(isUpToDate()) { if(isUpToDate()) {
msg = "You are running the latest version"; msg = $.i18n._("You are running the latest version");
} else if (diff < 20) { } else if (diff < 20) {
msg = "New version available: " + link; msg = $.i18n._("New version available: ") + link;
} else if (diff < 30) { } else if (diff < 30) {
msg = "This version will soon be obsolete.<br/>Please upgrade to " + link; msg = $.i18n._("This version will soon be obsolete.")+"<br/>"+$.i18n._("Please upgrade to ") + link;
} else { } else {
msg = "This version is no longer supported.<br/>Please upgrade to " + link; msg = $.i18n._("This version is no longer supported.")+"<br/>"+$.i18n._("Please upgrade to ") + link;
} }
return msg; return msg;

View File

@ -30,11 +30,11 @@ var AIRTIME = (function(AIRTIME) {
var objType = $('#obj_type').val(), var objType = $('#obj_type').val(),
btnText; btnText;
if (objType === 'playlist') { if (objType === 'playlist') {
btnText = ' Add to current playlist'; btnText = $.i18n._(' Add to current playlist');
} else if (objType === 'block') { } else if (objType === 'block') {
btnText = ' Add to current smart block'; btnText = $.i18n._(' Add to current smart block');
} else { } else {
btnText = ' Add to current playlist'; btnText = $.i18n._(' Add to current playlist');
} }
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText); AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
}; };
@ -86,9 +86,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (selected === 1) { if (selected === 1) {
message = "Adding 1 Item."; message = $.i18n._("Adding 1 Item.");
} else { } else {
message = "Adding " + selected + " Items."; message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
} }
container = $('<div class="helper"/>').append( container = $('<div class="helper"/>').append(
@ -158,9 +158,9 @@ var AIRTIME = (function(AIRTIME) {
undefined, 'after'); undefined, 'after');
} else { } else {
if ($('#obj_type').val() == 'block') { 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') { } 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.'));
} }
} }
}); });

View File

@ -66,9 +66,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (selected === 1) { if (selected === 1) {
message = "Adding 1 Item."; message = $.i18n._("Adding 1 Item.");
} else { } else {
message = "Adding " + selected + " Items."; message = $.i18n._("Adding ") + selected + $.i18n._(" Items.");
} }
container = $('<div/>').attr('id', container = $('<div/>').attr('id',

View File

@ -109,12 +109,12 @@ var AIRTIME = (function(AIRTIME) {
$menu $menu
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" + "<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
"Select <span class='caret'></span>" + $.i18n._("Select")+" <span class='caret'></span>" +
"</button>" + "</button>" +
"<ul class='dropdown-menu'>" + "<ul class='dropdown-menu'>" +
"<li id='sb-select-page'><a href='#'>Select this page</a></li>" + "<li id='sb-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
"<li id='sb-dselect-page'><a href='#'>Deselect this page</a></li>" + "<li id='sb-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
"<li id='sb-dselect-all'><a href='#'>Deselect all</a></li>" + "<li id='sb-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
"</ul>" + "</ul>" +
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
@ -322,7 +322,7 @@ var AIRTIME = (function(AIRTIME) {
}; };
mod.fnDeleteSelectedItems = function() { 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(), var aData = AIRTIME.library.getSelectedData(),
item, item,
temp, temp,
@ -439,31 +439,31 @@ var AIRTIME = (function(AIRTIME) {
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } , /* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } , /* 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 } , /* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
/* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } , /* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
/* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } , /* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
/* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } , /* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
/* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" }, /* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
/* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" }, /* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
/* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" }, /* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" }, /* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" }, /* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
/* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" }, /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
/* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" }, /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" }, /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" }, /* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
/* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" }, /* Language */ { "sTitle" : $.i18n._("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 Modified */ { "sTitle" : $.i18n._("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" }, /* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
/* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } , /* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" }, /* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
/* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" }, /* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" }, /* Owner */ { "sTitle" : $.i18n._("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" }, /* Replay Gain */ { "sTitle" : $.i18n._("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" }, /* Sample Rate */ { "sTitle" : $.i18n._("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" }, /* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
/* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } , /* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
/* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" }, /* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
/* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" } /* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
], ],
"bProcessing": true, "bProcessing": true,
@ -611,7 +611,7 @@ var AIRTIME = (function(AIRTIME) {
// icon. // icon.
$(nRow).find("td:not(.library_checkbox, .library_type)").qtip({ $(nRow).find("td:not(.library_checkbox, .library_type)").qtip({
content: { content: {
text: "Loading...", text: $.i18n._("Loading..."),
title: { title: {
text: aData.track_title text: aData.track_title
}, },
@ -725,11 +725,11 @@ var AIRTIME = (function(AIRTIME) {
.addClass("dataTables_type") .addClass("dataTables_type")
.append('<select name="library_display_type" />') .append('<select name="library_display_type" />')
.find("select") .find("select")
.append('<option value="0">All</option>') .append('<option value="0">'+$.i18n._("All")+'</option>')
.append('<option value="1">Files</option>') .append('<option value="1">'+$.i18n._("Files")+'</option>')
.append('<option value="2">Playlists</option>') .append('<option value="2">'+$.i18n._("Playlists")+'</option>')
.append('<option value="3">Smart Blocks</option>') .append('<option value="3">'+$.i18n._("Smart Blocks")+'</option>')
.append('<option value="4">Web Streams</option>') .append('<option value="4">'+$.i18n._("Web Streams")+'</option>')
.end() .end()
.change(function(ev){ .change(function(ev){
oTable.fnDraw(); oTable.fnDraw();
@ -812,7 +812,7 @@ var AIRTIME = (function(AIRTIME) {
AIRTIME.playlist.fnEdit(data.id, data.ftype, url); AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
} }
} else { } else {
throw new Exception("Unknown type: " + data.ftype); throw new Exception($.i18n._("Unknown type: ") + data.ftype);
} }
oItems.edit.callback = callback; oItems.edit.callback = callback;
} }
@ -854,7 +854,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() { callback = function() {
aMedia = []; aMedia = [];
aMedia.push({"id": data.id, "type": data.ftype}); 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); AIRTIME.library.fnDeleteItems(aMedia);
} }
}; };
@ -863,7 +863,7 @@ var AIRTIME = (function(AIRTIME) {
callback = function() { callback = function() {
var media = []; 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}); media.push({"id": data.id, "type": data.ftype});
$.post(oItems.del.url, {format: "json", media: media }, function(json){ $.post(oItems.del.url, {format: "json", media: media }, function(json){
@ -1010,7 +1010,7 @@ function addQtipToSCIcons(){
if ($(this).hasClass("progress")){ if ($(this).hasClass("progress")){
$(this).qtip({ $(this).qtip({
content: { content: {
text: "Uploading in progress..." text: $.i18n._("Uploading in progress...")
}, },
position:{ position:{
adjust: { adjust: {
@ -1030,13 +1030,13 @@ function addQtipToSCIcons(){
else if($(this).hasClass("soundcloud")){ else if($(this).hasClass("soundcloud")){
$(this).qtip({ $(this).qtip({
content: { content: {
text: "Retrieving data from the server...", text: $.i18n._("Retrieving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "file"}), data: ({format: "json", id : id, type: "file"}),
success: function(json, status){ 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")){ }else if($(this).hasClass("sc-error")){
$(this).qtip({ $(this).qtip({
content: { content: {
text: "Retreiving data from the server...", text: $.i18n._("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "file"}), data: ({format: "json", id : id, type: "file"}),
success: function(json, status){ success: function(json, status){
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+ this.set('content.text', $.i18n._("There was an error while uploading to soundcloud.")+"<br>"+
"<br>"+"Error msg: "+json.error_msg+"<br>"); $.i18n._("Error code: ")+json.error_code+
"<br>"+$.i18n._("Error msg: ")+json.error_msg+"<br>");
} }
} }
}, },
@ -1167,13 +1168,13 @@ function validateAdvancedSearch(divs) {
function addRemoveValidationIcons(valid, field, searchTermType) { function addRemoveValidationIcons(valid, field, searchTermType) {
var title = ''; var title = '';
if (searchTermType === 'i') { if (searchTermType === 'i') {
title = 'Input must be a positive number'; title = $.i18n._('Input must be a positive number');
} else if (searchTermType === 'n') { } else if (searchTermType === 'n') {
title = 'Input must be a number'; title = $.i18n._('Input must be a number');
} else if (searchTermType === 't') { } 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') { } 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 = " <span class='checked-icon sp-checked-icon'></span>", var validIndicator = " <span class='checked-icon sp-checked-icon'></span>",

View File

@ -56,7 +56,9 @@ $(document).ready(function() {
$(window).bind('beforeunload', function(){ $(window).bind('beforeunload', function(){
if(uploadProgress){ 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?");
} }
}); });

View File

@ -74,7 +74,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isTimeValid(cueIn)){ 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; return;
} }
$.post(url, $.post(url,
@ -111,7 +111,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isTimeValid(cueOut)){ 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; return;
} }
@ -150,7 +150,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){ 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; return;
} }
@ -188,7 +188,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){ 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; return;
} }
@ -378,7 +378,7 @@ var AIRTIME = (function(AIRTIME){
} else { } else {
$(value).attr("class", "big_play_disabled dark_class"); $(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({ $(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', show: 'mouseover',
hide: { hide: {
delay: 500, delay: 500,
@ -402,7 +402,7 @@ var AIRTIME = (function(AIRTIME){
if ($(value).attr('blocktype') === 'dynamic') { if ($(value).attr('blocktype') === 'dynamic') {
$(value).attr("class", "big_play_disabled dark_class"); $(value).attr("class", "big_play_disabled dark_class");
$(value).qtip({ $(value).qtip({
content: 'Dynamic block is not previewable', content: $.i18n._('Dynamic block is not previewable'),
show: 'mouseover', show: 'mouseover',
hide: { hide: {
delay: 500, delay: 500,
@ -483,7 +483,7 @@ var AIRTIME = (function(AIRTIME){
"</li>"; "</li>";
}); });
} }
$html += "<li><br /><span class='block-item-title'>Limit to: "+data.limit.value+" "+data.limit.modifier+"</span></li>"; $html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"</span></li>";
} }
$pl.find("#block_"+id+"_info").html($html).show(); $pl.find("#block_"+id+"_info").html($html).show();
mod.enableUI(); mod.enableUI();
@ -575,7 +575,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isFadeValid(fadeIn)){ 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; return;
} }
@ -599,7 +599,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val(); type = $('#obj_type').val();
if (!isFadeValid(fadeOut)){ 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; return;
} }
@ -682,7 +682,7 @@ var AIRTIME = (function(AIRTIME){
var field = json.analysis[s]; var field = json.analysis[s];
if (!field[0]) { if (!field[0]) {
var elemId = "#"+s+"-error"; var elemId = "#"+s+$.i18n._("-error");
var $div = $("#side_playlist " + elemId).text(field[1]).show(); var $div = $("#side_playlist " + elemId).text(field[1]).show();
} }
} }
@ -738,7 +738,7 @@ var AIRTIME = (function(AIRTIME){
if (obj_type == "block") { if (obj_type == "block") {
callback(data, "save"); callback(data, "save");
} else { } else {
$('.success').text('Playlist saved'); $('.success').text($.i18n._('Playlist saved'));
$('.success').show(); $('.success').show();
setTimeout(removeSuccessMsg, 5000); setTimeout(removeSuccessMsg, 5000);
dt.fnStandingRedraw(); dt.fnStandingRedraw();
@ -1075,7 +1075,7 @@ var AIRTIME = (function(AIRTIME){
$pl.find(".ui-icon-alert").qtip({ $pl.find(".ui-icon-alert").qtip({
content: { 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:{ position:{
adjust: { adjust: {

View File

@ -134,7 +134,7 @@ function plot(datasets){
var y = item.datapoint[1].toFixed(2); var y = item.datapoint[1].toFixed(2);
showTooltip(item.pageX, item.pageY, 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 { else {
@ -145,7 +145,7 @@ function plot(datasets){
$("#placeholder").bind("plotclick", function (event, pos, item) { $("#placeholder").bind("plotclick", function (event, pos, item) {
if (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); plot.highlight(item.series, item.datapoint);
} }
}); });

View File

@ -16,7 +16,7 @@ $(document).ready(function(){
buttons: [ buttons: [
{ {
id: "remind_me", id: "remind_me",
text: "Remind me in 1 week", text: $.i18n._("Remind me in 1 week"),
"class": "btn", "class": "btn",
click: function() { click: function() {
var url = baseUrl+'/Usersettings/remindme'; var url = baseUrl+'/Usersettings/remindme';
@ -29,7 +29,7 @@ $(document).ready(function(){
}, },
{ {
id: "remind_never", id: "remind_never",
text: "Remind me never", text: $.i18n._("Remind me never"),
"class": "btn", "class": "btn",
click: function() { click: function() {
var url =baseUrl+'/Usersettings/remindme-never'; var url =baseUrl+'/Usersettings/remindme-never';
@ -42,7 +42,7 @@ $(document).ready(function(){
}, },
{ {
id: "help_airtime", id: "help_airtime",
text: "Yes, help Airtime", text: $.i18n._("Yes, help Airtime"),
"class": "btn", "class": "btn",
click: function() { click: function() {
$("#register-form").submit(); $("#register-form").submit();
@ -129,7 +129,7 @@ $(document).ready(function(){
var ul, li; var ul, li;
ul = logoEl.find('.errors'); ul = logoEl.find('.errors');
li = $("<li/>").append("Image must be one of jpg, jpeg, png, or gif"); li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created. //errors ul has already been created.
if (ul.length > 0) { if (ul.length > 0) {

View File

@ -378,10 +378,8 @@ function setupUI() {
$(".playlist_type_help_icon").qtip({ $(".playlist_type_help_icon").qtip({
content: { content: {
text: "A static smart block will save the criteria and generate the block content immediately. " + 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.")+"<br /><br />" +
"This allows you to edit and view it in the Library before adding it to a show.<br /><br />" + $.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.")
"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: { hide: {
delay: 500, delay: 500,
@ -402,8 +400,7 @@ function setupUI() {
$(".repeat_tracks_help_icon").qtip({ $(".repeat_tracks_help_icon").qtip({
content: { content: {
text: "If your criteria is too strict, Airtime may not be able to fill up the desired smart block length." + 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.")
" Hence, if you check this option, tracks will be used more than once."
}, },
hide: { hide: {
delay: 500, delay: 500,
@ -495,9 +492,9 @@ function callback(data, type) {
var form = $('#smart-block-form'); var form = $('#smart-block-form');
if (json.result == "0") { if (json.result == "0") {
if (type == 'shuffle') { if (type == 'shuffle') {
form.find('.success').text('Smart block shuffled'); form.find('.success').text($.i18n._('Smart block shuffled'));
} else if (type == 'generate') { } 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 //redraw library table so the length gets updated
dt.fnStandingRedraw(); dt.fnStandingRedraw();
} }
@ -508,7 +505,7 @@ function callback(data, type) {
AIRTIME.playlist.fnOpenPlaylist(json); AIRTIME.playlist.fnOpenPlaylist(json);
var form = $('#smart-block-form'); var form = $('#smart-block-form');
if (json.result == "0") { if (json.result == "0") {
$('#sp-success-saved').text('Smart block saved'); $('#sp-success-saved').text($.i18n._('Smart block saved'));
$('#sp-success-saved').show(); $('#sp-success-saved').show();
//redraw library table so the length gets updated //redraw library table so the length gets updated
@ -553,7 +550,7 @@ function removeButtonCheck() {
function enableLoadingIcon() { function enableLoadingIcon() {
$("#side_playlist").block({ $("#side_playlist").block({
message: "Processing...", message: $.i18n._("Processing..."),
theme: true, theme: true,
allowBodyStretch: true, allowBodyStretch: true,
applyPlatformOpacityRules: false applyPlatformOpacityRules: false
@ -594,20 +591,20 @@ var criteriaTypes = {
}; };
var stringCriteriaOptions = { var stringCriteriaOptions = {
"0" : "Select modifier", "0" : $.i18n._("Select modifier"),
"contains" : "contains", "contains" : $.i18n._("contains"),
"does not contain" : "does not contain", "does not contain" : $.i18n._("does not contain"),
"is" : "is", "is" : $.i18n._("is"),
"is not" : "is not", "is not" : $.i18n._("is not"),
"starts with" : "starts with", "starts with" : $.i18n._("starts with"),
"ends with" : "ends with" "ends with" : $.i18n._("ends with")
}; };
var numericCriteriaOptions = { var numericCriteriaOptions = {
"0" : "Select modifier", "0" : $.i18n._("Select modifier"),
"is" : "is", "is" : $.i18n._("is"),
"is not" : "is not", "is not" : $.i18n._("is not"),
"is greater than" : "is greater than", "is greater than" : $.i18n._("is greater than"),
"is less than" : "is less than", "is less than" : $.i18n._("is less than"),
"is in the range" : "is in the range" "is in the range" : $.i18n._("is in the range")
}; };

View File

@ -65,12 +65,12 @@ var AIRTIME = (function(AIRTIME) {
oTable = historyTableDiv.dataTable( { oTable = historyTableDiv.dataTable( {
"aoColumns": [ "aoColumns": [
{"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */ {"sTitle": $.i18n._("Title"), "mDataProp": "title", "sClass": "his_title"}, /* Title */
{"sTitle": "Creator", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */ {"sTitle": $.i18n._("Creator"), "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
{"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */ {"sTitle": $.i18n._("Played"), "mDataProp": "played", "sClass": "his_artist"}, /* times played */
{"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */ {"sTitle": $.i18n._("Length"), "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
{"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */ {"sTitle": $.i18n._("Composer"), "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
{"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */ {"sTitle": $.i18n._("Copyright"), "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
], ],
"bProcessing": true, "bProcessing": true,

View File

@ -15,7 +15,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/', imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/', systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json', handlerUrl: baseUrl+'/Preference/server-browse/format/json',
title: 'Choose Storage Folder', title: $.i18n._('Choose Storage Folder'),
basePath: '', basePath: '',
requestMethod: 'POST', requestMethod: 'POST',
}); });
@ -35,7 +35,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/', imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/', systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json', handlerUrl: baseUrl+'/Preference/server-browse/format/json',
title: 'Choose Folder to Watch', title: $.i18n._('Choose Folder to Watch'),
basePath: '', basePath: '',
requestMethod: 'POST', requestMethod: 'POST',
}); });
@ -43,7 +43,7 @@ function setWatchedDirEvents() {
$('#storageFolder-ok').click(function(){ $('#storageFolder-ok').click(function(){
var url, chosen; 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"; url = baseUrl+"/Preference/change-stor-directory";
chosen = $('#storageFolder').val(); chosen = $('#storageFolder').val();
@ -72,7 +72,7 @@ function setWatchedDirEvents() {
function(json) { function(json) {
$("#watched-folder-section").empty(); $("#watched-folder-section").empty();
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>"); $("#watched-folder-section").append("<h2>"+$.i18n._("Manage Media Folders")+"</h2>");
$("#watched-folder-section").append(json.subform); $("#watched-folder-section").append(json.subform);
setWatchedDirEvents(); setWatchedDirEvents();
}); });
@ -84,7 +84,7 @@ function setWatchedDirEvents() {
}); });
$('.selected-item').find('.ui-icon-close').click(function(){ $('.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 row = $(this).parent();
var folder = row.find('#folderPath').text(); var folder = row.find('#folderPath').text();
@ -95,7 +95,7 @@ function setWatchedDirEvents() {
function(json) { function(json) {
$("#watched-folder-section").empty(); $("#watched-folder-section").empty();
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>"); $("#watched-folder-section").append("<h2>"+$.i18n._("Manage Media Folders")+"</h2>");
$("#watched-folder-section").append(json.subform); $("#watched-folder-section").append(json.subform);
setWatchedDirEvents(); setWatchedDirEvents();
}); });
@ -108,7 +108,7 @@ $(document).ready(function() {
setWatchedDirEvents(); setWatchedDirEvents();
$(".ui-icon-alert").qtip({ $(".ui-icon-alert").qtip({
content: { content: {
text: "This path is currently not accessible." text: $.i18n._("This path is currently not accessible.")
}, },
position:{ position:{
adjust: { adjust: {

View File

@ -93,13 +93,13 @@ function checkLiquidsoapStatus(){
} }
var html; var html;
if(status == "OK"){ if(status == "OK"){
html = '<div class="stream-status status-good"><h3>Connected to the streaming server</h3></div>'; html = '<div class="stream-status status-good"><h3>'+$.i18n._("Connected to the streaming server")+'</h3></div>';
}else if(status == "N/A"){ }else if(status == "N/A"){
html = '<div class="stream-status status-disabled"><h3>The stream is disabled</h3></div>'; html = '<div class="stream-status status-disabled"><h3>'+$.i18n._("The stream is disabled")+'</h3></div>';
}else if(status == "waiting"){ }else if(status == "waiting"){
html = '<div class="stream-status status-info"><h3>Getting information from the server...</h3></div>'; html = '<div class="stream-status status-info"><h3>'+$.i18n._("Getting information from the server...")+'</h3></div>';
}else{ }else{
html = '<div class="stream-status status-error"><h3>Can not connect to the streaming server</h3><p>'+status+'</p></div>'; html = '<div class="stream-status status-error"><h3>'+$.i18n._("Can not connect to the streaming server")+'</h3><p>'+status+'</p></div>';
} }
$("#s"+id+"Liquidsoap-error-msg-element").html(html); $("#s"+id+"Liquidsoap-error-msg-element").html(html);
} }
@ -250,7 +250,8 @@ function setupEventListeners() {
// qtip for help text // qtip for help text
$(".override_help_icon").qtip({ $(".override_help_icon").qtip({
content: { 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 <a target=\"_blank\" href=\"http://www.sourcefabric.org/en/airtime/manuals/\">Airtime manual</a>." 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 ")+"<a target=\"_blank\" href=\"http://www.sourcefabric.org/en/airtime/manuals/\">"+$.i18n._("Airtime manual")+"</a>."
}, },
hide: { hide: {
delay: 500, delay: 500,
@ -271,7 +272,7 @@ function setupEventListeners() {
$(".icecast_metadata_help_icon").qtip({ $(".icecast_metadata_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -292,7 +293,7 @@ function setupEventListeners() {
$("#auto_transition_help").qtip({ $("#auto_transition_help").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -313,7 +314,7 @@ function setupEventListeners() {
$("#auto_switch_help").qtip({ $("#auto_switch_help").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -334,7 +335,7 @@ function setupEventListeners() {
$(".stream_username_help_icon").qtip({ $(".stream_username_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -355,7 +356,7 @@ function setupEventListeners() {
$(".master_username_help_icon").qtip({ $(".master_username_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -375,12 +376,7 @@ function setupEventListeners() {
}) })
$('#stream_save').live('click', function(){ $('#stream_save').live('click', function(){
var confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the " 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.");
+ "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)) { if (confirm(confirm_pypo_restart_text)) {
var data = $('#stream_form').serialize(); var data = $('#stream_form').serialize();
var url = baseUrl+'/Preference/stream-setting'; var url = baseUrl+'/Preference/stream-setting';

View File

@ -61,7 +61,7 @@ $(document).ready(function() {
var ul, li; var ul, li;
ul = logoEl.find('.errors'); ul = logoEl.find('.errors');
li = $("<li/>").append("Image must be one of jpg, jpeg, png, or gif"); li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
//errors ul has already been created. //errors ul has already been created.
if (ul.length > 0) { if (ul.length > 0) {

View File

@ -53,7 +53,7 @@ function findHosts(request, callback) {
var noResult = new Array(); var noResult = new Array();
noResult[0] = new Array(); noResult[0] = new Array();
noResult[0]['value'] = $("#add_show_hosts_autocomplete").val(); 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; noResult[0]['index'] = null;
$.post(url, $.post(url,
@ -226,7 +226,7 @@ function setAddShowEvents() {
form.find(".airtime_auth_help_icon").qtip({ form.find(".airtime_auth_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -246,7 +246,7 @@ function setAddShowEvents() {
}); });
form.find(".custom_auth_help_icon").qtip({ form.find(".custom_auth_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -266,7 +266,7 @@ function setAddShowEvents() {
}); });
form.find(".stream_username_help_icon").qtip({ form.find(".stream_username_help_icon").qtip({
content: { 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: { hide: {
delay: 500, delay: 500,
@ -628,7 +628,7 @@ $(document).ready(function() {
//Alert the error and reload the page //Alert the error and reload the page
//this function is used to resolve concurrency issue //this function is used to resolve concurrency issue
function alertShowErrorAndReload(){ function alertShowErrorAndReload(){
alert("The show instance doesn't exist anymore!"); alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload(); window.location.reload();
} }

View File

@ -6,7 +6,7 @@
function scheduleRefetchEvents(json) { function scheduleRefetchEvents(json) {
if(json.show_error == true){ 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) { if(json.show_id) {
var dialog_id = parseInt($("#add_show_id").val(), 10); var dialog_id = parseInt($("#add_show_id").val(), 10);
@ -41,7 +41,7 @@ function openAddShowForm() {
function makeAddShowButton(){ function makeAddShowButton(){
$('.fc-header-left') $('.fc-header-left')
.append('<span class="fc-header-space"></span>') .append('<span class="fc-header-space"></span>')
.append('<span class="fc-button"><a href="#" class="add-button"><span class="add-icon"></span>Show</a></span>') .append('<span class="fc-button"><a href="#" class="add-button"><span class="add-icon"></span>'+$.i18n._("Show")+'</a></span>')
.find('span.fc-button:last > a') .find('span.fc-button:last > a')
.click(function(){ .click(function(){
openAddShowForm(); openAddShowForm();
@ -154,12 +154,12 @@ function viewDisplay( view ) {
var calendarEl = this; var calendarEl = this;
var select = $('<select class="schedule_change_slots input_select"/>') var select = $('<select class="schedule_change_slots input_select"/>')
.append('<option value="1">1m</option>') .append('<option value="1">'+$.i18n._("1m").'</option>')
.append('<option value="5">5m</option>') .append('<option value="5">'+$.i18n._("5m").'</option>')
.append('<option value="10">10m</option>') .append('<option value="10">'+$.i18n._("10m").'</option>')
.append('<option value="15">15m</option>') .append('<option value="15">'+$.i18n._("15m").'</option>')
.append('<option value="30">30m</option>') .append('<option value="30">'+$.i18n._("30m").'</option>')
.append('<option value="60">60m</option>') .append('<option value="60">'+$.i18n._("60m").'</option>')
.change(function(){ .change(function(){
var slotMin = $(this).val(); var slotMin = $(this).val();
var opt = view.calendar.options; var opt = view.calendar.options;
@ -261,7 +261,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) { if (event.soundcloud_id === -1) {
$(element) $(element)
.find(".fc-event-time") .find(".fc-event-time")
.before('<span id="'+event.id+'" title="Show is empty" class="small-icon show-empty"></span>'); .before('<span id="'+event.id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
} else if (event.soundcloud_id > 0) { } else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) { } else if (event.soundcloud_id === -2) {
@ -275,7 +275,7 @@ function eventRender(event, element, view) {
if (event.soundcloud_id === -1) { if (event.soundcloud_id === -1) {
$(element) $(element)
.find(".fc-event-title") .find(".fc-event-title")
.after('<span id="'+event.id+'" title="Show is empty" class="small-icon show-empty"></span>'); .after('<span id="'+event.id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
} else if (event.soundcloud_id > 0) { } else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) { } else if (event.soundcloud_id === -2) {
@ -424,7 +424,7 @@ function addQtipToSCIcons(ele){
if($(ele).hasClass("progress")){ if($(ele).hasClass("progress")){
$(ele).qtip({ $(ele).qtip({
content: { content: {
text: "Uploading in progress..." text: $.i18n.("Uploading in progress...")
}, },
position:{ position:{
adjust: { adjust: {
@ -442,13 +442,13 @@ function addQtipToSCIcons(ele){
}else if($(ele).hasClass("soundcloud")){ }else if($(ele).hasClass("soundcloud")){
$(ele).qtip({ $(ele).qtip({
content: { content: {
text: "Retreiving data from the server...", text: $.i18n.("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "file"}), data: ({format: "json", id : id, type: "file"}),
success: function(json, status){ 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")){ }else if($(ele).hasClass("sc-error")){
$(ele).qtip({ $(ele).qtip({
content: { content: {
text: "Retreiving data from the server...", text: $.i18n.("Retreiving data from the server..."),
ajax: { ajax: {
url: baseUrl+"/Library/get-upload-to-soundcloud-status", url: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post", type: "post",
data: ({format: "json", id : id, type: "show"}), data: ({format: "json", id : id, type: "show"}),
success: function(json, status){ success: function(json, status){
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+ this.set('content.text', $.i18n.("There was error while uploading to soundcloud.")+"<br>"+$.i18n._("Error code: ")+json.error_code+
"<br>"+"Error msg: "+json.error_msg+"<br>"); "<br>"+$.i18n._("Error msg: ")+json.error_msg+"<br>");
} }
} }
}, },
@ -495,7 +495,7 @@ function addQtipToSCIcons(ele){
}else if ($(ele).hasClass("show-empty")){ }else if ($(ele).hasClass("show-empty")){
$(ele).qtip({ $(ele).qtip({
content: { content: {
text: "This show has no scheduled content." text: $.i18n._("This show has no scheduled content.")
}, },
position:{ position:{
adjust: { adjust: {
@ -548,7 +548,7 @@ function checkEmptyShowStatus(e) {
//Alert the error and reload the page //Alert the error and reload the page
//this function is used to resolve concurrency issue //this function is used to resolve concurrency issue
function alertShowErrorAndReload(){ function alertShowErrorAndReload(){
alert("The show instance doesn't exist anymore!"); alert($.i18n.("The show instance doesn't exist anymore!"));
window.location.reload(); window.location.reload();
} }

View File

@ -22,7 +22,7 @@ function checkShowLength(json) {
if (percent > 100){ if (percent > 100){
$("#show_time_warning") $("#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(); .show();
} }
else { else {
@ -33,7 +33,7 @@ function checkShowLength(json) {
} }
function confirmCancelShow(show_instance_id){ function confirmCancelShow(show_instance_id){
if (confirm('Cancel Current Show?')) { if (confirm($.i18n._('Cancel Current Show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show"; var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
@ -46,7 +46,7 @@ function confirmCancelShow(show_instance_id){
} }
function confirmCancelRecordedShow(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"; var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({ $.ajax({
url: url, url: url,
@ -165,7 +165,7 @@ function buildScheduleDialog (json) {
close: closeDialog, close: closeDialog,
buttons: [ buttons: [
{ {
text: "Ok", text: $.i18n._("Ok"),
"class": "btn", "class": "btn",
click: function() { click: function() {
$(this).dialog("close"); $(this).dialog("close");
@ -207,14 +207,14 @@ function buildContentDialog (json){
dialog.dialog({ dialog.dialog({
autoOpen: false, autoOpen: false,
title: "Contents of Show \"" + json.showTitle + "\"", title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
width: width, width: width,
height: height, height: height,
modal: true, modal: true,
close: closeDialog, close: closeDialog,
buttons: [ buttons: [
{ {
text: "Ok", text: $.i18n._("Ok"),
"class": "btn", "class": "btn",
click: function() { click: function() {
dialog.remove(); dialog.remove();
@ -283,7 +283,7 @@ function createFullCalendar(data){
//Alert the error and reload the page //Alert the error and reload the page
//this function is used to resolve concurrency issue //this function is used to resolve concurrency issue
function alertShowErrorAndReload(){ function alertShowErrorAndReload(){
alert("The show instance doesn't exist anymore!"); alert($.i18n._("The show instance doesn't exist anymore!"));
window.location.reload(); window.location.reload();
} }
@ -324,7 +324,7 @@ $(document).ready(function() {
if (oItems.clear !== undefined) { if (oItems.clear !== undefined) {
callback = function() { callback = function() {
if (confirm("Remove all content?")) { if (confirm($.i18n._("Remove all content?"))) {
$.post(oItems.clear.url, {format: "json", id: data.id}, function(json){ $.post(oItems.clear.url, {format: "json", id: data.id}, function(json){
scheduleRefetchEvents(json); scheduleRefetchEvents(json);
}); });

View File

@ -283,7 +283,7 @@ var AIRTIME = (function(AIRTIME){
mod.fnRemove = function(aItems) { mod.fnRemove = function(aItems) {
mod.disableUI(); mod.disableUI();
if (confirm("Delete selected item(s)?")) { if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"/showbuilder/schedule-remove", $.post( baseUrl+"/showbuilder/schedule-remove",
{"items": aItems, "format": "json"}, {"items": aItems, "format": "json"},
mod.fnItemCallback mod.fnItemCallback
@ -360,17 +360,17 @@ var AIRTIME = (function(AIRTIME){
"aoColumns": [ "aoColumns": [
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"}, /* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"}, /* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
/* starts */ {"mDataProp": "starts", "sTitle": "Start", "sClass": "sb-starts", "sWidth": "60px"}, /* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
/* ends */ {"mDataProp": "ends", "sTitle": "End", "sClass": "sb-ends", "sWidth": "60px"}, /* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
/* runtime */ {"mDataProp": "runtime", "sTitle": "Duration", "sClass": "library_length sb-length", "sWidth": "65px"}, /* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
/* title */ {"mDataProp": "title", "sTitle": "Title", "sClass": "sb-title"}, /* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
/* creator */ {"mDataProp": "creator", "sTitle": "Creator", "sClass": "sb-creator"}, /* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
/* album */ {"mDataProp": "album", "sTitle": "Album", "sClass": "sb-album"}, /* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
/* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"}, /* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
/* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"}, /* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
/* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"}, /* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
/* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"}, /* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
/* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"} /* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
], ],
"bJQueryUI": true, "bJQueryUI": true,
@ -527,7 +527,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]); $node = $(nRow.children[0]);
$node.html(''); $node.html('');
sSeparatorHTML = '<span>Show Empty</span>'; sSeparatorHTML = '<span>'+$.i18n._("Show Empty")+'</span>';
cl = cl + " sb-empty odd"; cl = cl + " sb-empty odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1); fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@ -539,7 +539,7 @@ var AIRTIME = (function(AIRTIME){
$node = $(nRow.children[0]); $node = $(nRow.children[0]);
$node.html(''); $node.html('');
sSeparatorHTML = '<span>Recording From Line In</span>'; sSeparatorHTML = '<span>'+$.i18n._("Recording From Line In")+'</span>';
cl = cl + " sb-record odd"; cl = cl + " sb-record odd";
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1); fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
@ -554,7 +554,7 @@ var AIRTIME = (function(AIRTIME){
if (!isAudioSupported(aData.mime)) { if (!isAudioSupported(aData.mime)) {
$image.html('<span class="ui-icon ui-icon-locked"></span>'); $image.html('<span class="ui-icon ui-icon-locked"></span>');
} else { } else {
$image.html('<img title="Track preview" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>') $image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'/css/images/icon_audioclip.png"></img>')
.click(function() { .click(function() {
open_show_preview(aData.instance, aData.pos); open_show_preview(aData.instance, aData.pos);
return false; return false;
@ -565,7 +565,7 @@ var AIRTIME = (function(AIRTIME){
$image.html('<span class="ui-icon ui-icon-alert"></span>'); $image.html('<span class="ui-icon ui-icon-alert"></span>');
$image.find(".ui-icon-alert").qtip({ $image.find(".ui-icon-alert").qtip({
content: { 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: { style: {
classes: "ui-tooltip-dark" classes: "ui-tooltip-dark"
@ -877,7 +877,7 @@ var AIRTIME = (function(AIRTIME){
//can't add items outside of shows. //can't add items outside of shows.
if (prev.find("td:first").hasClass("dataTables_empty") if (prev.find("td:first").hasClass("dataTables_empty")
|| prev.length === 0) { || prev.length === 0) {
alert("Cannot schedule outside a show."); alert($.i18n._("Cannot schedule outside a show."));
ui.item.remove(); ui.item.remove();
return; return;
} }
@ -932,10 +932,10 @@ var AIRTIME = (function(AIRTIME){
} }
if (selected.length === 1) { if (selected.length === 1) {
message = "Moving "+selected.length+" Item."; message = $.i18n._("Moving ")+selected.length+$.i18n._(" Item.");
} }
else { else {
message = "Moving "+selected.length+" Items."; message = $.i18n._("Moving ")+selected.length+$.i18n._(" Items.");
} }
draggingContainer = $('<tr/>') draggingContainer = $('<tr/>')
@ -983,28 +983,28 @@ var AIRTIME = (function(AIRTIME){
$menu = $("<div class='btn-toolbar'/>"); $menu = $("<div class='btn-toolbar'/>");
$menu.append("<div class='btn-group'>" + $menu.append("<div class='btn-group'>" +
"<button class='btn btn-small dropdown-toggle' id='timeline-select' data-toggle='dropdown'>" + "<button class='btn btn-small dropdown-toggle' id='timeline-select' data-toggle='dropdown'>" +
"Select <span class='caret'></span>" + $.i18n._("Select")+" <span class='caret'></span>" +
"</button>" + "</button>" +
"<ul class='dropdown-menu'>" + "<ul class='dropdown-menu'>" +
"<li id='timeline-sa'><a href='#'>Select all</a></li>" + "<li id='timeline-sa'><a href='#'>"+$.i18n._("Select all")+"</a></li>" +
"<li id='timeline-sn'><a href='#'>Select none</a></li>" + "<li id='timeline-sn'><a href='#'>"+$.i18n._("Select none")+"</a></li>" +
"</ul>" + "</ul>" +
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small' disabled='disabled'>" + "<button title='"+$.i18n._("Remove overbooked tracks")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-cut'></i></button></div>") "<i class='icon-white icon-cut'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" + "<button title='"+$.i18n._("Remove selected scheduled items")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>"); "<i class='icon-white icon-trash'></i></button></div>");
//if 'Add/Remove content' was chosen from the context menu //if 'Add/Remove content' was chosen from the context menu
//in the Calendar do not append these buttons //in the Calendar do not append these buttons
if ($(".ui-dialog-content").length === 0) { if ($(".ui-dialog-content").length === 0) {
$menu.append("<div class='btn-group'>" + $menu.append("<div class='btn-group'>" +
"<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" + "<button title='"+$.i18n._("Jump to the current playing track")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>") "<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" + "<button title='"+$.i18n._("Cancel current show")+"' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>"); "<i class='icon-white icon-ban-circle'></i></button></div>");
} }
@ -1019,7 +1019,7 @@ var AIRTIME = (function(AIRTIME){
.click(function() { .click(function() {
var $tr, var $tr,
data, data,
msg = 'Cancel Current Show?'; msg = $.i18n._('Cancel Current Show?');
if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) { if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
return; return;
@ -1031,7 +1031,7 @@ var AIRTIME = (function(AIRTIME){
data = $tr.data("aData"); data = $tr.data("aData");
if (data.record === true) { if (data.record === true) {
msg = 'Stop recording current show?'; msg = $.i18n._('Stop recording current show?');
} }
if (confirm(msg)) { if (confirm(msg)) {

View File

@ -15,7 +15,7 @@ AIRTIME = (function(AIRTIME) {
timeStartId = "#sb_time_start", timeStartId = "#sb_time_start",
dateEndId = "#sb_date_end", dateEndId = "#sb_date_end",
timeEndId = "#sb_time_end", timeEndId = "#sb_time_end",
$toggleLib = $("<a id='sb_edit' class='btn btn-small' href='#' title='Open library to add or remove content'>Add / Remove Content</a>"), $toggleLib = $("<a id='sb_edit' class='btn btn-small' href='#' title='"+$.i18n._("Open library to add or remove content")+"'>"+$.i18n._("Add / Remove Content")+"</a>"),
$libClose = $('<a />', { $libClose = $('<a />', {
"class": "close-round", "class": "close-round",
"href": "#", "href": "#",

View File

@ -2,7 +2,7 @@ function generatePartitions(partitions){
var rowTemplate = var rowTemplate =
'<tr class="partition-info">'+ '<tr class="partition-info">'+
'<td><span class="strong">Disk #%s</span>'+ '<td><span class="strong">'+$.i18n._("Disk")+' #%s</span>'+
'<ul id="watched-dir-list-%s">'+ '<ul id="watched-dir-list-%s">'+
'</ul>'+ '</ul>'+
'</td>'+ '</td>'+
@ -12,7 +12,7 @@ function generatePartitions(partitions){
'<div class="diskspace" style="width:%s%%;">'+ '<div class="diskspace" style="width:%s%%;">'+
'</div>'+ '</div>'+
'</div>'+ '</div>'+
'<div>%s%% in use</div>'+ '<div>%s%% '+$.i18n._("in use")+'</div>'+
'</td>'+ '</td>'+
'</tr>'; '</tr>';

View File

@ -45,16 +45,16 @@ function rowCallback( nRow, aData, iDisplayIndex ){
if ( aData['type'] == "A" ) if ( aData['type'] == "A" )
{ {
$('td:eq(3)', nRow).html( 'Admin' ); $('td:eq(3)', nRow).html( $.i18n._('Admin') );
} else if ( aData['type'] == "H" ) } else if ( aData['type'] == "H" )
{ {
$('td:eq(3)', nRow).html( 'DJ' ); $('td:eq(3)', nRow).html( $.i18n._('DJ') );
} else if ( aData['type'] == "G" ) } else if ( aData['type'] == "G" )
{ {
$('td:eq(3)', nRow).html( 'Guest' ); $('td:eq(3)', nRow).html( $.i18n._('Guest') );
} else if ( aData['type'] == "P" ) } else if ( aData['type'] == "P" )
{ {
$('td:eq(3)', nRow).html( 'Program Manager' ); $('td:eq(3)', nRow).html( $.i18n._('Program Manager') );
} }
return nRow; return nRow;