Changeset 819
- Timestamp:
- Feb 23, 2015, 12:56:12 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Form.php
r818 r819 205 205 //todo javascript 206 206 207 $Output .= '<script src="'.$ System->Link('/style/jquery.js').'"></script>'.207 $Output .= '<script src="'.$this->System->Link('/style/jquery.js').'"></script>'. 208 208 '<script>'; 209 209 $Output .= '$(document).ready(function() {'; … … 237 237 $Output .= '</form>'; 238 238 239 $Output .= '< table class="BaseTable">'.239 $Output .= '<br/><table class="BaseTable">'. 240 240 '<tr><th>Překladač:</th><th>Nepřeložené</th><th>Přeložené</th>'; 241 241 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) 242 242 if($TextItem['Visible'] == 1) 243 243 if ($LineAJ[$TextItem['Column']] <> '') 244 $Output .= '<tr><td>'.$TextItem['Column'].'</td><td>'.$LineAJ[$TextItem['Column']].'</td><td>'.GetTranslateGoogle($LineAJ[$TextItem['Column']]).'</td></tr>'; 244 $Output .= '<tr><td>'.$TextItem['Column'].'</td>'. 245 '<td>'.$LineAJ[$TextItem['Column']].'</td>'. 246 '<td>'.GetTranslateGoogle($LineAJ[$TextItem['Column']]).'</td></tr>'; 245 247 246 248 -
trunk/includes/Version.php
r818 r819 6 6 // and system will need database update. 7 7 8 $Revision = 81 8; // Subversion revision8 $Revision = 819; // Subversion revision 9 9 $DatabaseRevision = 811; // Database structure revision 10 10 $ReleaseTime = '2015-02-22'; -
trunk/includes/global.php
r816 r819 11 11 include_once(dirname(__FILE__).'/AppModule.php'); 12 12 include_once(dirname(__FILE__).'/Locale.php'); 13 include_once(dirname(__FILE__).'/UTF8.php'); 13 14 require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php'); 14 15 … … 145 146 } 146 147 147 148 function GetTranslateGoogle($text,$withouttitle = false){148 function GetTranslateGoogle($text, $withouttitle = false) 149 { 149 150 global $System; 151 150 152 // $text = 'Balthule\'s letter is dire. This Cult of the Dark Strand is a thorn in my side that must be removed. I have been dealing with some of the Dark Strand scum northeast of here at Ordil\'Aran. One of their number possesses a soul gem that I believe holds the secret to the cult\'s power.$b$bBring it to me, and I will be able to decipher the secrets held within.'; 151 153 // $text = htmlspecialchars($text); 152 154 153 $text = str_replace('$B','$B ', $text);155 $text = str_replace('$B','$B ', $text); 154 156 $text = urlencode($text); 155 157 // $text = strtolower($text); 156 158 // $text = str_replace('&','',$text); 157 159 // $text = str_replace(' ','%20',$text); 158 if ($System->User->Language == 2)159 $lang = 'sk';160 else $lang = 'cs';160 $DbResult = $System->Database->select('Language', 'Code', 'Id='.$System->User->Language); 161 $DbRow = $DbResult->fetch_assoc(); 162 $lang = $DbRow['Code']; 161 163 $url = 'http://translate.google.cz/?sl=en&tl='.$lang.'&text='.$text; 162 164 163 164 165 error_reporting(E_ALL ^ E_WARNING); 165 if (($handle = @fopen($url, "r")) === FALSE) return false;166 if (($handle = @fopen($url, "r")) === FALSE) return(false); 166 167 167 168 $data = stream_get_contents($handle); 168 $data = substr($data, strpos($data, 'result_box'));169 $data = substr($data, strpos($data, '>')+1);170 $data = substr($data, 0, strpos($data, '</div>'));169 $data = substr($data, strpos($data, 'result_box')); 170 $data = substr($data, strpos($data, '>') + 1); 171 $data = substr($data, 0, strpos($data, '</div>')); 171 172 172 173 if ($withouttitle) 173 while ((strpos($data, '>') !== false and strpos($data,'<') !== false) and (strpos($data,'>') > strpos($data,'<')))174 { 175 $partbefore = substr($data, 0, strpos($data, '<'));174 while ((strpos($data, '>') !== false and (strpos($data, '<') !== false)) and (strpos($data, '>') > strpos($data, '<'))) 175 { 176 $partbefore = substr($data, 0, strpos($data, '<')); 176 177 // echo $partbefore; 177 $partafter = substr($data, strpos($data, '>')+1);178 $partafter = substr($data, strpos($data, '>') + 1); 178 179 // echo $partafter; 179 180 $data = $partbefore.' '.$partafter; 180 181 } 181 182 182 $data = utf8_encode($data); 183 184 $data = str_replace('$ ','$',$data); 185 $data = str_replace('$b $b','$b$b',$data); 186 $data = str_replace('| ','|',$data); 187 188 return $data; 183 $Encoding = new Encoding(); 184 $data = $Encoding->ToUTF8($data); 185 //$data = utf8_encode($data); 186 187 $data = str_replace('$ ', '$',$data); 188 $data = str_replace('$b $b', '$b$b', $data); 189 $data = str_replace('| ', '|', $data); 190 191 return($data); 189 192 } 190 193
Note:
See TracChangeset
for help on using the changeset viewer.