verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

[2.x] Translate issue frontend validation. #1948

Closed Numkil closed 1 week ago

Numkil commented 1 week ago

Describe the bug

JS Frontend validation is not working for me when trying to translate validation errors to dutch [nl-BE].

I see that in the html of the form a script tag window.FormieTranslations has been created. Which Does contain the correctly translated dutch validation error messages. So the static translation stuff seems to be working correctly.

However when the validation errors are displayed I still get shown the English errors instead of the translated ones.

Screenshot 2024-06-18 at 12 17 03

Steps to reproduce

  1. Create a basic form in the backend with option 'frontend js validation' enabled.
  2. Go to a page with the formie form with locale nl-BE
  3. Submit form without filling in any fields
  4. see errors being displayed in english instead of dutch

Form settings

Craft CMS version

4.10.1

Plugin version

2.1.19

Multi-site?

yes

Additional context

No response

engram-design commented 1 week ago

Strange, I just did a quick test with German and that's working correctly

image

And in a /translations/de/formie.php file:

<?php
return [
    'Please fill out this field.' => 'Please fill out this field - translated.',
];
Numkil commented 1 week ago

Yeah im not sure whats happening either.

In the HTML of the form I see this. Which does seem to point to the issue being somewhere in the javascript side.

Screenshot 2024-06-20 at 09 45 07

Screenshot 2024-06-20 at 09 36 35

There are no console errors either. Wondering what else I could have misconfigured or something for it to not be working.

Numkil commented 1 week ago

I figured it out. I was some custom JavaScript interfering with the formie translations. Sorry about the confusion