Skip Navigation

[Resolved] Datepicker filter in views is not translated

This thread is resolved. Here is a description of the problem and solution.

Problem:
Datepicker filter in views is not translated

Solution:
You can use the Wordpress action hook "wp_print_footer_scripts" and add the datepicker localize function wp_localize_jquery_ui_datepicker() in order to localize the datepicker.

You can find the proposed solution in this case with the following reply:
https://toolset.com/forums/topic/datepicker-filter-in-views-is-not-translated/#post-1745513

Relevant Documentation:

This support ticket is created 4 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by hadiN 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1743289

I have a view with Datepicker filter, the date picker is always in English ( which is the default language of the website) and not translated according to the current language. WPML plugin is used for translation.
I tried this solution but it didn't work. https://toolset.com/forums/topic/front-end-search-date-picker-not-showing-in-danish-when-wordpress-set-to-danish/
hidden link

#1743831

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and access details so that I can review your setup.

In addition to that - Can you please tell me where you added the script that is shared with the another post you shared as solution.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1745513

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

Please check the following screenshot: hidden link

I can see the datepicker in Arabic and English.

I just deactivated the code you added to functions.php file and activated the code you added to "Custom Code" section of Toolset:

add_action( 'wp_print_footer_scripts', 'prefix_localize_jquery_ui_datepicker', 9 );
  
function prefix_localize_jquery_ui_datepicker() {
    if ( ! function_exists( 'wp_localize_jquery_ui_datepicker' ) ) {
        return;
    }
      
    wp_localize_jquery_ui_datepicker();
}

Please make sure to clear your browser cache.

#1753395

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please confirm it works at your end.

#1753451

Thanks. the issue is resolved.

#1753453

My issue is resolved now. Thank you!