<p dir="auto">The form validators are nicely integrated with the translator. The only thing you have to do is set your language and the messages are automatically translated.</p>
<p dir="auto">With the authentication system, this is not the case. A possible, simple, solution would be to add authMsg.xx.xliff files to Symfony/Bundle/FrameworkBundle/Resources/translations/ that contain translations for AuthenticationExceptions. Then you could translate the error like this:<br>
<code class="notranslate"><br>
{% if error %}<br>
</code></p><div dir="auto"><code class="notranslate">{{ error.message|trans({}, 'authMsg') }}</code></div><code class="notranslate"><br>
{% endif %}<br>
</code><p dir="auto"></p>
<p dir="auto">This is how you should display the error according to the handbook <a href="http://symfony.com/doc/current/book/security.html" rel="nofollow">http://symfony.com/doc/current/book/security.html</a></p>
<p dir="auto">Here is an example authMsg.nl.xliff http://.../authMsg.nl.xliff</p>
<p dir="auto">There are two enhancements which could be made to the <code class="notranslate">AuthenticationException</code>:</p>
<ol dir="auto">
<li>add a getMessageKey(), getMessageData() which could be used by the translation component as the exception message itself cannot be safely displayed to the user</li>
<li>change the signature of the constructor to match that of \Exception and pass $extraInformation via a setter</li>
</ol>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lsmith77/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lsmith77">@lsmith77</a>, do you still plan to work on this?</p>