public function addLanguage($lang = '', $prefix = '', $dir = null, $min = false)
    {
        if (empty($lang) || substr($lang, 0, 2) == 'en') {
            return $this;
        }

        $ext = $min ? (YII_DEBUG ? ".min.js" : ".js") : ".js";
        $file = "{$prefix}{$lang}{$ext}";
        if ($dir === null) {
            $dir = 'js';
        } elseif ($dir === "/") {
            $dir = '';
        }

        $path = $this->sourcePath . '/' . $dir;
        if (!Env::fileExists("{$path}/{$file}")) {
            $lang = Env::getLang($lang);
            $file = "{$prefix}{$lang}{$ext}";
        }

        if (Env::fileExists("{$path}/{$file}")) {
            $this->js[] = empty($dir) ? $file : "{$dir}/{$file}";
        }

        return $this;
    }