• Resolved Beee

    (@beee)


    How do I override/change the language of the date picker ?

    We have a site which is managed by wpml and in the Dutch version the language of the date pickers is still English.

    Our locales are set as follows:

    setlocale(LC_TIME, array('Dutch_Netherlands', 'Dutch', 'nl_NL', 'nl', 'nl_NL.ISO8859-1', 'nld_NLD'));
    setlocale(LC_MONETARY, array('Dutch_Netherlands', 'Dutch', 'nl_NL', 'nl', 'nl_NL.ISO8859-1', 'nld_NLD'));

    https://wordpress.org/plugins/gravity-forms-list-field-date-picker/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Beee

    (@beee)

    problem is made irrelevant due to other changes.

    Plugin Author ovann86

    (@ovann86)

    Let me know if it’s still any issue.

    If you can share how to set the language I’ll make a note on the FAQ’s for this plugin.

    I would hope that it’s the same way you configure the language for the standard Gravity Forms datepicker. But I’ve never looked into it.

    Thread Starter Beee

    (@beee)

    we stopped using yours and decided to use the one provided by Gravity Forms itself.

    Plugin Author ovann86

    (@ovann86)

    In case someone lands here looking for the answer – Gravity Forms doesn’t provide a translation for the datepicker, but does provide instructions on how to set it up.

    It’s the same process for this plugin. I can only assume the WPML plugin is doing this for you automatically but can’t look into that because it’s a premium plugin I don’t have access to.

    The instructions for translating the datepicker are:

    https://www.gravityhelp.com/documentation/article/translating-the-datepicker/

    So for this example, to change the datepicker language to Dutch, the language code is nl.

    Download the nl file, save to your active theme in the /js/ folder (create if it doesnt exist) then add this code in your theme’s functions.php file.

    add_action( 'gform_enqueue_scripts', 'add_datepicker_regional', 99 );
    function add_datepicker_regional() {
        if ( wp_script_is( 'gform_datepicker_init' ) ) {
            wp_enqueue_script( 'datepicker-regional', get_stylesheet_directory_uri() . '/js/datepicker-nl.js', array( 'gform_datepicker_init' ), false, true );
        }
    }

    It does seem too technical to me, hopefully Gravity Forms will eventually bundle all the language files in the GF plugin and automate this or provide an interface to change the language.

    Thread Starter Beee

    (@beee)

    Thanks… That’s a nice one…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calendar language doesn't change’ is closed to new replies.