Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function process($text, $targetLanguage) |
||
17 | { |
||
18 | $result = $this->client->translate($text, |
||
19 | ['target' => $targetLanguage] |
||
20 | ); |
||
21 | |||
22 | if (isset($result['text']) && strlen($result['text']) > 0) { |
||
23 | $output = preg_replace("/&/", "&", $result['text']); |
||
24 | $output = preg_replace("/'/", "'", $output); |
||
25 | |||
26 | return $output; |
||
27 | } |
||
28 | |||
29 | return $text; |
||
30 | } |
||
32 |