Yannis,

I think you are using the translate behavior.

Try this everytime user changes language:

if (!class_exists('L10n')) {
        App::import('Core', 'L10n');
}

$l10n = new L10n();
$l10n->get($lang);



On Jul 29, 8:37 am, Yannis <ikasso...@gmail.com> wrote:
> I can see from the  debug output that when I click on the code you
> have
> given me for changing language there is no change on the database
> request.
>
> I have tried different language codes but nothing. The only thing that
> can bring
> a change to the database is if I change the Configure::wite
> ('Config.language'...
> on the core.php or if I set the locale on the articles_controller.php
> like this
> $this->Article->locale = 'gre';
> I cannot find other way to change the language of the database query.
>
> The code you've provided for changing language:
> -------------------------------------------------------------------------
> <?php
> $currLang = Configure::read('Config.language');
> if ($currLang<>"ca" && $currLang<>"spa")
> {
>   $currLang = "ca";
>   Configure::write('Config.language',$currLang);
>
> }
>
> ?>
> <li><?php echo ($currLang<>"ca") ? '<a href="'.router::url
> ("/").'lang/
> ca">Catal&agrave;</a>' : 'Catal&agrave;' ; ?></li>
> <li><?php echo ($currLang<>"spa") ? '<a href="'.router::url
> ("/").'lang/
> spa">Castellano</a>' : 'Castellano' ; ?></li>
> -------------------------------------------------------------------------
> Does not work 100%. It can change the i10n language to greek but then
> it does not
> change currLang
>
> L
>
> On Jul 28, 5:17 pm, leop <ponton....@gmail.com> wrote:
>
>
>
> > > Do I have to add something else to change the database locale?
>
> > No, I don't think so. That's all I have!
>
> > I can only suggest that you look carefully at the folder names and the
> > two or three letter acronyms to ensure that you have the correct ones
> > in the correct places.
>
> > Start with just two languages that have standard acronyms, e.g. en /
> > eng & es / spa.  That way you can be certain which goes where.
> > This page might help (it takes a while to 
> > load):http://www.sil.org/iso639-3/codes.asp?order=scope&letter=%25
>
> > L
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to