@@ -118,7 +118,7 @@ |
||
118 | 118 | if ($this->debug === true) { |
119 | 119 | $this->translation = "<font style='color:#00CC00;'>Translation loaded from DB</font>"; |
120 | 120 | } else { |
121 | - $this->translation = $existing[0]->translation; |
|
121 | + $this->translation = $existing[ 0 ]->translation; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | return true; |
@@ -5,42 +5,42 @@ |
||
5 | 5 | class MymemoryTrans extends Translation |
6 | 6 | { |
7 | 7 | /** |
8 | - * Get translation from mymemory API. |
|
9 | - */ |
|
10 | - public function main() |
|
11 | - { |
|
12 | - $host = 'api.mymemory.translated.net'; |
|
8 | + * Get translation from mymemory API. |
|
9 | + */ |
|
10 | + public function main() |
|
11 | + { |
|
12 | + $host = 'api.mymemory.translated.net'; |
|
13 | 13 | |
14 | - // Check if host is online. |
|
15 | - if ($this->checkHost($host)) { |
|
14 | + // Check if host is online. |
|
15 | + if ($this->checkHost($host)) { |
|
16 | 16 | |
17 | - // Host online |
|
18 | - $urlString = urlencode($this->string); |
|
19 | - $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to"; |
|
20 | - $json = file_get_contents($url); |
|
21 | - $data = json_decode($json); |
|
17 | + // Host online |
|
18 | + $urlString = urlencode($this->string); |
|
19 | + $url = "http://$host/get?q=$urlString&langpair=$this->from%7C$this->to"; |
|
20 | + $json = file_get_contents($url); |
|
21 | + $data = json_decode($json); |
|
22 | 22 | |
23 | - // Checking response status |
|
24 | - if ($data->responseStatus != 200) { |
|
25 | - if ($this->debug == true) { |
|
26 | - $details = $data->responseDetails; |
|
27 | - if ($data->responseStatus == 403) { |
|
28 | - $details = ($data->responseDetails); |
|
29 | - } |
|
30 | - $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>'; |
|
31 | - } |
|
23 | + // Checking response status |
|
24 | + if ($data->responseStatus != 200) { |
|
25 | + if ($this->debug == true) { |
|
26 | + $details = $data->responseDetails; |
|
27 | + if ($data->responseStatus == 403) { |
|
28 | + $details = ($data->responseDetails); |
|
29 | + } |
|
30 | + $this->translation = "<font style='color:red;'>Error ".$data->responseStatus.': '.$details.'</font>'; |
|
31 | + } |
|
32 | 32 | |
33 | - return; |
|
34 | - } |
|
33 | + return; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - $transObtained = $data->responseData->translatedText; |
|
37 | + $transObtained = $data->responseData->translatedText; |
|
38 | 38 | |
39 | - $this->translation = ucfirst(strtolower(trim($transObtained))); |
|
39 | + $this->translation = ucfirst(strtolower(trim($transObtained))); |
|
40 | 40 | |
41 | - $this->checkSave(); |
|
41 | + $this->checkSave(); |
|
42 | 42 | |
43 | - return; |
|
44 | - } |
|
45 | - } |
|
43 | + return; |
|
44 | + } |
|
45 | + } |
|
46 | 46 | } |
@@ -5,10 +5,10 @@ |
||
5 | 5 | class Exception extends Translation |
6 | 6 | { |
7 | 7 | /** |
8 | - * Get translation from mymemory API. |
|
9 | - */ |
|
10 | - public function main() |
|
11 | - { |
|
12 | - // Check if it can be translated from online sources. |
|
13 | - } |
|
8 | + * Get translation from mymemory API. |
|
9 | + */ |
|
10 | + public function main() |
|
11 | + { |
|
12 | + // Check if it can be translated from online sources. |
|
13 | + } |
|
14 | 14 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | public static function trans($string) |
12 | 12 | { |
13 | 13 | $translator = config('laralang.default.translator'); |
14 | - if (!in_array(config('laralang.default.translator'), ['apertium', 'mymemory'])) { |
|
14 | + if (!in_array(config('laralang.default.translator'), [ 'apertium', 'mymemory' ])) { |
|
15 | 15 | return new Exception("<font style='color:red;'>Laralang doesn't support $translator translator. Check config</font>"); |
16 | 16 | } else { |
17 | 17 | if (config('laralang.default.translator') == 'mymemory') { |