1

the website I work on was developped in french(FR) and I recently developped the multilingual aspect to translate the website in english(EN), for this, I used the translator bundle. Here are my configs files :

translation.yaml

services.yaml

I also created a messages.en.xlf file with all my customs messages translated from french to english, and it works. Here is my problem : I want to translate all the default form errors.

My form with default locale: FR

My form with default locale EN

The language change has been detected and the tittle has been translated. But my error message is still the same. What can I do about it ? Do I have to manually translate all the displayed messages with some JS ? Thankx.

Tarumi
  • 31
  • 1
  • 4

2 Answers2

1

This validation and error messages come from HTML5 and language is based on your browser settings.

If you want to force english try adding this into your template:

<meta http-equiv="Content-Language" content="en">
Leprechaun
  • 759
  • 5
  • 14
0

Actually, you're doing right. It's juste because this is not a Symfony message, so you can't translate it.

This message come from your browser. Only displayed when an input has required attribute.

D. Schreier
  • 1,700
  • 1
  • 22
  • 34