noumo / easyii-shop

Easyiicms simple shop with examples of all modules
96 stars 61 forks source link

Redactor language config error in lang zh-CN #5

Closed robinclark007 closed 8 years ago

robinclark007 commented 8 years ago

if I change language settings in the easyii.php 'language' => 'zh-CN',

the redactor will try to locate the zh.js according to the

Data::getLocale(); //return zh ,this make no sense in substr(Yii::$app->language, 0, 2) because the translation file named zh_cn.js so it won't find the right js file. so I recommend change the code in the get locale function in the helpers/Data

    public static function getLocale()
    {
        //fix inconsistence between En and Cn translation
        if(Yii::$app->language === 'zh-CN'){
          return 'zh_cn';
        }
        return strtolower(substr(Yii::$app->language, 0, 2));
    }
noumo commented 8 years ago

fixed in dev branch