Skip to content

Instantly share code, notes, and snippets.

@muzfr7
Last active April 24, 2017 07:43
Show Gist options
  • Save muzfr7/66cc41625fde26fda90137b51e1f6481 to your computer and use it in GitHub Desktop.
Save muzfr7/66cc41625fde26fda90137b51e1f6481 to your computer and use it in GitHub Desktop.
Symfony Override System Errors on login page!
"Invalid credentials." : Invalid credentials.
"Invalid credentials." : معلومات الدخول خاطئة.
{% if error %}
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
{{ error.messageKey|trans({}, 'messages') }}
{# Here the 'messages' is important as it refers the domain of your translation,
or if you prefer the name of your translation file. In my case : messages.en.yml #}
</div>
{% endif %}

System Translations Path

vendor\symfony\symfony\src\Symfony\Component\Security\Core\Resources\translations\security.en.xlf

We could just copy the key and override it in our custom translation files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment