CC-1960: Internationalize Airtime / Support translations

-enabled i18n for datatables, colVis, columnFilter, and fullCalendar
-fixed typos in full-calendar-functions.js
This commit is contained in:
denise 2012-11-20 16:40:02 -05:00
parent 57fdab0ddf
commit f40d1f8dd4
10 changed files with 142 additions and 32 deletions

View file

@ -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>',

View file

@ -154,12 +154,12 @@ function viewDisplay( view ) {
var calendarEl = this;
var select = $('<select class="schedule_change_slots input_select"/>')
.append('<option value="1">'+$.i18n._("1m").'</option>')
.append('<option value="5">'+$.i18n._("5m").'</option>')
.append('<option value="10">'+$.i18n._("10m").'</option>')
.append('<option value="15">'+$.i18n._("15m").'</option>')
.append('<option value="30">'+$.i18n._("30m").'</option>')
.append('<option value="60">'+$.i18n._("60m").'</option>')
.append('<option value="1">'+$.i18n._("1m")+'</option>')
.append('<option value="5">'+$.i18n._("5m")+'</option>')
.append('<option value="10">'+$.i18n._("10m")+'</option>')
.append('<option value="15">'+$.i18n._("15m")+'</option>')
.append('<option value="30">'+$.i18n._("30m")+'</option>')
.append('<option value="60">'+$.i18n._("60m")+'</option>')
.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.")+"<br>"+$.i18n._("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>"+$.i18n._("Error msg: ")+json.error_msg+"<br>");
}
}
@ -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();
}

View file

@ -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,

View file

@ -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>',
});

View file

@ -30,4 +30,8 @@ The new _fnDomBaseButton looks like this:
return nButton;
},
--------------------------------------------------------------------------------
* Line 96 has changed
- "buttonText": "Show / hide columns",
+ "buttonText": $.i18n._("Show / hide columns"),

View file

@ -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

View file

@ -585,7 +585,7 @@
sRangeSeparator: "~",
iFilteringDelay: 500,
aoColumns: null,
sRangeFormat: "From {from} to {to}"
sRangeFormat: $.i18n._("From {from} to {to}")
};
properties = $.extend(defaults, options);