Re: l10n in cakephp > can't get app to switch language

2009-03-10 Thread jakobjp

This is weird: I can successfully change the language with $this-
>Session->write('Config.language', 'fr'); in the beforeRender()
function in apps_controller.php

Why does it not work in beforeFilter()?

Does it matter where it's being done?



On Mar 10, 2:09 pm, jakobjp  wrote:
> On Mar 10, 2:25 am, "jitka (poLK)"  wrote:
>
> > > I have created two test languages in:
> > > /app/locale/eng/LC_MESSAGES/default.php
> > > /app/locale/fre/LC_MESSAGES/default.php
>
> > php extension is reason. CakePHP assumes there plaintext .po (or
> > preferrable binary .mo) files.
>
> Yeah that was a mistake in my email. The files are already ".po" files
> in plaintext. The content is as follows (in the english one):
> msgid   "test"
> msgstr  "The Test"
>
> Both my testing language work fine when setting the language in
> core.php, but I can't switch away from the default language in the
> application controller.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: l10n in cakephp > can't get app to switch language

2009-03-10 Thread jakobjp



On Mar 10, 2:25 am, "jitka (poLK)"  wrote:
> > I have created two test languages in:
> > /app/locale/eng/LC_MESSAGES/default.php
> > /app/locale/fre/LC_MESSAGES/default.php
>
> php extension is reason. CakePHP assumes there plaintext .po (or
> preferrable binary .mo) files.

Yeah that was a mistake in my email. The files are already ".po" files
in plaintext. The content is as follows (in the english one):
msgid   "test"
msgstr  "The Test"

Both my testing language work fine when setting the language in
core.php, but I can't switch away from the default language in the
application controller.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: l10n in cakephp > can't get app to switch language

2009-03-10 Thread jakobjp

Unfortunately that didn't do the trick... :-(

On Mar 10, 1:42 am, Miles J  wrote:
> I use app import and it worked for me:
>
> App::import('Core', 'l10n');
> $l10n = new L10n();
> $l10n->get($locale);
>
> I also place it in my app controller beforeFilter(). If you are doing
> it in another controller, be sure to call parent::beforeFilter() in
> that controllers beforeFilter().

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: l10n in cakephp > can't get app to switch language

2009-03-09 Thread jitka (poLK)


> I have created two test languages in:
> /app/locale/eng/LC_MESSAGES/default.php
> /app/locale/fre/LC_MESSAGES/default.php

php extension is reason. CakePHP assumes there plaintext .po (or
preferrable binary .mo) files.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: l10n in cakephp > can't get app to switch language

2009-03-09 Thread Miles J

I use app import and it worked for me:

App::import('Core', 'l10n');
$l10n = new L10n();
$l10n->get($locale);

I also place it in my app controller beforeFilter(). If you are doing
it in another controller, be sure to call parent::beforeFilter() in
that controllers beforeFilter().
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---