Customize Authentication - Login Symfony2 Messages
You can use translation. In parameters.ini
set locale to your language and create message file. Then in twig template use:
{% if error %} <div class="error">{{ error.message|trans({},'messages') }}</div>{% endif %}
There is another possibility if you don't want to use translations. You can just replace the message, for example:
{{ error.message | replace({"Bad credentials." : "Invalid username or password."}) }}