PHP language translator script

The PHP language translator translates your website pages from English to 12 languages automatically using the Google Translator service.

Making your website multilingual has never been easier, give your non English speaking visitors a rich experience when viewing your website and convert extra orders and subscriptions!Language support

The following languages are supported:

French
Deutsch/German
Italiano/Italian
Dutch
Spanish
Portuguese
Korea
Chinese Simplifie
Japanese
Greek
Arabic / UAE
Russia/Russian

The script displays a flag of each country allowing your visitors to easily recognise the mutiple languages you support.  Clicking the language translates the page.  Test it yourself by clicking the flags at the top right corner of this page!

Download the PHP Language Translator Script

How to install the script

1)  Download and extract the tar.gz file.
2)  Upload the files to your webhosting public folder ie HTDOCS, PUBLIC_HTML etc.
3)  Edit your exsting PHP website pages and add the following PHP code to each page you want the translator to appear on:

<?php include("translator.php");

4) View your website with beatiful translation flags!

**********************************************************
You could also do this as a jump box like I have.

 <script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

place the above code within your tags on each page you place the language select jump box.

<form name="form" id="form">
  <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('parent',this,1)">
    <option value="#">Language Select</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Car&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Arabic</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Czh-CN&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Chinese Simplified</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cnl&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Dutch</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cfr&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">French</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cde&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">German</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cel&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Greek</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cit&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Italian</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cja&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Japanese</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cko&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Korean</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cpt&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Portugese</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Cru&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Russian</option>
    <option value="http://209.85.135.104/translate_c?hl=en&amp;langpair=en%7Ces&amp;u=http://<?php $hostname = $_SERVER['SERVER_NAME']; echo $hostname. htmlentities($_SERVER['REQUEST_URI']); ?>">Spanish</option>
  </select>
</form>

Just copy the code above and insert it within your webpage’s code where you would like the language select jumpbox to apear
Hope that helps
*********************

If you want to automatically break out of the google frame
Just under the opening  <head> tag:
<script language=”JavaScript” type=”text/javascript”>
<!–
function framebreakout()
{
if (top.location != location) {
top.location.href = document.location.href ;
}
}
//–>
</script>

and in the body tag:
<body onload=”framebreakout()”>

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

No comments yet.

Leave a comment

(required)

(required)