Results 1 to 6 of 6
-
9th Dec 2011, 06:03 PM #1OPMember
need translate script
hi, i am searching for a translate script like http://www.microsofttranslator.com/
it should use microsoft api, not google translate api.
if u can offer me for free i'll be thank full
or else my budget is 10 dollar with moneybookers only.peterpetroli Reviewed by peterpetroli on . need translate script hi, i am searching for a translate script like http://www.microsofttranslator.com/ it should use microsoft api, not google translate api. if u can offer me for free i'll be thank full :P or else my budget is 10 dollar with moneybookers only. Rating: 5
-
10th Dec 2011, 04:06 AM #2Respected MemberWebsite's:
DL4Everything.com Soft2050.inMicrosoft already has a widget which you can place in your website to translate it quickly.
-
10th Dec 2011, 05:46 AM #3Too busy :|Website's:
L337Fx.com BeastieBay.netYeah, just try out the widget. Its pretty neat though
-
28th Dec 2011, 09:25 PM #4OPMember
no i dont need something to translate my site, but i need a script with bing translate api to translate words and sentence. just like a dictionary.
-
28th Dec 2011, 11:17 PM #5MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comfor what purpose? maybe that will give us a clearer idea
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
29th Dec 2011, 03:39 AM #6MemberPHP Code:
<?php
class Translator {
// TRUE to enable print_r etc later on
private $debugging = false;
public function Translate($source_lang = "", $source = "Hello", $dest_lang = "et") {
// We generate some headers for the file_get_contents() function to make the request look more legit
$headers = stream_context_create(array("http" => array("method" => "GET", "header" => "Accept-Charset: utf-8;q=0.7,*;q=0.3\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7\r\nAccept: */*\r\nReferer: http://www.microsofttranslator.com/")));
// We use a regular expression to extract the translated part from the response
preg_match('!TranslatedText":"(.+?)","Tra!', file_get_contents("http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray?appId=%22TNDJ9zfD_HXiAgFDKfCLz8fg92HEHFGOb93cdM6nxohI*%22&texts=[%22".urlencode($source)."%22]&from=%22".$source_lang."%22&to=%22".$dest_lang."%22&oncomplete=_mstc1&onerror=_mste1&loc=en&ctr=England&rgp=d18478d", null, $headers), $translated);
// In case we ever need to debug
if($this->debugging)print_r($translated);
// If the regular expression works like a charm, then return the translation, otherwise return false
return (!empty($translated[1])) ? $translated[1] : false;
}
}
// We use UTF-8 to avoid problems with tricky letters
header("Content-type: text/html; charset=utf-8");
// We initialise a new class
$translator = new Translator;
// We run the function that takes 3 arguments at most (leave the first one empty to use automatic detection)
echo $translator->Translate("", "Hey there, how are you?", "es");
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Translate page
By skinner in forum Web Development AreaReplies: 1Last Post: 1st May 2012, 01:35 PM -
How to translate a template ?
By Debaldus in forum DLEReplies: 9Last Post: 20th Feb 2012, 07:58 PM -
DLE translate tuto
By milooot in forum Webmaster DiscussionReplies: 3Last Post: 3rd Aug 2011, 05:23 PM -
Can someone translate this for me
By kohkindachi in forum Technical Help Desk SupportReplies: 2Last Post: 3rd Oct 2010, 01:34 PM -
How would you translate this in PHP ?
By Porsche_maniak in forum Webmaster DiscussionReplies: 33Last Post: 30th Apr 2010, 03:09 AM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...