English to Chinese conversion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suresh_nsnguys
    New Member
    • Aug 2006
    • 32

    English to Chinese conversion

    Hi,

    I am having 2 text boxes with label 'English' and 'chinese'.If i enter some English text in 'English' text box and press submit button.I need to display the chinese text for that English text in the chinese text box.and also for Vice versa

    I don't know how to convert from English text to chinese text .Whether its possible to convert using PHP.

    I saw some sample websites.They implemented this same functionality using 'JSP'.

    I am looking for some help or source code from you guys

    A.suresh
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Do you need to process the translated text, or do you just need to display the translation?

    You could just pass your data as a parameter to Google's translate service:

    [code=php]
    $translation = file_get_conten ts("http://translate.googl e.com/translate_t?tex t=" . urlencode($_POS T['text']) . "&langpair=en|z h-CN");
    [/code]

    Now, I've heard (though I can't prove) that Google's translate API isn't due out for a few years, so until then, I'm afraid that it's up to you to parse this monstrosity.

    Here's the text you're looking for:
    [code=html]
    <input type=hidden name=gtrans value="...trans lated text here...">
    [/code]

    Comment

    Working...