| @@ -156,13 +156,13 @@ | ||
| 156 | 156 |  $( function() { | 
| 157 | 157 |  	$('#delete').click(function() { | 
| 158 | 158 |  		<?php $url_route = url('/').'/'.config('laralang.default.prefix').'/delete'; | 
| 159 | - ?> | |
| 159 | + ?> | |
| 160 | 160 |  		$.get("{{ $url_route }}"+'/'+$('.trans-id').val()); | 
| 161 | 161 | }); | 
| 162 | 162 |  	$('#edit').click(function() { | 
| 163 | 163 |  		var translation = $('.input-trans').val(); | 
| 164 | 164 |  		<?php $url_route = url('/').'/'.config('laralang.default.prefix').'/edit'; | 
| 165 | - ?> | |
| 165 | + ?> | |
| 166 | 166 |  		$.get("{{ $url_route }}"+'/'+$('.trans-id').val()+'/'+translation); | 
| 167 | 167 | }); | 
| 168 | 168 | |
| @@ -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 | } |