Ruin the Google Translator interface program
To achieve the same as Google Translate, put on your own web page.
http://translate.google.cn/
How to write this interface?
First, I ran to the Google home to turn. The results are all in English. Can not understand Ah, can not understand.
Second, I search the internet, found is no use. Please provide a work-in.
Third, the online search, only a C + + write interface is not tested. My is the PHP page. The interface of PHP or JS is asked.
Four: no points, all put in.
------Solution--------------------
Http://code.google.com/intl/en/apis/language/translate/v2/getting_started.html
In this article E, it should not be difficult to read a general idea.
Call:https://www.googleapis.com/language/translate/v2?key=insert-your-key&q=hello%20world&source=en& Target=zh-cn
Return data as JSON
Get Parameters:
Key needs to apply to Google
Q Text to be translated
SOURCE language specified
Target Specifies the destination language
Example:
HTML code
Translate API Example Hello World
------Solution--------------------
Take it, Yahoo yql query Google Translate
The default language is translated into English in other languages. The target language should be replaced by the following target= "en"
//Change to ZH-CN is translated into Simplified Chinese.
PHP code
YUI3 Google Translate YQL