From 0eda6a0b003c84729176be8e069b7e5ab9d9f43c Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 29 Aug 2012 20:20:37 +0200 Subject: Internationalized fullcalendar. --- .../default/event_calendar/full_calendar_view.php | 67 ++++++++++++++++------ 1 file changed, 49 insertions(+), 18 deletions(-) (limited to 'views') diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index 7a40c6da9..adbb8a359 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -152,25 +152,56 @@ handleViewDisplay = function(view) { //$(".fc-widget-content[data-date='20120105']") } -$(document).ready(function() { - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - month: , - ignoreTimezone: true, - editable: true, - slotMinutes: 15, - eventRender: handleEventRender, - eventDrop: handleEventDrop, - eventClick: handleEventClick, - dayClick: handleDayClick, - events: handleGetEvents, - viewDisplay: handleViewDisplay, +fullcalendarInit = function() { + + var loadFullCalendar = function() { + var locale = $.datepicker.regional[elgg.config.language]; + if (!locale) { + locale = $.datepicker.regional['']; + } + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + month: , + ignoreTimezone: true, + editable: true, + slotMinutes: 15, + eventRender: handleEventRender, + eventDrop: handleEventDrop, + eventClick: handleEventClick, + dayClick: handleDayClick, + events: handleGetEvents, + viewDisplay: handleViewDisplay, + + isRTL: locale.isRTL, + firstDay: locale.firstDay, + monthNames: locale.monthNames, + monthNamesShort: locale.monthNamesShort, + dayNames: locale.dayNames, + dayNamesShort: locale.dayNamesShort, + buttonText: { + today: locale.currentText, + month: elgg.echo('event_calendar:month_label'), + week: elgg.echo('event_calendar:week_label'), + day: elgg.echo('event_calendar:day_label') + } + }); + } + + elgg.get({ + url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js', + dataType: "script", + cache: true, + success: loadFullCalendar, + error: loadFullCalendar, // english language is already loaded. }); -}); +} + +elgg.register_hook_handler('init', 'system', fullcalendarInit); +
-- cgit v1.2.3