Home / posts / Add translation links
  • How to Add translation links

    add-translation-links

    Adding this PHP code to your wordpress theme will allow visitors to easily click a link to translate your article using Google translation services.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    <ul id="translations">
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cde">Translate this page to Deutsch</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Ces">Translate this page to Espanol</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cfr">Translate this page to Francais</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cit">Translate this page to Italiano</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cpt">Translate this page to Portugues</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Car">Translate this page to Arabic</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cja">Translate this page to Japanese</a></li>
        <li><a rel="nofollow" href="http://translate.google.com/translate?u=&lt;?php echo urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?&gt;&amp;langpair=en%7Cko">Translate this page to Korean</a></li>
    </ul>
    

    ( WordPress codex functions, hooks, in this snippet. )

    request,