Translate Date Input field

To add the localization to Grand Restaurant theme’s date input, Please copy below code and paste it at the end of theme main function file (/wp-content/themes/grandrestaurant/functions.php)

<?php add_filter( 'wp_footer' , 'grandrestaurant_localize_datepicker' ); 
function grandrestaurant_localize_datepicker() { ?>
<script>
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 } ?>

Above code is example of French translation for date input.

How to translate .po file using Poedit Application

Poedit application is the popular application uses to edit po file translation and it’s free. Click here to download Poedit application.

Now download and install Poedit application. Open language file you want to translate for example en_US.po You will find all English string in Source Text box.

Select text string you want to translate, add your translation text to “Translation” field. Once you finish translating. Save the file and it will automatically compiled to .mo file.