CC-5335 : I18N: Calendar picker strings are not translated.

loading the same strings as the jquery calendar.
This commit is contained in:
Naomi Aro 2013-09-24 11:47:20 +02:00
parent 59f6578e2e
commit 71001480d2
4 changed files with 28 additions and 31 deletions

View File

@ -30,6 +30,21 @@ var i18n_months = [
$.i18n._("December")
];
var i18n_months_short = [
$.i18n._("Jan"),
$.i18n._("Feb"),
$.i18n._("Mar"),
$.i18n._("Apr"),
$.i18n._("May"),
$.i18n._("Jun"),
$.i18n._("Jul"),
$.i18n._("Aug"),
$.i18n._("Sep"),
$.i18n._("Oct"),
$.i18n._("Nov"),
$.i18n._("Dec")
];
var i18n_days_short = [
$.i18n._("Su"),
$.i18n._("Mo"),

View File

@ -466,6 +466,13 @@ var AIRTIME = (function(AIRTIME) {
}
];
//set the locale names for the bootstrap calendar.
$.fn.datetimepicker.dates = {
daysMin: i18n_days_short,
months: i18n_months,
monthsShort: i18n_months_short
};
$historyContentDiv = $("#history_content");

View File

@ -44,6 +44,9 @@
constructor: DateTimePicker,
init: function(element, options) {
dates = $.fn.datetimepicker.dates;
var icon;
if (!(options.pickTime || options.pickDate))
throw new Error('Must choose at least one picker');
@ -340,7 +343,7 @@
var dowCnt = this.weekStart;
var html = $('<tr>');
while (dowCnt < this.weekStart + 7) {
html.append('<th class="dow">' + dates[this.language].daysMin[(dowCnt++) % 7] + '</th>');
html.append('<th class="dow">' + dates.daysMin[(dowCnt++) % 7] + '</th>');
}
this.widget.find('.datepicker-days thead').append(html);
},
@ -349,7 +352,7 @@
var html = '';
var i = 0
while (i < 12) {
html += '<span class="month">' + dates[this.language].monthsShort[i++] + '</span>';
html += '<span class="month">' + dates.monthsShort[i++] + '</span>';
}
this.widget.find('.datepicker-months td').append(html);
},
@ -373,7 +376,7 @@
this.widget.find('.datepicker-years').find('.disabled').removeClass('disabled');
this.widget.find('.datepicker-days th:eq(1)').text(
dates[this.language].months[month] + ' ' + year);
dates.months[month] + ' ' + year);
var prevMonth = UTCDate(year, month-1, 28, 0, 0, 0, 0);
var day = DPGlobal.getDaysInMonth(
@ -1103,7 +1106,6 @@
$.fn.datetimepicker.Constructor = DateTimePicker;
var dpgId = 0;
var dates = $.fn.datetimepicker.dates = {
en: {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
@ -1112,7 +1114,6 @@
"July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"]
}
};
var dateFormatComponents = {

File diff suppressed because one or more lines are too long