I had the same problem a while back, search the group for it.
The problem is that the first time a translation is done, i.e. the  
__() function is used, the language is locked and cannot be changed  
anymore for the rest of the page execution. (Actually, rightly so,  
otherwise you might get half your page in English and the other half  
in German.)

Point being, if you want to change the language, make that the very  
first thing you do in your app.

Fröhliches Backen!

On 12 Sep 2008, at 15:01, Braindead wrote:

>
> Hi guys,
>
> after spending some more time I solved my problem with authError and
> loginError messages of the Auth component only displaying in the
> default language.
> Just in case somebody has the same problem I post the solution. :-)
>
> This is my app_controller.php file where only the L10n part and the
> messages are of interest:
>
>
> uses('L10n');
>
> class AppController extends Controller {
>       var $components = array('Auth');
>
>       function beforeFilter() {
>               $this->L10n = new L10n();
>               $this->L10n->get($this->Session->read('Config.language'));
>
>
>               if (isset($this->Auth)) {
>                       $this->Auth->fields = array('username' => 'email', 
> 'password' =>
> 'password');
>                       $this->Auth->userScope = array('activated' => 1);
>                       $this->Auth->loginAction = array('controller' => 
> 'users', 'action'
> => 'login');
>                       $this->Auth->loginRedirect = array('controller' => 
> 'pages',
> 'action' => 'display', 'home');
>                       $this->Auth->logoutRedirect = array('controller' => 
> 'users',
> 'action' => 'login', 'admin' => false);
>                       $this->Auth->loginError = __('auth_loginerror', true);
>                       $this->Auth->authError = __('auth_autherror', true);
>                       $this->Auth->autoRedirect = true;
>                       $this->Auth->authorize = 'controller';
>               }
>
>       }
>
>       function isAuthorized() {
>               return true;
>       }
> }
> >


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to