Created
February 18, 2016 11:24
-
-
Save rynaldos-zz/b01429ebe18836f065c2 to your computer and use it in GitHub Desktop.
Localizing jQuery UI Datepicker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wp_footer' , 'rc_localize_datepicker' ); | |
/** | |
* Localize datepicker fields | |
* | |
* @access public | |
* @since 1.0 | |
* @return void | |
*/ | |
function rc_localize_datepicker() { | |
?> | |
<script> | |
/* French initialisation for the jQuery UI date picker plugin. */ | |
/* Written by Keith Wood (kbwood{at}iinet.com.au), | |
Stéhane Nahmani ([email protected]), | |
Stéphane Raimbault <[email protected]> */ | |
jQuery(function($){ | |
$.datepicker.regional['fr'] = { | |
closeText: 'Fermer', | |
prevText: 'Précédent', | |
nextText: 'Suivant', | |
currentText: 'Aujourd\'hui', | |
monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', | |
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], | |
monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin', | |
'Juil.','Août','Sept.','Oct.','Nov.','Déc.'], | |
dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], | |
dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], | |
dayNamesMin: ['D','L','M','M','J','V','S'], | |
weekHeader: 'Sem.', | |
dateFormat: 'dd/mm/yy', | |
firstDay: 1, | |
isRTL: false, | |
showMonthAfterYear: false, | |
yearSuffix: ''}; | |
$.datepicker.setDefaults($.datepicker.regional['fr']); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment