first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
abstract class WPML_TM_Xliff_Reader extends WPML_TM_Xliff_Shared {
/**
* @param string $content Xliff file string content
*
* @return array
*/
abstract public function get_data( $content );
/**
* Parse a XML containing the XLIFF
*
* @param string $content
*
* @return SimpleXMLElement|WP_Error The parsed XLIFF or a WP error in case it could not be parsed
*/
public function load_xliff( $content ) {
try {
$xml = simplexml_load_string( $content );
} catch ( Exception $e ) {
$xml = false;
}
return $xml ? $xml
: new WP_Error(
'not_xml_file',
sprintf(
__( 'The xliff file could not be read.', 'wpml-translation-management' )
)
);
}
}