Ignore:
Timestamp:
Jan 10, 2014, 11:06:39 PM (11 years ago)
Author:
maron
Message:
  • Added: in addon version 1.12.1 translate NPC action text and title quest text in NPC frame
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/global.php

    r745 r746  
    144144
    145145function GetTranslateGoogle($text) {
    146 
     146  global $System;
    147147//  $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.';
    148148 // $text = htmlspecialchars($text);
     149 
     150  $text = str_replace('$B','$B ',$text);
    149151  $text = urlencode($text);
     152 // $text = strtolower($text);
    150153//  $text = str_replace('&','',$text);
    151154//  $text = str_replace(' ','%20',$text);
    152  // $text = str_replace('$B','$B%20',$text);
    153   $url = 'http://translate.google.cz/?sl=en&tl=cs&text='.$text;
     155  if ($System->User->Language == 2)
     156    $lang = 'sk';
     157  else $lang = 'cs';
     158  $url = 'http://translate.google.cz/?sl=en&tl='.$lang.'&text='.$text;
    154159
    155160
     
    169174    $data = $partbefore.' '.$partafter;
    170175  }
     176 
     177  $data = utf8_encode($data);
    171178
    172179  $data = str_replace('$ ','$',$data);
     180  $data = str_replace('$b $b','$b$b',$data);
    173181  $data = str_replace('| ','|',$data);
    174182 
Note: See TracChangeset for help on using the changeset viewer.