The language of the date picker is being determined by a 3rd Party HTML5 library.
If a language you need is supported in this library, and if the current page has this language locale, then this language will be aplied.
If that language is not supported by this library, then the calendar will be in English.
I tested setting Italian as the default site language on my local Test Site, and it seems that, unfortunately, this library does not currently have Italian available in the Date Picker.
Let me know if you test, if your Site is already in Italian as main Site language and if your Date Picker somehow already is pulling the Italian translations for it.
I will certainly speak with our developers to see if we have any kind of a custom workaround to send you what you could try, or if there is a chance for them to add Italian translation somehow for the Date Picker.
If we find a solution soon, I will make sure to send it to you.
I spoke with our developers and we found a custom workaround we have from before, I will share this with you if you wish to try it.
So, as mentioned, we do not have a built-in way to translate the Date Picker;
in the case when your language is not automatically picked up and you have the Page locale in WP correctly set; that means our 3rd Party HTML5 library we use for this does not have this language supported, thus it reverts to default English translation for the Date Picker.
Unfortunately, the date picker needs to be changed manually through our code. Our developers will include a different date picker in the future, but at the moment you'll need to follow these instructions:
This is an example for German/
1. Open ../wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.funcs.js and add this code under the comments "Apply datetimepicker" around line 147:
moment.locale('de', {
months : ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],
monthsShort : ["jan", "feb", "mär", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "dez"],
weekdaysMin : ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
week : {
dow : 1 // Monday is the first day of the week
}});
Then, below that find this line of code around line 169:
The last step is to go to main settings of wpDataTables, under Custom JS and CSS tab, and disable the "Use minified wpDataTables Javascript" check-box.
That was an example for the German language, but for Italian, you would need to modify it accordingly for your specific language needs.
Please be advised, this is a custom solution, our Support only provides the idea to get you started, we are unable to cover troubleshooting for it.
Hello, we are very happy with the plugin!
Is there a ready translation file/template for the javascript calendar used for date filter?
How can we translate that to Italian?
Let us know
Thanks
Alessandro
HI Alessandro,
The language of the date picker is being determined by a 3rd Party HTML5 library.
If a language you need is supported in this library, and if the current page has this language locale, then this language will be aplied.
If that language is not supported by this library, then the calendar will be in English.
I tested setting Italian as the default site language on my local Test Site, and it seems that, unfortunately, this library does not currently have Italian available in the Date Picker.
Let me know if you test, if your Site is already in Italian as main Site language and if your Date Picker somehow already is pulling the Italian translations for it.
I will certainly speak with our developers to see if we have any kind of a custom workaround to send you what you could try, or if there is a chance for them to add Italian translation somehow for the Date Picker.
If we find a solution soon, I will make sure to send it to you.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hello again Alessandro,
I spoke with our developers and we found a custom workaround we have from before, I will share this with you if you wish to try it.
So, as mentioned, we do not have a built-in way to translate the Date Picker;
in the case when your language is not automatically picked up and you have the Page locale in WP correctly set; that means our 3rd Party HTML5 library we use for this does not have this language supported, thus it reverts to default English translation for the Date Picker.
Unfortunately, the date picker needs to be changed manually through our code. Our developers will include a different date picker in the future, but at the moment you'll need to follow these instructions:
This is an example for German/
1. Open ../wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.funcs.js and add this code under the comments "Apply datetimepicker" around line 147:
Then, below that find this line of code around line 169:
And modify it to look like this (add "locale: 'de' "):
Do not forget to add a comma ( , ) after " useCurrent: false " (see code above). If you forget that, this will not work.
Then, do the same for around line 183 (add "locale: 'de' "):
Again, do not forget to add a comma ( , ) after " useCurrent: false " (see code above). If you forget that, this will not work.
2. Open ../wp-content/plugins/wpdatatables/source/class.wdttools.php and around line 1469 add the following line of code:
So it should look like this in the end:
This also changes the datepicker starting day, so the week starts from Monday, not Sunday.
3. Open this file:
wp-content/plugins/wpdatatables/assets/js/wpdatatables/wdt.frontend.min.js
Since this is a minified file, you have to seach for the following line of code:
and change it to look like this:
The last step is to go to main settings of wpDataTables, under Custom JS and CSS tab, and disable the "Use minified wpDataTables Javascript" check-box.
That was an example for the German language, but for Italian, you would need to modify it accordingly for your specific language needs.
Please be advised, this is a custom solution, our Support only provides the idea to get you started, we are unable to cover troubleshooting for it.
I hope that helps.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
We applied your edit and now we have the italian calendar translation as expected!
Thanks for your great support!
Alessandro