Trying to set symfony locale to something else than fr and en_US

Go To StackoverFlow.com

0

I am trying to make a multi-language application on Symfony2 and I was wondering why when I use this $this->get('session')->setLocale('fr'); it works (finds the file /src/ggirtsou/MyBundle/Resources/Translations/messages.fr.xliff) but when I set it to something like: el_GR it won't work.

I tried many variations (el, GR, EL, GR_el) but none of them worked. Kept getting the non-translated string.

I know I am missing something here and can't figure this out!

2012-04-03 20:33
by ABC


4

Make sure you have messages.gr.xliff file in Resources/Translations folder. After adding languages always clear the cache.

2012-04-04 10:18
by Kosta
Thanks a lot! That solved my problem - ABC 2012-04-04 14:57
Ads