Hello,
Friends, thank you so much for your kind support. Here are the codes for php and have also attached text file - to have an idea of how large data is to be assigned to variable.
index.php
<?
$page="pharma";
require 'content/'.$page.'.php';
require "inc/functions.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Parth : Translation</title>
<script type="text/javascript" src="js/jsapi"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- LANGUAGE FLAG STARTS -->
<? echo languagemenu(); ?>
<!-- LANGUAGE FLAG ENDS-->
<br />
<h1>Parth</h1>
<!-- CONTENT AND TRANSLATION STARTS-->
<?
$txtid="1";
$txt="$products1";
echo content1($txtid, $txt);
?>
<!-- CONTENT AND TRANSLATION ENDS -->
</body>
</html>
function.php
//MAIN TRANSLATION
function translate($txt, $txtid)
{
global $self;
$self=$_SERVER['PHP_SELF'];
global $lang;
global $txt;
global $page;
echo'
<!-- MESSAGE TRANSLATION STARTS-->
<script type="text/javascript">
google.load("language", "1");
function toptext() {
google.language.translate("'.$txt.'", "en", "'.$lang.'",
function(welcomemsg) {
if (!welcomemsg.error) {
var container = document.getElementById("'.$txtid.'");
container.innerHTML = welcomemsg.translation;
}
});
}
google.setOnLoadCallback(toptext);
</script>
<!-- MESSAGE TRANSLATION ENDS--> ';
}
//TRANSLATION 1
function content1($txtid, $txt)
{
global $txtid;
global $txt;
echo' <div class="contentbox" id="'.$txtid.'">';
echo translate($txt, $txtid);
echo '</div>';
}
Thanks,
Vikram
[attachment deleted by admin]