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)
{
$this->_id=self::getCanonicalID($id);
$dataFile=Yii::getPathOfAlias('application').DIRECTORY_SEPARATOR.'i18n'.DIRECTORY_SEPARATOR.$this->_id.'.php';
$exists = is_file($dataFile);
if(!$exists) {
$dataFile=dirname(__FILE__).DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.$this->_id.'.php';
$exists = is_file($dataFile);
}
if($exists)
$this->_data=require($dataFile);
else
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.