twig - How to get country language in Symfony -


i'm customizing error pages , wandering if possible language of country user directly in template, without controller.

you can use :

{{ app.request.locale }} 

edit

ah didn't understood question looking :

 $request->getpreferredlanguage($anarrayofyoursupportedlanguages); 

then pass twig. fabpot answer :

https://groups.google.com/forum/#!topic/symfony-devs/-2awaqhlllq


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -