Ability to customize locale files

Just as we can keep our customized version of the core messages in our application directory, it’d be nice that we could do the same with the locale data files (for correcting errors, customizing date format definitions, etc).

One quick way to achieve this would be to change the CLocale constructor to:

protected function __construct($id)




  $exists = is_file($dataFile);

  if(!$exists) {


    $exists = is_file($dataFile);





    throw new CException(Yii::t('yii','Unrecognized locale "{locale}".',array('{locale}'=>$id)));


This would look first for the locale file inside the application protected/i18n directory, and when not found it would use the default framework location.

Could you please submit a ticket for this? Thanks!

Are there any plans to include this patch or implement the ability to extend the CLocale class in nearest Yii releases?

Currently, Yii v.1.0.11 uses CLocale as a singleton in a number of places and I can’t find the right way to extend it.

I also need this functionality. I didn’t see a ticket so I just created one