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&langpair=en%7Car&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&langpair=en%7Czh-CN&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&langpair=en%7Cnl&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&langpair=en%7Cfr&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&langpair=en%7Cde&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&langpair=en%7Cel&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&langpair=en%7Cit&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&langpair=en%7Cja&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&langpair=en%7Cko&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&langpair=en%7Cpt&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&langpair=en%7Cru&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&langpair=en%7Ces&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()”>
Good script,but in url,it shows google url.I want to be on my site only while translating.
it is nice language translator script…
That rss feature on your site here is impressive, you should tell people about it in your upcoming post. I haven’t noted it for the first couple of times, now I’m using it every morning to check on any updates. I’m on a very slow dial-up link in Brazil and it’s rather frustrating to sit there and wait for such a long time ’til the page loads… but hey, I just found your rss page and added it to the Google Reader and there you are… I’m always up-to-date! Well buddy, keep up the good work and make that rss button a little bigger so that other people can enjoy that as well