• Resolved guitarwingman

    (@guitarwingman)


    Hi there
    Thank you for this awesome plugin.
    I’m in the process of migrating from CF7 to HappyForms!
    I would like to use the date-picker in some of my forms, but it would be so awesome if the language in the dropdown (names of months) could be in other languges. I think that the fact that the months are in english could confuse some of my leads (maybe).
    Is it possible to ad this feature somewhere down the line?
    Thx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey there, @guitarwingman! 👋

    We’re glad to hear you like HappyForms! There are 2 ways to translate your months dropdown:

    1. Go for a real translation of HappyForms, with a plugin like Loco Translate. You can also just translate the month labels.
    2. Use a HappyForms PHP hook in your functions.php file. This is much faster and doesn’t require external plugins.

    Here’s a snippet you can use as a base if you opt for 2:

    function happyforms_get_translated_months( $months ) {
        $months = array(
            1 => 'January',
            2 => 'February',
            3 => 'March',
            4 => 'April',
            5 => 'May',
            6 => 'June',
            7 => 'July',
            8 => 'August',
            9 => 'September',
            10 => 'October',
            11 => 'November',
            12 => 'December',
        );
    
        return $months;
    }
    
    add_filter( 'happyforms_get_months', 'happyforms_get_translated_months' );

    We hope that helps! Let us know how that goes. 🙂

    Thread Starter guitarwingman

    (@guitarwingman)

    Hey there.
    Thanks for the suggestions.
    I’ve tried Loco Translate, but I couldn’t manage to get it to work proberly.
    I’m not to sure that I’ll try the PHP as I’m no wiz in that department. I know basic HTML and some CSS, but other than that I rely on plugins and WYSIWYG-editors.
    Best regards

    Hey @guitarwingman,

    Would you mind sharing the issue you’re having with Loco Translate? We’ll be happy to help!

    Just a little heads up — when adding a new translation for HappyForms in Loco, be sure to select System as location for your translation files.

    Let us know your thoughts! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Date picker language’ is closed to new replies.