Converts an exported file content back to the translated data.
string $imported_file: Path to a file or an XML string to import.
bool $is_file: (optional) Whether $imported_file is the path to a file or not.
Translated data array.
Overrides FormatInterface::import
public function import($imported_file, $is_file = TRUE) {
if ($this
->getImportedXML($imported_file, $is_file) === FALSE) {
return FALSE;
}
$phase = $this->importedXML
->xpath("//xliff:phase[@phase-name='extraction']");
$phase = reset($phase);
$job = Job::load((string) $phase['job-id']);
return \Drupal::service('tmgmt.data')
->unflatten($this
->getImportedTargets($job));
}