[symfony-users] Re: Symfony2 and Translation
Hi, I had a similar issue and solve by renaming the translation files in messages.en_EN.php messages.de_DE.php messages.en_US.php but still don't know why it doesn't work with just 'en'. Bye -- Alberto On Nov 14, 6:04 pm, Bertrand Zuchuat wrote: > Hi, > > I would like to use the translation on my test project but i have some > problems. > > i make my dictionary into > src/Application/myAppBundle/Resources/translations/messages.en.php. > content of this file: > > return array( > 'A propos' => 'About', > 'Quitter' => 'Quit', > ); > > my config: > > app.config: > translator: { fallback: fr_CH } > ... > > In my template, i use this code: $view['translator']->trans('Quitter'); ?> > but the translation doesn't work. > > To switch the user language, i use in my action: > $this['request']->getSession()->setLocale('en_US'); > > Thanks for your help > > Bertrand -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Symfony2 and Translation
Yes there is. "When a translation does not exist for a locale, the translator tries to find the translation for the language (fr when the locale is fr_FR for instance); if it also fails, it looks for a translation for the fallback locale." quote from http://docs.symfony-reloaded.org/master/guides/translation.html If your session.locale is en_EN, The waited behavior should load: - messages.en_EN.xml - if not found messages.en.xml - and finally the default translatable.fallback On 17 nov, 12:18, noel guilbert wrote: > It does not work because you're trying to load the locale named "en", which > is different of "en_US" or "en_EN". That's why your translations are not > loaded. There's no such "default locale" thing that would load "en" when > "en_US" does not exist. > > ++ > > On Mon, Nov 15, 2010 at 7:21 PM, Bertrand Zuchuat > wrote: > > > > > > > > > > > Hi, > > > Thanks for your answer. > > > This solution work but it's strange. > > > Bertrand > > > Le 15 nov. 2010 à 15:05, HTC a écrit : > > > > I had a similar issue and solve by renaming the translation files in > > > > messages.en_EN.php > > > messages.de_DE.php > > > messages.en_US.php > > > > but still don't know why it doesn't work with just 'en'. > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > legroups.com> > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en > > -- > Noël GUILBERThttp://www.noelguilbert.com/ > Twitter > :http://twitter.com/noelguilberthttp://www.sensiolabs.comhttp://www.symfony-project.com > Sensio Labs > Tél: +33 1 40 99 80 80 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Symfony2 and Translation
Hi, Thanks for your answer. This solution work but it's strange. Bertrand Le 15 nov. 2010 à 15:05, HTC a écrit : > I had a similar issue and solve by renaming the translation files in > > messages.en_EN.php > messages.de_DE.php > messages.en_US.php > > but still don't know why it doesn't work with just 'en'. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Symfony2 and Translation
It does not work because you're trying to load the locale named "en", which is different of "en_US" or "en_EN". That's why your translations are not loaded. There's no such "default locale" thing that would load "en" when "en_US" does not exist. ++ On Mon, Nov 15, 2010 at 7:21 PM, Bertrand Zuchuat wrote: > Hi, > > Thanks for your answer. > > This solution work but it's strange. > > Bertrand > > Le 15 nov. 2010 à 15:05, HTC a écrit : > > > I had a similar issue and solve by renaming the translation files in > > > > messages.en_EN.php > > messages.de_DE.php > > messages.en_US.php > > > > but still don't know why it doesn't work with just 'en'. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Noël GUILBERT http://www.noelguilbert.com/ Twitter : http://twitter.com/noelguilbert http://www.sensiolabs.com http://www.symfony-project.com Sensio Labs Tél: +33 1 40 99 80 80 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en