Text.php
protected function readFileContents($language)
    {
        $fileName = $this->getFileName($language);
        $fs = $this->env->getFileSystem();
        if (!$fs->fileExists($fileName)) {
            return array();
        }
        $content = json_decode(preg_replace('/^.*?define\((.*)\);\s*/s', '$1', $fs->getFile($fileName)), true);
        if ($language === $this->baseLang) {
            $content = $content['root'];
        }

        $outdateInfo = [];
        $fileName = $this->getOutdateInfoFileName($language);
        if ($fs->fileExists($fileName)) {
            $outdateInfo = json_decode($fs->getFile($fileName), true);
        }
        foreach ($content as $id => $text) {
            $outdated = isset($outdateInfo[$id]) ? $outdateInfo[$id] : true;
            $content[$id] = array('id' => $id, 'name' => $id, 'content' => $text, 'outdated' => $outdated);
        }

        return $content;
    }
protected function readFileContents($language)
    {
        $fileName = $this->getFileName($language);
        $fs = $this->env->getFileSystem();
        if (!$fs->fileExists($fileName)) {
            return array();
        }
        $content = json_decode(preg_replace('/^.*?define\((.*)\);\s*/s', '$1', $fs->getFile($fileName)), true);
        if ($language === $this->baseLang) {
            $content = $content['root'];
        }

        $outdateInfo = [];
        $fileName = $this->getOutdateInfoFileName($language);
        if ($fs->fileExists($fileName)) {
            $outdateInfo = json_decode($fs->getFile($fileName), true);
        }
        foreach ($content as $id => $text) {
            $outdated = isset($outdateInfo[$id]) ? $outdateInfo[$id] : true;
            $content[$id] = array('id' => $id, 'name' => $id, 'content' => $text, 'outdated' => $outdated);
        }

        return $content;
    }
protected function readFileContents ( $ language ) { $ fileName = $ this -> getFileName ( $ language ) ; $ fs = $ this -> env -> getFileSystem ( ) ; if ( ! $ fs -> fileExists ( $ fileName ) ) { return array ( ) ; } $ content = json_decode ( preg_replace ( '/^.*?define\((.*)\);\s*/s' , '$1' , $ fs -> getFile ( $ fileName ) ) , true ) ; if ( $ language === $ this -> baseLang ) { $ content = $ content [ 'root' ] ; } $ outdateInfo = [ ] ; $ fileName = $ this -> getOutdateInfoFileName ( $ language ) ; if ( $ fs -> fileExists ( $ fileName ) ) { $ outdateInfo = json_decode ( $ fs -> getFile ( $ fileName ) , true ) ; } foreach ( $ content as $ id => $ text ) { $ outdated = isset ( $ outdateInfo [ $ id ] ) ? $ outdateInfo [ $ id ] : true ; $ content [ $ id ] = array ( 'id' => $ id , 'name' => $ id , 'content' => $ text , 'outdated' => $ outdated ) ; } return $ content ; }
Reads the contents of a language file and returns it.

@param string $language language code
@return array
Reads the contents of a language file and returns it .