Polylang and Responsive Theme Calendar
-
Hi,
First of all, thanks for the great plugin!
I have an issue with an Event Calendar in my responsive theme (Churchope).
More specifically, I have a bilingual site (En/Fr), English being the default one. When I load my Event Calendar the first time the calendar displays correctly in the appropriate language.
If I go to the next month in the English version, the correct month (December 2013) / weekdays (Mon Tue Wed …) are displayed on the calendar.
If I switch the language to French calendar loads in the correct language (novembre 2013 – lun mar mer …). Now my issue occurs when I click on the next month button (“décembre >”). The whole calendar switched back to English even though the rest of the page remain to be in French.
When I change the default WP language the problem is identical but the languages are reversed. (French calendar OK, Eng loads OK but switches back to Fr)
I believe this is the code that’s not picking up the language settings.
jQuery('#previous_month').live('click', function(){ sendCalendarData(jQuery(this), 'previous'); return false; }); jQuery('#next_month').live('click', function(){ sendCalendarData(jQuery(this), 'next'); return false; }); function sendCalendarData(obj, month_to_show){ var form = obj.closest('form'); var form_data = {}; if(form && form.length) { var month = parseInt(jQuery('#calendar_month', form).val(), 10); var year = parseInt(jQuery('#calendar_year', form).val(), 10); var new_month = new_year = 0; if(month_to_show == 'previous') { if(month == 1){ new_month = 12; new_year = year - 1; } else{ new_month = month - 1; new_year = year; } } else{ if(month == 12){ new_month = 1; new_year = year + 1; } else{ new_month = month + 1; new_year = year; } } form_data.calendar = true; form_data.month = new_month; form_data.year = new_year; form_data.layout = jQuery('#calendar_layout', form).val(); form_data.category = jQuery('#calendar_category', form).val(); form_data.from = jQuery('#calendar_from', form).val(); form_data.to = jQuery('#calendar_to', form).val(); form_data.action = 'calendar_walker'; jQuery.ajax({ type: "POST", url: ThemeData.admin_url, data: form_data, dataType: 'json', success:function(response) { if(response && typeof response == 'object' ){ form.parents('.events_calendar').html(response.html); pushToHistory(response.html); } } }); } }Any tips how to remedy the issue?
Thank you!
The topic ‘Polylang and Responsive Theme Calendar’ is closed to new replies.