hello.....

just now i saw "TranslateThis Button" which is the script for translate the webpage using javascript. it is more faster than google translation. is there any chance to display language flags(ex: only four flags) with out dropdown? please help me.check it here http://translateth.is/

Recommended Answers

All 6 Replies

Member Avatar for rajarajan2017

http://x.translateth.is/translate-this.js

Download their source and analyse the code to implement your needs. But it refers to their site, So I am not sure about customization.

<form action="http://www.google.com/translate" >

<script language="JavaScript">
<!--
document.write ("<input name=u value="+location.href+" type=hidden>")
// -->
</script>

<input name="hl" value="en" type="hidden">

<input name="ie" value="UTF8" type="hidden">

<input name="langpair" value="" type="hidden">

<input name="langpair" value="en|fr" title="French" src= "http://photos1.blogger.com/img/43/1633/320/13539949_e76af75976.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|de" title="German" src= "http://photos1.blogger.com/img/43/1633/320/13539933_041ca1eda2.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|it" title="Italian" src= "http://photos1.blogger.com/img/43/1633/320/13539953_0384ccecf9.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|pt" title="Portuguese" src= "http://photos1.blogger.com/img/43/1633/320/13539966_0d09b410b5.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

</form>

you can also mannually create flag buttons like this.

http://x.translateth.is/translate-this.js

Download their source and analyse the code to implement your needs. But it refers to their site, So I am not sure about customization.

thamks for your reply rajan.

i am trying to change but cant working. they specified in this link it is possible. http://translateth.is/faq

How do I enable Google Analytics tracking?

To enable Google Analytics tracking, pass the option GA set to true:

<!-- Begin TranslateThis Button -->

<div id="translate-this"><a href="http://translateth.is/"
class="translate-this-button">Translate</a></div>

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript"
src="http://x.translateth.is/translate-this.js"></script>
<script type="text/javascript">
TranslateThis({
  GA : true
});
</script>

<!-- End TranslateThis Button -->

Then the TranslateThis Button will handle the rest, tracking each language translation as a pageview such as 'TranslateThis-es' for Spanish.

see the last lines. is there any chance to call with individually images without displaying languages in dropdown.

<form action="http://www.google.com/translate" >

<script language="JavaScript">
<!--
document.write ("<input name=u value="+location.href+" type=hidden>")
// -->
</script>

<input name="hl" value="en" type="hidden">

<input name="ie" value="UTF8" type="hidden">

<input name="langpair" value="" type="hidden">

<input name="langpair" value="en|fr" title="French" src= "http://photos1.blogger.com/img/43/1633/320/13539949_e76af75976.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|de" title="German" src= "http://photos1.blogger.com/img/43/1633/320/13539933_041ca1eda2.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|it" title="Italian" src= "http://photos1.blogger.com/img/43/1633/320/13539953_0384ccecf9.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

<input name="langpair" value="en|pt" title="Portuguese" src= "http://photos1.blogger.com/img/43/1633/320/13539966_0d09b410b5.jpg" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">

</form>

you can also mannually create flag buttons like this.

ohhhh...it is not the image issue. above which i sent the link in that javascript working fine without transfering google. but there is displaying languages in dropdown. but i want to display only 4 languages customizable without display in dropdown.

http://translateth.is/docs
after all else fails RTFM,
the drop down function appears to be hardcoded even with very few languages selected

You generated your Avatar with www.cooltext.com yes that is how amazing my knowledge of the WWW is!! haha

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.