Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
/**
 * Add the datepicker translation by overriding the English one
 */
function woffice_calendar_translation() {
	$data = '
		/*
         * Calendar translation
         */
        ;(function($){
            $.fn.datepicker.dates[\'en\'].days           = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"];
            $.fn.datepicker.dates[\'en\'].months         = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"];
            $.fn.datepicker.dates[\'en\'].daysShort      = ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."];
            $.fn.datepicker.dates[\'en\'].daysMin        = ["d", "l", "ma", "me", "j", "v", "s"];
            $.fn.datepicker.dates[\'en\'].months         = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"];
            $.fn.datepicker.dates[\'en\'].monthsShort    = ["janv.", "févr.", "mars", "avril", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."];
            $.fn.datepicker.dates[\'en\'].today          = "Aujourd\'hui";
            $.fn.datepicker.dates[\'en\'].monthsTitle    = "Mois";
            $.fn.datepicker.dates[\'en\'].clear          = "Effacer";
            $.fn.datepicker.dates[\'en\'].weekStart      = 1;
            $.fn.datepicker.dates[\'en\'].format         = "dd/mm/yyyy";
        }(jQuery));
	
	';

	wp_add_inline_script( 'woffice-projects-datepicker', $data);
}
add_action('wp_enqueue_scripts', 'woffice_calendar_translation', 100);

...