views:

49

answers:

1

Hi everyone. I use CakePHP 1.3.2 with the integrated Translate Behavior.

The translations I save my several models in each table. Example:

class Page extends AppModel {
    var $name = 'Page';
    var $actsAs = array(
        'Translate' => array('title', 'subtitle', 'menu')
    );
    var $translateModel = 'PageI18n';
...
}

Now... after inserting of some data rows. Cake doesn't retrieve the i18n-data in the index-action anymore. The SQL-dump looks like this:

... WHERE I18n__title.locale = 'de_de' ...

But in the table "page_i18ns" the locale field is filled with 'deu'

Why is Cake mixing the locale attribute??? Where should I set the locale attribute? Somewhere in Model class???

In my AppController I set the language with Configure::write('Config.language', $lang); in the beforeFilter()-function .... 'eng', 'deu', 'chi'

Thanks in advance!

A: 

I have the following code in my ArticlesController:

function beforeFilter() {
    parent::beforeFilter();
    $this->Article->locale = $this->Session->read('Config.language');
}

See if that helps.

Oscar
Thanks Oscar. In my case: $this->Article->locale = Configure::read('lang');
Juri