Forums › Forums › Search & Filter Pro › Date picker not automatically translated
Tagged: date picker
- This topic has 4 replies, 2 voices, and was last updated 8 years, 8 months ago by Ross.
-
Anonymous(Private) March 3, 2016 at 12:19 pm #38557
Hi!
I have all my web site in Italian, but I do not manage to get Date Picker months to be translated. I recently activated the “Load jQuery UI i18n files” in Settings->Javascript, but I keep on getting months in english.
Can you help me?
This is the page, currently under development:
http://www.amiciperlacitta.it/news/la-bussola/ricerca-avanzata/Thanks
Ross Moderator(Private) March 3, 2016 at 12:26 pm #38561Did you set the language of WordPress to Italian?
Anonymous(Private) March 3, 2016 at 12:48 pm #38565Thanks for your fast reply.
Yes, it is set to italian!
I am trying to add code to my functions.php like I read on this post:
https://support.searchandfilter.com/forums/topic/poste-date-where-translate/#post-31457But it does not work, even if it loads the jquery script ( checked on the source code).
Should the datepicker field have some attribute that is missing?
I read in jquery $.datepicker.regional[‘it’] …Anonymous(Private) March 3, 2016 at 3:59 pm #38609I finally added this to my functions.php (my localization is for italian):
add_filter( ‘wp_footer’ , ‘rc_localize_datepicker’ );
/**
* Localize datepicker fields
*
* @access public
* @since 1.0
* @return void
*/
function rc_localize_datepicker() {
wp_enqueue_script(‘jquery-ui-i18n-it’, ‘http://jquery-ui.googlecode.com/svn/tags/latest/ui/i18n/jquery.ui.datepicker-it.js’, array(‘jquery-ui-datepicker’));
}And it works!
-
AuthorPosts