1
votes

I was using Yii's CPhpMessageSource for message translations. BUt i don't want to use it for my new project. Because i'll give source files to a translator, and i don't want to give him .php files for translation. He isn't a developer and probably broke files' syntax :)

Because of this, i can use gettext for translation messages. So, i can give .mo , .po files and he can translate them with PoEdit app. This way is easier for him.

I'm using gettext first time. For CPhpMessageSource , i'm basically executing yiic message command and it's generating protected/messages/lang/category.php files. But for gettext, how can i create .po files? How can i point Yii for using that .po files?

There is a 'gettext' extension, but i couldn't understand. Isn't there in-built gettext support ? Why should i install that extension? I don't want to use 3th party extensions, if it's possible.

ADDITIONAL

I read this question and answer, but i don't have any idea about next step.

1
Maybe my answer in another thread will be helpfull.Maug Lee

1 Answers

1
votes

Yii has CGettextMessageSource to deal with GetText, but yiic message it's only for CPhpMessageSource.

The extension does not use CGettextMessageSource, instead it uses php's built in gettext, so that using the built in funcions such as _() / gettext(), a software like poedit can then scan the php files and generate the MO or PO files for you.