• Stonehenge Creations

    (@duisterdenhaag)


    When loading any Caldera Form on a Dutch website, there is an error in the browser console:
    "Uncaught Error: nl_NL is not available in the catalog at m.setLocale (parsley.min.js:2)"

    The reason for this is that Parsley uses two-letter locale, while WordPress (for Dutch anyhow, but also for some other languages) returns either two-letter (nl) or 4 letter (nl_NL), depending on when it is called. I did some tests. I have called the locale in the order that WordPress executes its actions (firing sequence).

    The error can be very easily solved by making sure the returned value is two letters.

    In caldera-forms/classes/render/assets.php, line 859 change
    $locale = get_locale();
    to
    $locale = substr( get_locale(), 0, 2);

    That will prevent the error and make sure that Parsley is correctly loaded for all languages.

    Please update this in your next release, as nobody likes errors. ??

  • The topic ‘BUG: Parsley gives error in console.’ is closed to new replies.