Author Topic: Google Translate  (Read 1480 times)

mygamebirds

  • Jr. Member
  • **
  • Posts: 132
Google Translate
« on: April 23, 2010, 12:52:12 AM »
Anybody that is interested in implementing Google translate, it's as easy as copy and paste.

Copy this:

<!--Translator box-->
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!--Translator box end-->

and open inner_index.htm in text mode, paste the code anywhere you want it shown.

ie. I put the Google translator above news, so look for <!--End Login Box--> and paste the code below it.

Demo: http://www.mygamebirds.com

Enjoy!!  Since most of the visitors are international, it makes perfect sense to read it in their own language.

I'm in desperate need of a Forum Bridge, anybody know any?

mikev

  • Hero Member
  • *****
  • Posts: 647
Re: Google Translate
« Reply #1 on: April 24, 2010, 12:30:22 AM »
very handy, i like it. thanks for sharing.

NL-Extreme

  • Sr. Member
  • ****
  • Posts: 170
Re: Google Translate
« Reply #2 on: April 24, 2010, 03:07:08 AM »
ore you go to inner_index and put this :

  <!--Begintrancelate-->
  <div class="clsCommonSide">
            <div class="side_tb">
              <div class="side_bb">
                <div class="side_lb">
                  <div class="side_rb">
                    <div class="side_tlc">
                      <div class="side_trc">

                        <div class="side_blc">
                          <div class="side_brc">
                            <div class="cls100_p">
  <h3>Translate</h3>
  <div class="container-narrow">
    <ul class="content-list-narrow">
      <li><!--Translator box-->
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!--Translator box end-->
</li>
    </ul>
  </div>
  </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>

  <!--End translate-->

You got it in a box

picdome

  • Full Member
  • ***
  • Posts: 381
Re: Google Translate
« Reply #3 on: April 24, 2010, 09:44:58 AM »
thanks

mygamebirds

  • Jr. Member
  • **
  • Posts: 132
Re: Google Translate
« Reply #4 on: April 25, 2010, 11:52:39 PM »
ore you go to inner_index and put this :

  <!--Begintrancelate-->
  <div class="clsCommonSide">
            <div class="side_tb">
              <div class="side_bb">
                <div class="side_lb">
                  <div class="side_rb">
                    <div class="side_tlc">
                      <div class="side_trc">

                        <div class="side_blc">
                          <div class="side_brc">
                            <div class="cls100_p">
  <h3>Translate</h3>
  <div class="container-narrow">
    <ul class="content-list-narrow">
      <li><!--Translator box-->
<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!--Translator box end-->
</li>
    </ul>
  </div>
  </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>
                     </div>

  <!--End translate-->

You got it in a box

That's awesome, thanks man!

bigt11

  • Newbie
  • *
  • Posts: 93
Re: Google Translate
« Reply #5 on: May 06, 2010, 05:02:43 PM »
am i missing something, but on mygamebirds.com if you change to a language, you cant re-choose English?

mygamebirds

  • Jr. Member
  • **
  • Posts: 132
Re: Google Translate
« Reply #6 on: May 07, 2010, 04:40:51 PM »
am i missing something, but on mygamebirds.com if you change to a language, you cant re-choose English?

Bigt11, there is no "English" option.  I just click on "Original" and it goes back to English as default.  Would be nice if we had an English option as well. :)

mikev

  • Hero Member
  • *****
  • Posts: 647
Re: Google Translate
« Reply #7 on: May 10, 2010, 08:58:06 AM »
hi,
i noticed with this in inner_index.htm when you click on say videos (or any other page) and the video page is displayed the translation is lost, my solution was to place it in main1.htm after <!--End Greeting-->(you might want it somewhere else) then the translator box is on every page (for people who might arrive on a page other than the home page.) and when you click on videos (or any other page) the translation is not lost, you can even read the news in whatever language you have selected.

Edit 5.21.10: i had a lot of problems with google translate  responding with server not available try again later so ii replaced the script with Microsoft Translator and now it works perfectly every time.
if you are having the same problem or you just want to try it, you can get it here.
http://www.microsofttranslator.com/widget/

see the microsoft translator in action at: thegabshack.com
« Last Edit: May 21, 2010, 09:53:01 AM by mikev »

mygamebirds

  • Jr. Member
  • **
  • Posts: 132
Re: Google Translate
« Reply #8 on: May 12, 2010, 12:51:05 PM »
Just incase you want on main1.htm - I put the language selection right below the header.

Find:
Quote
          <a href="addgroup.php">[var.lang_create_group][/url]
          <!--[onload;block=div;when [var.loggedin]=2;comm]-->
        </div>
      </div>
      <!--End Sub-Navigation-->

Paste the Google language code here.

I removed the advertisement because don't need it.  I prefer it here for my site as the drop down doesn't blend too well with the background.

Good luck.