Can I translate my site using Google Translate?

I have a webpage created in English. Depending on the continent, I want to dynamically translate my entire web page into another language.

The webpage is quite complex, so I cannot execute it with a string. I just want to do it the way that at boot time, it will be translated into the desired language.

Can I translate my webpage using the Google Translate API?

+4
source share
5 answers

Here is an example of adding a Google translator to a web page to translate a specific item:

<html> <head> <title>My Page</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <div class="translate"></p> <div class="translate_control" lang="en"></div> <script> function googleSectionalElementInit() { new google.translate.SectionalElement({ sectionalNodeClassName: 'translate', controlNodeClassName: 'translate_control', background: '#f4fa58' }, 'google_sectional_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script> </body> </html> 

http://jsfiddle.net/maxim75/H3Wkr/ - working example

+5
source

You can add the Google Translate widget to your page, and users can translate into their language on demand. http://www.google.com/webelements/#!/translate

+1
source

When visiting the Google translation tool , it generates the code that you add to your site.

It is also possible directly using the URL

 http://www.google.com/translate?sl=XX&tl=YY&u=http://www.trial.com 

where xx is the source language, yy is the language to translate ...

Maybe my tutorial will be useful: google translate .

+1
source

Yes, you can. See the Google Translate API documentation here: http://code.google.com/apis/language/translate/v2/getting_started.html

Please note that automated machine translation since 2011 is not an adequate match for human translation, so do not expect the translated text to be perfect - it will probably be understood with effort, but it will be obvious that this is a machine translated.

0
source

Perhaps you can use the microsoft API. You can find the implementation at http://code.google.com/p/micrsoft-translator-php-wrapper/ and you can also see the demo http://renjith.co.in/translate/

0
source

Source: https://habr.com/ru/post/1338998/


All Articles