Author Topic: Google translate plugin or how to add?  (Read 3463 times)

UK

  • Active Member
  • ***
  • Posts: 84
  • Karma: +1/-2
Google translate plugin or how to add?
« on: October 23, 2013, 06:04:40 AM »
simple question there must be a way of adding google translate it is a very important factor for any site! :D :)

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: Google translate plugin or how to add?
« Reply #1 on: October 23, 2013, 10:14:05 AM »
Go here https://translate.google.com/manager/website/add

Then add the script to index.html and frame html.

Remember you may need to add <html><head></head><body></body></html> into the pages depending on how modified your script already is.

UK

  • Active Member
  • ***
  • Posts: 84
  • Karma: +1/-2
Re: Google translate plugin or how to add?
« Reply #2 on: October 23, 2013, 10:22:50 AM »
<meta name="google-translate-customization" content="5cbd74710ec0f1fc-fa9a0a226b423757-gb51231ac4a4f018f-15"></meta>



<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


please tell me what to do with that do i have to add anything? and which index file? there are 2 index files you mean the index file that is in the same folder as frame html file?

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: Google translate plugin or how to add?
« Reply #3 on: October 23, 2013, 10:37:23 AM »
This is using an unedited version of index.html you can do the same for frame.html (both in the same folder)

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{tplvars.title}</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<link rel="shortcut icon" href="{tplvars.baseurl}/favicon.ico" />
<meta name="description" content="{tplvars.meta_diz}" />
<meta name="keywords" content="{tplvars.meta_keywords}" />
<meta name="distribution" content="global" />
<meta name="robots" content="index,follow" />
<link href="{tplvars.tplurl}/styles/common.css" rel="stylesheet" type="text/css" />
<link href="{tplvars.tplurl}/styles/index.css" rel="stylesheet" type="text/css" />
<!----GOOGLE TRANSLATE META TAG BELOW THIS LINE---->
<meta name="google-translate-customization" content="5cbd74710ec0f1fc-fa9a0a226b423757-gb51231ac4a4f018f-15"></meta><!----HERE--->

<script type="text/javascript">
baseurl='{tplvars.baseurl}';
</script>
<script type="text/javascript" src="{tplvars.baseurl}/js/jquery.js?v={tplvars.js_lib_v}"></script>
<script type="text/javascript" src="{tplvars.baseurl}/js/general.js?v={tplvars.js_lib_v}"></script>
<script type="text/javascript" src="{tplvars.baseurl}/js/index.js?v={tplvars.js_lib_v}"></script>
</head>
<body>

<div id="expandable-container">
<div id="header-container">
<div id="header-body">
<ul id="primary-nav">
<li><a class="menu1" href="{tplvars.relative_url}home.php" title="Home"><span>Home</span></a></li>
<li><a class="menu1" href="{tplvars.relative_url}search_more.php" title="Search"><span>Search</span></a></li>
<li><a class="menu1" href="{tplvars.relative_url}photos.php" title="Member Photos"><span>Photos</span></a></li>
<li><a class="menu1" href="{tplvars.relative_url}blogs.php" title="Member Blogs"><span>Blogs</span></a></li>
<li><a class="menu1" href="{tplvars.relative_url}search.php?st=online" title="Online Members"><span>Who's Online</span></a></li>
</ul>
<div id="logo-box">
<a href="{tplvars.relative_url}index.php">{tplvars.sitename}</a>
</div>
<!--widget="login"-->
</div>
</div>

<!---GOOGLE TRANSLATE DROP DOWN BOX STARTS HERE--->

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<!---GOOGLE TRANSLATE DROP DOWN BOX ENDS HERE-->

<div id="content-container">

<div id="description" class="content_area large">
<h1>It's that easy</h1>
<div class="box_content">
<ul>
<li id="description-search" class="description-box">
<h3>Search</h3>
<p>our thousands of members.</p>
</li>
<li id="description-meet" class="description-box">
<h3>Meet</h3>
<p>new people for friendship and more.</p>
</li>
<li id="description-have-fun" class="description-box">
<h3>Have fun</h3>
<p>there's nothing like a real date.</p>
</li>
<li id="description-more" class="description-box">
<a href="{tplvars.relative_url}join.php" id="sign-up-now" title="Sign up now!">Sign up now!</a>
<h4>and a lot more</h4>
<p>Flirts, messages, photos, blogs, alerts...</p>
</li>
</ul>
</div>
</div>

<!--widget="members(array('mode'=>'new','area'=>'front'))"-->

<!--widget="blogs(array('mode'=>'new','area'=>'front','total'=>3))"-->

<!--widget="osignal_feed(array('module_code'=>'osignal_feed','area'=>'front','num_stories'=>4))"-->

<div id="search" class="content_area small">
<h2>Find</h2>
<div class="box_content">
<form action="search.php" method="get" id="search-form">
<fieldset>
<input type="hidden" name="st" value="basic" />
<!--loop name="search"-->
<dl id="row_{search.dbfield}" class="{search.class}">
<dt>{search.label}:</dt>
<dd>{search.field}</dd>
</dl>
<!--/loop name="search"-->
<dl id="row_photo">
<dt>With photo?</dt>
<dd><input type="checkbox" name="wphoto" value="1" /></dd>
</dl>
</fieldset>
<fieldset class="controls">
<input id="search-button" type="submit" class="button medium" value="Search" />
</fieldset>
</form>
<script type="text/javascript">
<!--loop name="search"-->
{search.js}
<!--/loop name="search"-->
</script>
</div>
</div>
</div>
<div id="footer-cleaner">&nbsp;</div>
</div>

<div id="footer-container">
<div id="footer-body">
<p id="copyright">&copy; Copyright 2008 <a href="{tplvars.baseurl}">{tplvars.sitename}</a>. All Rights Reserved.<br />Powered by <a href="http://www.datemill.com" title="Etano community builder">Etano</a>.</p>
<ul id="secondary-nav">
<li class="first"><a href="{tplvars.relative_url}tos.php" title="Terms &amp; Conditions">Terms &amp; Conditions</a></li>
<li><a href="{tplvars.relative_url}privacy.php" title="Privacy Statement">Privacy Statement</a></li>
<li><a href="{tplvars.relative_url}contact.php" title="Contact">Contact</a></li>
</ul>
</div>
</div>
</body>
</html>


PLEASE INPUT YOUR CODE , DO NOT COPY AND PASTE THIS AS MY CODE FROM GOOGLE WILL BE FOR MY TEST SERVER SITE.

To see how it looks go you can go here to see a screen shot http://www.croydon-computers.co.uk/google.png

UK

  • Active Member
  • ***
  • Posts: 84
  • Karma: +1/-2
Re: Google translate plugin or how to add?
« Reply #4 on: October 23, 2013, 10:44:16 AM »
very nice thanks alot :) very much appreciated! ;)

Nash77

  • Prime Member
  • ****
  • Posts: 152
  • Karma: +12/-2
Re: Google translate plugin or how to add?
« Reply #5 on: October 23, 2013, 10:45:15 AM »
No problem  :D

UK

  • Active Member
  • ***
  • Posts: 84
  • Karma: +1/-2
Re: Google translate plugin or how to add?
« Reply #6 on: October 23, 2013, 08:07:15 PM »
all done sorted thanks to you :) a very good tutorial you did there thanks again! 8) ;)