By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

English to Chinese conversion

P: 32

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

May 14 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 5,821
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:

Expand|Select|Wrap|Line Numbers
  1. $translation = file_get_contents("" . urlencode($_POST['text']) . "&langpair=en|zh-CN");
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:
Expand|Select|Wrap|Line Numbers
  1. <input type=hidden name=gtrans value="...translated text here...">
May 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.