CakePHP 2.x i18n验证消息

5h of fight with this and no results. i have tried overloading methods with _d() and _() and didn't help. shell validation_errors neither. normal string working well in views but validation messages nope.

default language for app is polish and alt is english. i have .pot files in Locales/eng/LC_MESSAGES with source strings as polish and translations as english and it works fine

in model before validate

public $validationDomain = 'validation_errors';

and in AppController in beforeRender

Configure::write('Config.language', 'eng');

for force eng lang

anyway, it is default domain for validation... and it doesn't work

i don't know if i do something wrong or it is bug or sth...

any ideas ??

Try using $this->Session->write('Config.language', 'pol'); or $this->Session->write('Config.language', 'eng'); when using different languages on user level. The Configure::write('Config.language', 'eng'); is a sitewide fallback.

See this CakePHP cookbook entry for more information.