How to do i18n properly when lots of languages are used?

The primary language of my application is en-us and I expect to have tens of other supported languages. If I want to change some message text for non-primary language, it's easy - I just update one corresponding translation file. But if I want to change en-us message, it requires me to update ALL translation files because all of them include this source message. That's not something I'd like to do on a regular basis.

So what is the proposed solution here? For me it might work if instead of source message I use some constant like L_GREETING, L_LOGIN, L_PAYMENT etc. But in this case I need the translation from 'null' to en-us. I don't really understand how to setup non-existing source language and still have i18n working.

I tried to use "tokenized english" with Yii::t() e.g. for the pager as well as other messages I defined myself. I recall it worked just fine and the expanded messages in english can be added the same way as the translations in all the other languages. For my testing I edited the message files by hand but I guess the yiic message command should do the initial job of collecting "message tokens".

(I will continue the work on my application when I finished some more translations.)

/Tommy

Quote

I tried to use "tokenized english" with Yii::t() e.g. for the pager as well as other messages I defined myself. I recall it worked just fine and the expanded messages in english can be added the same way as the translations in all the other languages. For my testing I edited the message files by hand but I guess the yiic message command should do the initial job of collecting "message tokens".

Tommy, how did you configure you application so it performs translation of your tokens to English? What source language are you using?

And I still would like to hear official solution to this problem from Yii creators :)

Setting the sourceLanguage to be 'null' or some other inexisting language code should work. The yiic message tool will still be able to pick up these language tokens.

Before call to

Yii::app()->setLanguage()

The raw "tokens" are displayed:

'register', 'forgotten', 'header', 'prev', 'next'

After the call, selecting english, these messages are displayed:

'forgotten password', 'register now', 'Go to page', '< Previous', 'Next >'