I have a problem with Symfony locale.
When page is loaded for the first time it sets locale as 5 characters long http://example.com/en_US. But you can also access page with 2 characters long url http://example.com/en.
To get locale $this->getRequest()->getLocale()
is used and it returns 2 or 5 characters long locale string. On record insert it saves locale as 5 or 2 characters depending on example urls and if I want to get records by language, then some of them won't be visible even if locale is the same (just length is different).
How can I force symfony to allways use 2 characters long locale? Or is there something wrong with my method to insert/get records?