So we took “fr” translation from here
https://github.com/uxsolutions/bootstrap-datepicker/tree/master/js/locales
And go to js/main.js and Search datepicker
You will see something like
if ( $( ‘.datepicker’ ).length > 0 ) { $( ‘.datepicker’ ).datepicker( ).on( ‘changeDate’, function( ) { $( this ).datepicker( ‘hide’ ); } ); }
Replace this with this one
First, add the locale’s code before the initialization. and in the initialization add an option like language: ‘fr’
.datepicker({language: ‘fr’} )
The whole code will look like this.
$.fn.datepicker.dates[‘fr’] = { days: [“dimanche”, “lundi”, “mardi”, “mercredi”, “jeudi”, “vendredi”, “samedi”], daysShort: [“dim.”, “lun.”, “mar.”, “mer.”, “jeu.”, “ven.”, “sam.”], daysMin: [“d”, “l”, “ma”, “me”, “j”, “v”, “s”], months: [“janvier”, “février”, “mars”, “avril”, “mai”, “juin”, “juillet”, “août”, “septembre”, “octobre”, “novembre”, “décembre”], monthsShort: [“janv.”, “févr.”, “mars”, “avril”, “mai”, “juin”, “juil.”, “août”, “sept.”, “oct.”, “nov.”, “déc.”], today: “Aujourd’hui”, monthsTitle: “Mois”, clear: “Effacer”, weekStart: 1, format: “dd/mm/yyyy” }; if ( $( ‘.datepicker’ ).length > 0 ) { $( ‘.datepicker’ ).datepicker({language: ‘fr’} ).on( ‘changeDate’, function( ) { $( this ).datepicker( ‘hide’ ); } ); }
More details about translation please follow this. https://bootstrap-datepicker.readthedocs.io/en/stable/i18n.html
Hope it helps 🙂
Thanks