Internationalization config?

I cant seem to get Internationalization to work because there isn't a clear config example in the docs.

I can do

'language'=> 'nl'

inside my config.php

And then translate some messages under framework/yii/messages/nl/yii.php, but then when I want to update yii this file is overwritten.

What I want is that it uses protected/messages/nl/yii.php

How do i accomplish this? No useful config example in the docs…

Do not modify code under framework.

Because currently there’s no Netherland translation of those core messages, you will need to explicitly specify error messages in your validation rules (I guess that’s where you need it). Please refer to http://www.yiiframew…doc/cookbook/1/

I managed to "translate" the error messages of my forms. But i want to translate the framework messages too. Like "Please fix the following input errors:".

Even when the Dutch (nl) translation of the yii.php files comes out, i want to keep my own file, because sometimes the messages are too "technical".

Is there no way of translating the yii.php file outside of the framework directory?

You can customize the 'coreMessage' component which provides the core message translations. Below is the default configuration:






You may change the basePath to point to your application's messages folder.

A more detailed answer is here: http://www.yiiframew…oc/cookbook/18/

The Yii::getPathOfAlias('application.messages') used in that cookbook article doesn't return anything in my config file, I get a blank basePath…

It gives the right path when I echo it in an controller/action though.

Got it working though, with:


	'basePath' => 'protected/messages',



I updated the cookbook article. We should not use 'application' alias because it is defined AFTER the config file is read.

im gathering information to apply the requirements implemented on my blog

where i used globalization and internationalization techquines

where can we get more information to apply what i have done in that site?

i’m starting a new project where im not gonna use…i’ll use php and i’ve choose yii.

if blog demo app had a version with this requirements implemented it would be great.

remember that im not asking for a full implemented system, and just for a how to!


I think you may read the following tutorial first: