View Full Version : Help with code to translate entire webpage using google translate

07-16-2011, 08:00 AM
First of all, I read the rules regarding how to post a question on the forums, and I couldn't think of a much better description, so I hope thats okay.

My problem is this, I am using a simple code (Posted Below) that creates a drop-down menu containing a list of languages, when any of these languages are clicked it sends the user to Google translate to automatically convert the text. The code works fine, but now Im realizing I have no way of knowing which languages are chosen and how often. I have tried linking it to my Google Analytics but to no avail. The only solution I can think of is to send the user to maybe a PHP file that then redirects them to the Google translate page, so I can monitor it by viewing how many times the redirect page was viewed.

I already use this redirect technique to track how many users follow my links to external downloads, so I know its probable.

But my real question is how would I go about sending the user to a redirect page? I'm a novice web developer by the way. I'm thinking I would have to send the variable containing language to the redirect, along with a variable containing the URL to be translated, and then have the redirect input the data same as the original form.

But even if this is possible, I don't know how to go about it. Any help would be greatly appreciated.

<select name="translate" style="height:18px; font-size:10px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option>
<option value="ar">Arabic</option>


<option value="es">Spanish</option>

low tech
07-16-2011, 11:41 AM
check your pm.


07-16-2011, 10:06 PM