Jump to content


Photo
- - - - -

Adding Google Translate to my template

google translate

  • Please log in to reply
10 replies to this topic

#1 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 20 August 2012 - 09:48 PM

Hi, I'm trying to add Google Translate to my template, but just can't seem to make it work.

I've placed the meta tag information into the template index page, but when I place the snippet code into the body of the index page, nothing appears. For the moment, I've created a .inc file and the translation works on any page except for the shopping cart pages or login pages, which is why I'd like the template to do it. What am I obviously missing?

For information, my website is www.calligraphyarts.co.uk

Many thanks in anticipation.
Nick

#2 dresswell

dresswell

    Soho Dog

  • Administrators
  • 3,408 posts
  • LocationU.S.A.

Posted 20 August 2012 - 10:19 PM

You need to place the code on this file
where you'd like to display the Website Translator plugin on your page.
sohoadmin/program/modules/site_templates/pages/SOHOLAUNCH_Dark-clean/index.html
I am only seeing the mega tag part.
dresswell

 Free Soholaunch Hosting
Soholaunch Pro or Soholaunch Ultra Free with Hosting.
Check out our soholaunch hosting if your tried others

and were disappointed with your host or there support.
Get the help you need to build your website today.

Now offering a 99cent 1st. month Trial Offer.
Easy Website Maker


#3 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 21 August 2012 - 05:38 AM

Thanks Dresswell, but I still can't see the result. I can see the code on http://calligraphyarts.co.uk/test.php which is:


<div class="main-container">
<div align="right" id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false, multilanguagePage: true, gaTrack: true, gaId: 'UA-21881206-1'}, 'google_translate_element');
}
</script><script type="text/javascript" src="sohoadmin/program/modules/site_templates/pages/SOHOLAUNCH_Dark-clean///translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div class="left-panel">


I can see the script type source changes. This was done within cPanel's code edit (not html edit).... there are even more changes to the code if I use html edit. The original Google code is below.

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false, multilanguagePage: true, gaTrack: true, gaId: 'UA-21881206-1'}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


Any ideas?

#4 dresswell

dresswell

    Soho Dog

  • Administrators
  • 3,408 posts
  • LocationU.S.A.

Posted 21 August 2012 - 01:22 PM

Hi Nick,
If you want to private message me both your soho and cpanel login
i will take a look.
dresswell

 Free Soholaunch Hosting
Soholaunch Pro or Soholaunch Ultra Free with Hosting.
Check out our soholaunch hosting if your tried others

and were disappointed with your host or there support.
Get the help you need to build your website today.

Now offering a 99cent 1st. month Trial Offer.
Easy Website Maker


#5 dresswell

dresswell

    Soho Dog

  • Administrators
  • 3,408 posts
  • LocationU.S.A.

Posted 21 August 2012 - 07:26 PM

You should be good now.
Let me know.
dresswell

 Free Soholaunch Hosting
Soholaunch Pro or Soholaunch Ultra Free with Hosting.
Check out our soholaunch hosting if your tried others

and were disappointed with your host or there support.
Get the help you need to build your website today.

Now offering a 99cent 1st. month Trial Offer.
Easy Website Maker


#6 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 21 August 2012 - 11:58 PM

Hi Dresswell,

Yes thanks - it's now on every page and I'll look to see how its done later as I may try and move it higher on the template.

In the meantime, it's highlighted a load of errors in my html where spaces have become coded with &nbsp; for some reason. So I'm going through all the code - very tiresome...

Also currency symbols for GBP and Euro have become unrecognisable, such as.�20.00 GBP - I don't know how that will affect the shop.

Anyone else had this issue before?

#7 dresswell

dresswell

    Soho Dog

  • Administrators
  • 3,408 posts
  • LocationU.S.A.

Posted 22 August 2012 - 12:15 AM

The only thing i changed was :
src="//translate.google.com/translate_a/element.js?
Was changed to:
src="http://translate.google.com/translate_a/element.js?
Do a soho update even if it is a same build.
That should fix things unless you have added code to a page somewhere in the text editor.
And i did not reposition the code on the template.
It is where it was at.
dresswell

 Free Soholaunch Hosting
Soholaunch Pro or Soholaunch Ultra Free with Hosting.
Check out our soholaunch hosting if your tried others

and were disappointed with your host or there support.
Get the help you need to build your website today.

Now offering a 99cent 1st. month Trial Offer.
Easy Website Maker


#8 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 22 August 2012 - 06:22 AM

Hi Dresswell.

Brilliant work - and so simple too. The index.html code has all been readjusted and now.working wonderfully. I've moved the translate code into the container area so it shows up above my page menu, adjusted the css to move the container up 30 pixels and it all look great. And all because Google didn't put in http: into their code... Thanks for you help. It's a shame the translate bar pushes the page back down when it's invoked, but that's what I get for using a large page background I suppose.

What's great is seeing how others see your website in different languages - if you have the time.

Once again, thanks for your help.
Regards,
Nick

#9 James Donovan

James Donovan

    Member

  • Members
  • PipPip
  • 16 posts

Posted 30 August 2012 - 11:23 PM

Thanks Dresswell, but I still can't see the result. I can see the code on http://calligraphyarts.co.uk/test.php which is:


<div class="main-container">
<div align="right" id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false, multilanguagePage: true, gaTrack: true, gaId: 'UA-21881206-1'}, 'google_translate_element');
}
</script><script type="text/javascript" src="sohoadmin/program/modules/site_templates/pages/SOHOLAUNCH_Dark-clean///translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<div class="left-panel">


I can see the script type source changes. This was done within cPanel's code edit (not html edit).... there are even more changes to the code if I use html edit. The original Google code is below.

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL, autoDisplay: false, multilanguagePage: true, gaTrack: true, gaId: 'UA-21881206-1'}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


Any ideas?


Hi Nick, Thanks for share this web-link. ts really helpful for getting google translate coding.

#10 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 04 September 2012 - 07:34 AM

That's okay James. Just remember to get the Google code from http://translate.google.com/ using your own Google account code as parts of the code above are for my own website.
Regards,
Nick

#11 NickLappage

NickLappage

    Soho Novice

  • Members
  • PipPipPip
  • 44 posts
  • LocationLeicester, UK

Posted 07 November 2012 - 07:20 AM

Oooohhhhh...Just had to remove the Google translate bar from the template as it stops https:// from working. Is Soho planning on a proper translation module?





Also tagged with one or more of these keywords: google, translate

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users