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
source share