Jump to content

Recommended Posts

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.

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.

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...

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.

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.

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.

 

 

 

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 :)

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

 

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...?

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.

 

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”);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.