Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 799 forks source link

Form Block: Error messages displayed in English instead of assigned Site Language (on non-English sites) #36425

Open jorpdesigns opened 5 months ago

jorpdesigns commented 5 months ago

Impacted plugin

Jetpack

Quick summary

On non-English sites (i.e. sites that don't have English assigned as the Site Language), Form Block errors are still displayed in English. Looks like some or all of the translations are missing / not being applied and the amount of missing translations varies, depending on the language.

The screenshot below is from a French site.

h7KJTA.png

Steps to reproduce

  1. Open a new or existing test site.
  2. Navigate to Settings → General and ensure the Site Language is not English. If it is, switch to French or Spanish.
  3. Create a page or post and add the Form Block.
  4. Select an existing form template or create your own form but ensure to have at least one required field.
  5. Publish the page and view it on the front end.
  6. Attempt to submit the form without filling the required field.

A clear and concise description of what you expected to happen.

On submission, I expect the form validation errors to be in the assigned site language.

What actually happened

The form validation errors are not always displayed in the assigned site language:

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

Issue doesn't appear to be theme, browser or site specific. I checked from multiple browsers with different browser languages. Initially reported in 7867937-zen

github-actions[bot] commented 5 months ago

Support References

This comment is automatically generated. Please do not edit it.

jeherve commented 5 months ago

It would appear that the site language was still set to English when the form was first created. This is why you see the "required" text as labels, for example. If you were to create a form on a site set to French, you'd see "obligatoire":

image

That wouldn't change the text of the warnings themselves though; those come directly from your browser, and thus from your device language. If your computer or phone is set to French, you should see messages in French.

Could you give that a try and let me know how it goes?

Thank you.