{% if close is not defined %}{% set close = false %}{% endif %}

{% for flashMessage in app.session.flashbag.get('alert') %}
    <div class="alert alert-warning">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('error') %}
    <div class="alert alert-danger">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('info') %}
    <div class="alert alert-info">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('success') %}
    <div class="alert alert-success">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage }}
    </div>
{% endfor %}

{% if close is not defined %}{% set close = false %}{% endif %}

{% for flashMessage in app.session.flashbag.get('alert') %}
    <div class="alert alert-warning">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage|trans }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('error') %}
    <div class="alert alert-danger">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage|trans }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('info') %}
    <div class="alert alert-info">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage|trans }}
    </div>
{% endfor %}

{% for flashMessage in app.session.flashbag.get('success') %}
    <div class="alert alert-success">
        {% if close %}<button type="button" class="close" data-dismiss="alert">&times;</button>{% endif %}
        {{ flashMessage|trans }}
    </div>
{% endfor %}

Add translation support to flash messages
Add translation support to flash messages

Added simple call to trans so that flash messages are passed into the translator for enabling them to be translated.