Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-16-2011, 07:00 AM   PM User | #1
H3mp
New Coder

 
Join Date: Jul 2011
Location: Pennsylvania
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
H3mp is an unknown quantity at this point
Lightbulb Help with code to translate entire webpage using google translate

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.

Quote:
<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>

...LIST OF OTHER LANGUAGES

<option value="es">Spanish</option>
</select>
H3mp is offline   Reply With Quote
Old 07-16-2011, 10:41 AM   PM User | #2
low tech
Regular Coder

 
low tech's Avatar
 
Join Date: Dec 2009
Posts: 740
Thanks: 149
Thanked 67 Times in 67 Posts
low tech is on a distinguished road
Hi
check your pm.

LT
low tech is offline   Reply With Quote
Old 07-16-2011, 09:06 PM   PM User | #3
H3mp
New Coder

 
Join Date: Jul 2011
Location: Pennsylvania
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
H3mp is an unknown quantity at this point
anybody?
H3mp is offline   Reply With Quote
Reply

Bookmarks

Tags
google, google translate, javascript, translate

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:40 PM.


Advertisement
Log in to turn off these ads.