Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2011
    Location
    Pennsylvania
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.

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

  • #2
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    836
    Thanks
    172
    Thanked 90 Times in 90 Posts
    Hi
    check your pm.

    LT

  • #3
    New Coder
    Join Date
    Jul 2011
    Location
    Pennsylvania
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anybody?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •