24 if (!
$element instanceof \SimpleXMLElement) {
44 libxml_use_internal_errors(
true);
45 $xml = simplexml_load_file($file);
46 libxml_use_internal_errors(
false);
48 $nodes = $xml->xpath(
'//*[@translate|@translatable]');
51 return is_array($nodes) ? $nodes : [];
64 private function parseTranslatableNodes(\SimpleXMLElement
$attributes, \SimpleXMLElement
$element)
66 $nodesDelimiter = strpos(
$attributes[
'translate'],
' ') ===
false ?
',' :
' ';
72 $elementAttributes =
$element->attributes();
73 if (isset($elementAttributes[
$value])) {
74 $phrase = (string)$elementAttributes[
$value];
_addPhrase($phrase, $line='')