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}'.");
        }
        
    }
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}'.");
        }
        
    }
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}'." ) ; } }
Write a javascript AMD module that provides translations
for the target languages.

@access public
@return mixed
Write a javascript AMD module that provides translations for the target languages .