I'm translating my Symfony2 website, and it seems to work fine except for the layout... My template extends layout.html.twig, which contains a translated menu. When I'm in french, everything works fine (this is my default locale), but when I switch to english, the menu stays in french and the rest of the page (contained in my template) translates in english. Does someone have an idea of what's going on ?
Template (services.html.twig)
{% extends "GslsAppBundle::layout.html.twig" %}
Layout (layout.html.twig)
<div id="menu">
<a href="{{ path('gsls_app_homepage') }}" class="accueil">{{ "menu.accueil"|trans|raw }}</a> |
<a href="{{ path('gsls_app_services') }}" class="services">{{ "menu.services"|trans|raw }}</a> |
<a href="#" class="reservation">{{ "menu.reservation"|trans }}</a> |
<a href="#" class="contact">{{ "menu.contact"|trans }}</a>
</div>
messages.fr.yml
menu:
accueil: Accueil
services: Services
reservation: Réservation
contact: Contactez-nous
messages.en.yml
menu:
accueil: Home
services: Services
reservation: "Book online"
contact: "Contact us"
Thank you !
{{ dump(app.request.locale) }}in your template to see which locale is present. - SirDerpingtonmessages.en.ymlfile, you have to clear cache in order for Symfony to discover it. - Igor PantovićBook onlineandContact us? I know this is maybe trivial but yeah... - SirDerpington