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

@ -143,24 +143,24 @@ function updatePlaybar(){
}
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
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
$('#current').text(currentSong.name+",");
}else{
if (master_dj_on_air) {
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 {
$('#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) {
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 {
$('#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 {
$('#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));
}
/* 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);

View file

@ -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.<br/>Please upgrade to " + link;
msg = $.i18n._("This version will soon be obsolete.")+"<br/>"+$.i18n._("Please upgrade to ") + link;
} 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;