src/Xml/XliffFile.php
public function setTargetLanguage($targetLanguage): void
    {
        if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $targetLanguage)) {
            throw new \InvalidArgumentException('Invalid language string: "' . $targetLanguage . '"');
        }
        $this->getFileElement()->setAttributeNS(static::XLIFF_NS, 'target-language', $targetLanguage);
    }
public function setTargetLanguage($targetLanguage): void
    {
        if (!preg_match('#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#', $targetLanguage)) {
            throw new \InvalidArgumentException('Invalid language string: "' . $targetLanguage . '"');
        }
        $this->getFileElement()->setAttributeNS(static::XLIFF_NS, 'target-language', $targetLanguage);
    }
public function setTargetLanguage ( $ targetLanguage ) : void { if ( ! preg_match ( '#[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*#' , $ targetLanguage ) ) { throw new \ InvalidArgumentException ( 'Invalid language string: "' . $ targetLanguage . '"' ) ; } $ this -> getFileElement ( ) -> setAttributeNS ( static :: XLIFF_NS , 'target-language' , $ targetLanguage ) ; }
Set the target language for this file.

@param string $targetLanguage The language code from ISO 639-1.

@return void

@throws \InvalidArgumentException When the language string is invalid.
Set the target language for this file .