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 -

c# SetCompatibleTextRenderingDefault must be called before the first -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -