Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Created February 18, 2016 11:24
Show Gist options
  • Save rynaldos-zz/b01429ebe18836f065c2 to your computer and use it in GitHub Desktop.
Save rynaldos-zz/b01429ebe18836f065c2 to your computer and use it in GitHub Desktop.
Localizing jQuery UI Datepicker
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