Yii locale Translation

Hi, I've been using the PRADO Framework for some projects and started using Yii just yesterday. I was going through the guide and tried to translate some of the messages.

So here is what I did:

  1. I set the language to pt_br in protected/config/main.php;

  2. Inside protected/messages/ I created the folder pt_br and copy the yii.php file from framework/messages/zh_cn.

  3. Translated some of the messages in yii.php

But nothing happened.

Then I changed folder's location to framework/messages, only then the messages were changed.

I guess i'm missing something…

The directory "framework/messages" is meant to store messages used in the Yii framework, while "protected/messages" is for messages used in an Yii application.

When you use Yii::t() to translate a message, make sure you specify a message category other than "yii". The "yii" category is reserved for messages of the Yii framework core code. I guess that's why you didn't see the translation.

The thing is that I'm not creating new messages with yii category.

I was trying to translate the original yii category's messages. I guess that later versions of yii it will have those messages translated, am I right?

That's right. The yii message translations are supposed to be done by Yii team developers (or via user contributions), not users.