translating with t() only dumps file content

Hi all,

I try to setup translation according the “definitvie Guide” chapter “Intenrationalisation”. this looks simple, but in my case it don’t work :angry:

So i wrote my strings in the viewer-sources in English, like:

<?php echo CHtml::submitButton('Login'); ?>

and added the translation function:

<?php echo CHtml::submitButton(Yii::t('translation','Login')); ?>

plus created a new file protected/messages/de_de/translation.php with:

return array (

'Login' => 'Einloggen',


furtheron added these lies at the end of the config/main.cfg file:

'sourceLanguage' => 'en_us',

'language' => 'de_de',

At the end, the login button is not translated, but the whole translation.php file is dumped in front of the button. So it seems that t() function found the right file and read the content. But why don’t translate it?

that’s how it looks now in the browser output:

“return array ( ‘Login’ => ‘Einloggen’, ); Login”

There is no error posted into the runtime/application.log file and nothing in the browsers console.

any hints??? Thanks


Add a php tag in the translation file.


Yes it is !!!!!

It’s so stupid, what a shame… I’ve checked all files a hundred times but didn’t saw this