probléme traduction errors du formulaire
Bonjour, j'ai un probléme pour traduire un message d'erreur dans ma vue.
j'ai mon champ input comme ceci dans ma vue
Code:
1 2 3 4 5 6 7
|
<div>
{{ form_errors(form.name,form.name|trans()) }}
<span>{{ form_label(form.name, 'Nom :') }} </span>
{{ form_widget(form.name) }}
</div>
<br /> |
pour l'instant j'ai ceci
Citation:
Your name must have at least 3 characters.
les validation qui corresponde
Code:
1 2 3 4 5
|
Ecommerce\AdminBundle\Entity\Contact:
properties:
name:
- MinLength: { limit: 3, message: "Your name must have at least {{ limit }} character.|Your name must have at least {{ limit }} character." } |
le message dans mon fichier messages.fr.xlf
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="file.ext">
<body>
<trans-unit id="1">
<source>Symfony2 is great</source>
<target>J'aime Symfony2</target>
</trans-unit>
<trans-unit id="2">
<source>Your name must have at least 3 characters.</source>
<target> <target>Le titre doit faire au moins 3 caractères</target></target>
</trans-unit>
</body>
</file>
</xliff> |
impossible de traduire les message pour
j'ai le soucie suivant:
Citation:
An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class Symfony\Component\Form\FormView could not be converted to string in F:\projets\Symfony\vendor\symfony\symfony\src\Symfony\Component\Translation\Translator.php line 130") in EcommerceAdminBundle:Contact:contact.html.twig at line 19.
Le titre doit faire au moins 3 caractères
Une idée les amis