You are here

public function SvgEmbedProcess::translate in SVG Embed 8

Same name and namespace in other branches
  1. 2.0.x src/SvgEmbedProcess.php \Drupal\svg_embed\SvgEmbedProcess::translate()

Parameters

string $uuid:

string $langcode:

Return value

string

Overrides SvgEmbedProcessInterface::translate

File

src/SvgEmbedProcess.php, line 35

Class

SvgEmbedProcess
Class SvgEmbedProcess.

Namespace

Drupal\svg_embed

Code

public function translate($uuid, $langcode) : string {
  if ($xml = $this
    ->loadFile($uuid)) {

    //TODO: Go through the DOM and translate all relevant strings, see _svg_embed_translate() in D7
    $xml = str_replace('<?xml version="1.0"?>', '', $xml
      ->asXML());
  }
  return $xml;
}