public function write() {
        
        $path = $this->getFilePath();
        $strings = array();
        
        foreach ($this->getTranslationFile()->getTranslationUnits() as $tu) {
            if ($tu->getTarget() !== ''){
                $strings[$tu->getSource()] = $tu->getTarget();   
            }
        }

        $buffer = json_encode($strings, JSON_HEX_QUOT | JSON_HEX_APOS);
        if(!file_put_contents($path, $buffer)){
                throw new tao_helpers_translation_TranslationException("An error occured while writing Javascript " .
                                                                                                                           "translation file '${path}'.");
        }
        
    }