var i18n = { cancel: gettext('Cancel'), clear: gettext('Clear'), done: gettext('Ok'), previousMonth: '‹', nextMonth: '›', months: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], monthsShort: [], weekdays: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], weekdaysShort: [], weekdaysAbbrev: [] }; i18n.months.forEach(function(val, index) { i18n.months[index] = gettext(val); i18n.monthsShort[index] = i18n.months[index].substring(0,3); }); i18n.weekdays.forEach(function(val, index) { i18n.weekdays[index] = gettext(val); i18n.weekdaysShort[index] = i18n.weekdays[index].substring(0,3); i18n.weekdaysAbbrev[index] = i18n.weekdays[index][0]; }); $(document).ready(function() { $('.sidenav').sidenav(); $('.fixed-action-btn').floatingActionButton(); $('.datepicker').datepicker({ format: 'yyyy-mm-dd', i18n: i18n }); });