protected function useLanguage()
    {
        $this->language = Utility::get($this->params, "language");
        if ($this->language!==null) {
            if (gettype($this->language)=="string") {
                $languageFile = $this->getWidgetFolder()
                    ."/languages/"
                    .Utility::getClassName($this)
                    ."."
                    .strtolower($this->language)
                    .".json";
                if (is_file($languageFile)) {
                    $this->languageMap = json_decode(
                        file_get_contents($languageFile),
                        true
                    );
                } else {
                    throw new \Exception("Could not load [$this->language] language file.");
                }
            } else {
                $this->languageMap = $this->language;
            }
        }
    }