What should I do if I try google's online translation interface program?

Source: Internet
Author: User
Google's online translation interface program needs to be put on its own webpage like google Translate. How can I write this interface in translate.google.cn? 1. I went to google's house to flip it. The results are all in English. You can't understand it. 2. I searched online and found none of them. Please provide usable. 3. Only one C ++ written interface is not tested. My PHP page is used. Evaluate the PHPorJS interface. Google online translation interface program
You need to put it on your webpage like Google Translate.
Http://translate.google.cn/

How to write this interface?

1. I went to google's house to flip it. The results are all in English. You can't understand it.

2. I searched online and found none of them. Please provide usable.

3. Only one C ++ written interface is not tested. My PHP page is used. Evaluate the PHP or JS interface.


4: no points, all invested.

------ Solution --------------------
Http://code.google.com/intl/en/apis/language/translate/v2/getting_started.html
In this article, it is not difficult to understand the meaning ..

Call: https://www.googleapis.com/language/translate/v2? Key = INSERT-YOUR-KEY & q = hello % 20 world & source = en & target = zh-CN
The returned data is in JSON format.

GET parameters:
Key needs to be applied to Google
Q. text to be translated
Source specifies the source language
Target specifies the target language

Example:
HTML code
      Translate API Example        

Hello world

Script function translateText (response) {document. getElementById ("translation"). innerHTML + ="
"+ Response. data. translations [0]. translatedText;} script var newScript = document. createElement ('script'); newScript. type = 'text/javascript '; var sourceText = escape (document. getElementById ("sourceText "). innerHTML); var source = 'https: // www.googleapis.com/language/translate/v2? Key = INSERT-YOUR-KEY & source = en & target = de & callback = translateText & q = '+ sourceText; newScript. src = source; // When we add this script to the head, the request is sent off. document. getElementsByTagName ('head') [0]. appendChild (newScript); script
------ Solution --------------------
Get it, Yahoo YQL query GOOGLE translation
The default language is translated into English in other languages. To replace the target language with the following target = "en"
// If it is changed to zh-cn, other languages are translated into simplified Chinese.
PHP code
            
            YUI3 Google Translate YQL        

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.