Keep exception messages in sourceLanguage?

If you use the i18n feature of Yii and e.g. log the application exceptions, their message will be logged in the current user language (at least if it’s a system exception). This can be tedious for the developer as he has to translate the message or find it in the message catalogue. Any creative idea how to always get exception messages e.g. in source language?

How about using the filter property of the route?


But that still means, i’d have to translate the message back. It’s already in the target language, when the filter is applied.

Any other ideas? I’d actually like to prevent translation of exceptions in the first place.

What about extending CErrorHandler like that:

class MErrorHandler Extends CErrorHandler


   protected function handleException($exception)






Nice idea, will try that, thanks.