Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Combine Google Translate with language pack?

    Hi there,

    I would like to make it so that if a customer chooses a language from the dropdown box, it will switch to that language pack as usual, but also use Google Translate to translate everything that isn't automatically translated by the language pack (e.g. product descriptions, info pages).

    This is the Google script:

    <div id="google_translate_element"></div><script>
    function googleTranslateElementInit() {
    new google.translate.TranslateElement({
    pageLanguage: 'en',
    includedLanguages: 'el'
    }, 'google_translate_element');
    }
    </script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    I was thinking I could put an if statement into the language sidebox file so that Google would run whichever translation corresponds to the chosen currency. I do not want the Google Translate dropdown box to even show up. I want the customer to be able to just click the Greek flag and have it use the language pack and Google Translate.

    I tried a few different things to make it work, but no luck. Does anyone have any ideas? I think this would be useful for a lot of people!

    Thanks!
    Danielle

  2. #2
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,916
    Plugin Contributions
    3

    Default Re: Combine Google Translate with language pack?

    This is not possible, because of the DYNAMIC nature of zencart's pages.

    This will be true of ANY site that uses a CMS - not just zencart.

    Google requires a composed page to effect a translation, but there are no composed pages in a CMS.

    The pages are created on-the-fly - when needed. They do not exist before that point, and when a user navigates out of them, they evaporate...

    You will have to use a language pack and manually translate content.
    Did my post help you fix something? You can show your gratitude by buying the the dev team coffee.

  3. #3
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Re: Combine Google Translate with language pack?

    Well Google Translate does work with Zen-Cart on it's own with no problems, I had that part working perfectly. I had the Zen-Cart language selection, and customers could select the Greek flag to use the Greek Zen-Cart language pack, and then the Google Translate box was also showing, and they could choose Greek there and it would translate everything that the language pack did not translate. It's just that is not very user-friendly, I was hoping there was a way to combine them both into one so customers wouldn't have to choose Greek twice.
    Danielle

  4. #4
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,916
    Plugin Contributions
    3

    Default Re: Combine Google Translate with language pack?

    Quote Originally Posted by Danielle View Post
    Well Google Translate does work with Zen-Cart on it's own with no problems, I had that part working perfectly. I had the Zen-Cart language selection, and customers could select the Greek flag to use the Greek Zen-Cart language pack, and then the Google Translate box was also showing, and they could choose Greek there and it would translate everything that the language pack did not translate. It's just that is not very user-friendly, I was hoping there was a way to combine them both into one so customers wouldn't have to choose Greek twice.
    Yes... that's precisely what I was saying... Once the page is CREATED, the translation can occur. In this case, a person calls up a page (which is assembled and displayed) and AFTER it is assembled, the underlying HTML can be accessed by google to effect a translation.

    What you are hoping to do is have google translate what is fundamentally database content, BEFORE the page is parsed. This is not possible...
    Did my post help you fix something? You can show your gratitude by buying the the dev team coffee.

  5. #5
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Re: Combine Google Translate with language pack?

    I guess I'm not explaining this very well. I just want Google Translate to do what it is already doing. When a customer chooses their language from the Google dropdown box, it translates the page they are on. After that, whenever they navigate to a new page, it loads in english, and then within a few seconds, it automatically translates it to whatever language they chose initially. They do not have to choose the language on every page. Once Google Translate is "activated" by the customer, it automatically translates every page after the page is loaded, so it works with dynamic sites. I was just hoping to find a way to "activate" Google translation automatically when the customer clicks the flag in the Zen-Cart Language selection box.
    Danielle

  6. #6
    Join Date
    Jun 2005
    Location
    Hertfordshire, UK
    Posts
    9,916
    Plugin Contributions
    3

    Default Re: Combine Google Translate with language pack?

    To wait for the page to parse, and then have some mechanism to sense what language it is in, and then run the appropriate language translator automatically is unlikely to be possible unless you write some pretty sophisticated code I imagine.
    Did my post help you fix something? You can show your gratitude by buying the the dev team coffee.

  7. #7
    Join Date
    Oct 2004
    Posts
    920
    Plugin Contributions
    1

    Default Re: Combine Google Translate with language pack?

    Yeah too bad, it would have been great :) Maybe some day when I have some free time...lol...
    Danielle

 

 

Similar Threads

  1. Google translate
    By rehopper in forum General Questions
    Replies: 0
    Last Post: 10 Feb 2010, 06:05 PM
  2. 'Multi Translate' language sideboxes HIGHLY RISKY
    By cafman in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Oct 2009, 12:48 PM
  3. Language Translate
    By alicia130 in forum Customization from the Admin
    Replies: 1
    Last Post: 13 Apr 2009, 09:22 PM
  4. How to translate to a new language?
    By target_locked in forum Addon Language Packs
    Replies: 9
    Last Post: 9 Mar 2009, 03:40 AM
  5. Language Packs - Do they translate product descriptions?
    By YZ250 in forum Addon Language Packs
    Replies: 3
    Last Post: 12 Feb 2009, 11:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •