private function writeTextsToFile($language)
    {
        $textInfo = array();
        $outdateInfo = array();
        foreach ($this->contents[$language] as $id => $info) {
            $textInfo[$id] = $info['content'];
            $outdateInfo[$id] = $info['outdated'];
        }
        if ($language === $this->baseLang) {
            $content = array('root' => $textInfo) + array_fill_keys($this->extraLangs, true);
        } else {
            $content = $textInfo;
        }
        $encodeFlags = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES;
        $content = "'use strict';\n/*global define*/\ndefine(" . json_encode($content, $encodeFlags) . ");\n";
        $fs = $this->env->getFileSystem();
        $fs->putFile($this->getFileName($language), $content);
        $fs->putFile($this->getOutdateInfoFileName($language), json_encode($outdateInfo, $encodeFlags));
    }