php - Symfony translations use always default EN -


i have italian language set on browser, symfony localization give me english translations. how can italian strings if access page italian browser?

now see "pluto" in en browser , in browser.

config.yml:

parameters:     locale: en  framework:     translator: { fallbacks: ['%locale%'] } 

messages.en.yml:

pippo: pluto 

messages.it.yml:

pippo: paperino 

index.html.twig:

{% block body %}     <div class="container">         <div class="row">             <div class="col-sm-12">                 {% trans %}                     pippo                 {% endtrans %}             </div>         </div>     </div> {% endblock %} 

thanks

if want set current locale headers need make event listener kernel.request event sets $request->setlocale(...).

see similar questions:


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -