Setlanguage As Default

Hi,

I would like to have the German language for my website.

I tried this but e.g. login error messages like "Username cannot be blank." are still in English.

Can you please help me?

index.php


<?php


// change the following paths if necessary

$yii=dirname(__FILE__).'/../yii/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';


// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);


require_once($yii);

Yii::createWebApplication($config)->run();

Yii::app()->setLanguage("de");



add:




'language'=>'de',



in your config file. also - if your sources are written in german:




'sourceLanguage'=>'de',



your code does not work because:

you set language AFTER CApplication::run() method is called. This means that request is processed with default language and after all processing language is changed to german with no effect.

Thank you, that solved me problem.