Validation messages

Hello

Although I’ve read the i18n docs (http://www.yiiframework.com/doc/guide/topics.i18n) I can’t figure out how to translate the error messages to german.

My config files looks like this:




return array(

    ...

    'language' => 'de_de',

    'sourceLanguage' => 'en_us',

    ...



In the code I try to access the messages like this:




...

foreach($contactForm->getErrors() as $key => $errorArray)

{

    $ajaxOutput['errors'][$key]  = Yii::t('yii', $errorArray[0]);  

}



But unfortunateley there aren’t any transleted messages :frowning:

Any help very welcome!

I think $errorArray is a string already




...

foreach($contactForm->getErrors() as $key => $errorArray)

{

    $ajaxOutput['errors'][$key]  = Yii::t('yii', $errorArray);  

}



Edit:

I was wrong, $errorArray[0] is correct. I get translated strings from $contact->getErrors(). Check if language => ‘de’ works.

/Tommy

language => ‘de’ works.

Thank you very much!