View Single Post
Old 11-08-2012, 12:49 PM   PM User | #9
Ace.....
New Coder

 
Join Date: Nov 2012
Location: France
Posts: 78
Thanks: 20
Thanked 0 Times in 0 Posts
Ace..... is an unknown quantity at this point
Quote:
Originally Posted by xelawho View Post
that would be where your callback would come into it. How are you sending the text to be translated? Maybe you can post some more code, or a link?
1. Launch command (iframe container page):
Code:
#googtrans(en|fr)

This anchor doesn't exist on iframe_2.html, however this is the 1st command to tell the browser to send the whole dom to google, once the page has fully loaded (this I assume from logic).

It tells google to expect it in English, and to Return it in French.
Code:
<iframe name="iframe2" src="iframe_2.html#googtrans(en|fr)">
2. The Header code (on page requiring translation - iframe2)

Code:
<meta name="google-translate-customization" content="f3ec1860041f93e1-f800c17a206199a4-g305246f186c2820d-15">
The above is part one of two sections of code.
The numbers I presume identify my site, and translation preferences, gleaned from my responses to their form.
3. The Body code (on page requiring translation - iframe2)

Code:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() 
{
  new google.translate.TranslateElement({pageLanguage: 'fr', includedLanguages: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
What do we know about the above:

pageLanguage: 'fr',

The language of your web site, presumably speeds up the process, so it can offer a visitor french to chinese translation on the fly.

includedLanguages: 'en',

These are the languages that appear in a drop box, so you can choose your language.

layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false

This is the style of the drop box.
The Links:

http://translate.google.com/

Then click the link

http://www.google.com/url?source=tra...ite/%3Fhl%3Den


I'm gonna look for the chrome console log, as it is jam packed with info on what is going on.
Ace..... is offline   Reply With Quote