public function write()
    {
        
        $tf = $this->getTranslationFile();
        $buffer = "<?php\n";
        foreach ($tf->getTranslationUnits() as $tu){
            // Prevent empty messages.
            if ($tu->getSource() != '' && $tu->getTarget() != ''){
                $escapes = array("\\", '$', '"', "\n", "\t", "\v", "\r", "\f");
                $replace = array("\\\\", '\\$', '\\"', "\\n", "\\t", "\\v", "\\r", "\\f");
                $source = str_replace($escapes, $replace, $tu->getSource());
                $target = str_replace($escapes, $replace, $tu->getTarget());
                $buffer .= '$GLOBALS[\'__l10n\']["' . $source . '"]="' . $target . '";' . "\n";
            }
        }
        $buffer .= "\n?>";
        
        file_put_contents($this->getFilePath(), $buffer);
        
    }
public function write()
    {
        
        $tf = $this->getTranslationFile();
        $buffer = "<?php\n";
        foreach ($tf->getTranslationUnits() as $tu){
            // Prevent empty messages.
            if ($tu->getSource() != '' && $tu->getTarget() != ''){
                $escapes = array("\\", '$', '"', "\n", "\t", "\v", "\r", "\f");
                $replace = array("\\\\", '\\$', '\\"', "\\n", "\\t", "\\v", "\\r", "\\f");
                $source = str_replace($escapes, $replace, $tu->getSource());
                $target = str_replace($escapes, $replace, $tu->getTarget());
                $buffer .= '$GLOBALS[\'__l10n\']["' . $source . '"]="' . $target . '";' . "\n";
            }
        }
        $buffer .= "\n?>";
        
        file_put_contents($this->getFilePath(), $buffer);
        
    }
public function write ( ) { $ tf = $ this -> getTranslationFile ( ) ; $ buffer = "<?php\n" ; foreach ( $ tf -> getTranslationUnits ( ) as $ tu ) { // Prevent empty messages. if ( $ tu -> getSource ( ) != '' && $ tu -> getTarget ( ) != '' ) { $ escapes = array ( "\\" , '$' , '"' , "\n" , "\t" , "\v" , "\r" , "\f" ) ; $ replace = array ( "\\\\" , '\\$' , '\\"' , "\\n" , "\\t" , "\\v" , "\\r" , "\\f" ) ; $ source = str_replace ( $ escapes , $ replace , $ tu -> getSource ( ) ) ; $ target = str_replace ( $ escapes , $ replace , $ tu -> getTarget ( ) ) ; $ buffer .= '$GLOBALS[\'__l10n\']["' . $ source . '"]="' . $ target . '";' . "\n" ; } } $ buffer .= "\n?>" ; file_put_contents ( $ this -> getFilePath ( ) , $ buffer ) ; }
Writes the TranslationFile as a PHP compiled file.

@access public
@author Jerome Bogaerts, <jerome.bogaerts@tudor.lu>
@return mixed
Writes the TranslationFile as a PHP compiled file .