• Resolved maxity

    (@maxity)


    We have a form in German language on our page. Localization works fine except the date picker. It stays in English language and prints the following error message in the browser console:

    Error: flatpickr: invalid locale de

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shawon Chowdhury

    (@shawon001)

    Hello @maxity,

    We don’t have a built-in way to change the calendar language. However, if you’re willing, this can be done with a little custom code. There are two code options to achieve this:

    1) You could load additional languages for the date picker calendar using a language library. Here’s our tutorial on how to do that! With this, you could add the “de” localization.

    or,

    2) You could manually add the shorthand and longhand translations. Here’s an example of the code you’d need to do this for French.

    In case it helps, here’s our tutorial with the most common ways to add custom code like this.

    For the most beginner-friendly option in that tutorial, I’d recommend using the WPCode plugin. This will protect your code from updates and keep it easy to manage right within your WordPress admin area.

    Hope this helps. Thanks ??

    Plugin Support Shawon Chowdhury

    (@shawon001)

    Hi @maxity,

    We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

    Thread Starter maxity

    (@maxity)

    Hi Shawon,

    thanks for your reply.

    We used the language library, which works fine. To ease the process for multiple WPForms installations and multi-language sites, we wrote a little WordPress plugin which does the following:

    • extracts the currently requested language from the WordPress API (for multi-language sites)
    • embeds the appropriate flatpickr language library in case the requested language is not english
    • option for switching between using locally bundled flatpickr assets inside the plugin and downloaded assets from cdn
    Plugin Support Shawon Chowdhury

    (@shawon001)

    Hi @maxity,

    That sounds great!

    Thanks for letting me know and please alwasy feel welcome to reach out if you need any other help ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘flatpickr: invalid locale de’ is closed to new replies.