samoi Posted March 22, 2009 Share Posted March 22, 2009 Hello, Guys I have a script, and I need to translate it all of it. it's a big script. is there an easy way to translate it? or should I go with it step by step? Thank you in adv. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/ Share on other sites More sharing options...
samoi Posted March 22, 2009 Author Share Posted March 22, 2009 One more thing. if there is any easy way, tell me please or post a link to a tutorial, I couldn't find anything! Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791307 Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 Sorry I've never heard of an easy way to translate scripts, I don't think there is. You would have to do it manually. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791313 Share on other sites More sharing options...
redarrow Posted March 22, 2009 Share Posted March 22, 2009 I am crating one this moment, if you want a copy, then your be waiting 2 hours if interested? Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791325 Share on other sites More sharing options...
Yesideez Posted March 22, 2009 Share Posted March 22, 2009 It is possible to translate one language to another and have a program that does it for you (what do you think a compiler is?) I remember years ago before computers got as complicated as they are now writing a script to translate one language to another was very simple but now it's not so simple. Your best bet is take the script part by part and translate it yourself. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791328 Share on other sites More sharing options...
PFMaBiSmAd Posted March 22, 2009 Share Posted March 22, 2009 Translating a program from one language to another is like translating something written in one linguistic language to another, you must be fluent in both the starting and ending language so that you know that the intent, purpose, and function of the original program is correctly produced in the translation. Since you did not bother to mention the language you want to convert to, no one can give you a specific answer if anything might be available. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791331 Share on other sites More sharing options...
Maq Posted March 22, 2009 Share Posted March 22, 2009 I am crating one this moment, if you want a copy, then your be waiting 2 hours if interested? Are you sure redarrow...? What languages does your software translate to and from? It is possible to translate one language to another and have a program that does it for you (what do you think a compiler is?) What are you talking about, that's totally different than what the OP is asking for. I get your point, but it doesn't help anything... Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791335 Share on other sites More sharing options...
Yesideez Posted March 22, 2009 Share Posted March 22, 2009 I wouldn't say fluent - I've translated from other languages without knowing much, a couple times having to look commands up to see what is going on. A big part also comes down to the complexity of the program/script involved. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791336 Share on other sites More sharing options...
redarrow Posted March 23, 2009 Share Posted March 23, 2009 i use Google translater and it translate all languages. only the words ok. example http://translate.google.com/translate_t?hl=en# to set it up very easy and it the easy way. you can remove the header also, this is also implemented in word press. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791345 Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 I think he was referring to scripting/programming languages... Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791348 Share on other sites More sharing options...
.josh Posted March 23, 2009 Share Posted March 23, 2009 delicious, sweet irony, how I love thee. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791350 Share on other sites More sharing options...
Yesideez Posted March 23, 2009 Share Posted March 23, 2009 I'm feeling privileged that I witnessed that Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791354 Share on other sites More sharing options...
Philip Posted March 23, 2009 Share Posted March 23, 2009 oh my... Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791356 Share on other sites More sharing options...
PFMaBiSmAd Posted March 23, 2009 Share Posted March 23, 2009 Since the OP has not provided any information about what language he wants to translate his big php script to, it is not possible to create anything to accomplish this task. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791359 Share on other sites More sharing options...
.josh Posted March 23, 2009 Share Posted March 23, 2009 nah redarrow has it covered. 2hrs from now, we'll have a working php-to-spanish script. gogogogogo Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791362 Share on other sites More sharing options...
redarrow Posted March 23, 2009 Share Posted March 23, 2009 dam lol, well sorry to say i don't no any language other then php even that i am not any good. i fort you was referring to grammar on a web site page. if i even attempted to convert php to any other language, you can collect the script in my will. so sorry. If it ends up you wanted the web site it self to show another lanuage the url will help. got to lath even got the flags ready. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791367 Share on other sites More sharing options...
Yesideez Posted March 23, 2009 Share Posted March 23, 2009 Crayon - stop - please! I'm off to bed before I wake my fiancee up I'll read this lot tomorrow red - you're a star! Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791370 Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 Hehe, it's ok redarrow, just a mis-communication, it happens... Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791375 Share on other sites More sharing options...
samoi Posted March 23, 2009 Author Share Posted March 23, 2009 Hello guys sorry I made you think of it in another way, my bad ! what I meant is: I have X script, and it's written in English, all the output is English. and I need to translate it t my original language(mother language) so, should I create a file called lang.php and then fill it with codes like <?php $lang[username] = "username translated in arabic"; $lang[password] = "password translated in arabic"; // and so on ?> I hope you got what I mean! useful posts you posted guys Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791405 Share on other sites More sharing options...
redarrow Posted March 23, 2009 Share Posted March 23, 2009 so lads was i right in my way off thinking come on tell me come on lath at me then. programming languages i don't no you big boys/girls . all start bailing come on i WAS RIGHT lol. hi there mate, you can do that with the url i provided, and using curl, and preg match. i am sure those lathing at me can help hay lads Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791406 Share on other sites More sharing options...
.josh Posted March 23, 2009 Share Posted March 23, 2009 dude I don't know why you're sitting there gloating. You admitted you misread it in the first place. Even a blind man will hit the bullseye if he gets enough shots. Too bad he shoots everything else in the process. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791415 Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 so lads was i right in my way off thinking come on tell me come on lath at me then. programming languages i don't no you big boys/girls . all start bailing come on i WAS RIGHT lol. hi there mate, you can do that with the url i provided, and using curl, and preg match. i am sure those lathing at me can help hay lads Why don't you just give him that translation script you said you were working on...? Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791419 Share on other sites More sharing options...
redarrow Posted March 23, 2009 Share Posted March 23, 2009 did not do the script felt so down specially after being so lathed at. I want to no this as weel has mysql got a language pack for your any bodys mother tong to enter info in that language?. in other words is there a translator from English to what ever that mysql can convert on the fly. Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791425 Share on other sites More sharing options...
Maq Posted March 23, 2009 Share Posted March 23, 2009 Are you trying to make fun of my mother? Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791426 Share on other sites More sharing options...
redarrow Posted March 23, 2009 Share Posted March 23, 2009 need more help in converting languages go here. Theres an official Google language API at: http://code.google.com/apis/ajaxlanguage/documentation/ mother tong meaning country language. i would never insult any one especially a user that helps everybody everyday. this code is a pre made class that can convert mother tong languages from any think to any think en|it <<< English to Italian. example. <?php class Google_API_translator { public $opts = array("text" => "", "language_pair" => "en|it"); public $out = ""; function __construct() { echo "Google Translator API\n(c) 2007 Involutive snc http://www.involutive.com\n"; echo "Author: Paolo Ardoino < paolo@involutive.com >"; } function setOpts($opts) { if($opts["text"] != "") $this->opts["text"] = $opts["text"]; if($opts["language_pair"] != "") $this->opts["language_pair"] = $opts["language_pair"]; } function translate() { $this->out = ""; $google_translator_url = "http://translate.google.com/translate_t?langpair=".urlencode($this->opts["language_pair"])."&"; $google_translator_data .= "text=".urlencode($this->opts["text"]); $gphtml = $this->postPage(array("url" => $google_translator_url, "data" => $google_translator_data)); $out = substr($gphtml, strpos($gphtml, "<div id=result_box dir=\"ltr\">")); $out = substr($out, 29); $out = substr($out, 0, strpos($out, "</div>")); $this->out = utf8_encode($out); return $this->out; } // post form data to a given url using curl libs function postPage($opts) { $html = ""; if($opts["url"] != "" && $opts["data"] != "") { $ch = curl_init($opts["url"]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 15); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $opts["data"]); $html = curl_exec($ch); if(curl_errno($ch)) $html = ""; curl_close ($ch); } return $html; } } ?> <?php $g = new Google_API_translator(); $g->setOpts(array("text" => "ciao", "language_pair" => "it|en")); $g->translate(); echo $g->out; ?> For use throught proxy: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PROXY, “http://your.proxy”); curl_setopt($ch, CURLOPT_PROXYPORT, 8080); curl_setopt($ch, CURLOPT_PROXYUSERPWD, “user:pass”); Quote Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/#findComment-791429 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.