Hi All!
I have a working dropdown language selector powered by google that loads the page in your chosen langauge:
[code=html]
<p align="center"> <font size="2">Transl ate :
<SCRIPT language=javasc ript1.2 type=text/javascript>docu ment.write('
<select name="to_lang" onchange="lp=th is.options[this.selectedIn dex].value; if(lp!=\'\') window.location =\'http://www.google.com/translate?hl=en &ie=UTF-8&oe=UTF-8&u=http://WWW.WEBSITE.COM/PAGE.ASP</select>
[/code]
From here, i've done two things:
- Got rid of the "google frame" onload:
[code=javascript]
<script language="JavaS cript1.1" type="text/JavaScript"> if (parent.frames. length > 0) top.location.re place(document. location);</script>
[/code]
then it works also when putting:
'http://www.google.com/translate?hl=en &ie=UTF-8&oe=UTF-8&u=[code=javascript]
' + location.href +'[/code]&langpair=\'+lp ;"
to make the code load that specific page you're on, so I don't have to cut & paste the URL constantly in the code...
PROBLEM is, as soon as you start adding css styles to the pages, it freaks!
the styles go all over the place!
Is there a way to make some sort of <p class="translat e"> or something that when you click a flag, it loads the translated script from google???
Any ideas?
Thanks!
=)
I have a working dropdown language selector powered by google that loads the page in your chosen langauge:
[code=html]
<p align="center"> <font size="2">Transl ate :
<SCRIPT language=javasc ript1.2 type=text/javascript>docu ment.write('
<select name="to_lang" onchange="lp=th is.options[this.selectedIn dex].value; if(lp!=\'\') window.location =\'http://www.google.com/translate?hl=en &ie=UTF-8&oe=UTF-8&u=http://WWW.WEBSITE.COM/PAGE.ASP</select>
[/code]
From here, i've done two things:
- Got rid of the "google frame" onload:
[code=javascript]
<script language="JavaS cript1.1" type="text/JavaScript"> if (parent.frames. length > 0) top.location.re place(document. location);</script>
[/code]
then it works also when putting:
'http://www.google.com/translate?hl=en &ie=UTF-8&oe=UTF-8&u=[code=javascript]
' + location.href +'[/code]&langpair=\'+lp ;"
to make the code load that specific page you're on, so I don't have to cut & paste the URL constantly in the code...
PROBLEM is, as soon as you start adding css styles to the pages, it freaks!
the styles go all over the place!
Is there a way to make some sort of <p class="translat e"> or something that when you click a flag, it loads the translated script from google???
Any ideas?
Thanks!
=)
Comment