Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    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
    Cumbria, UK
    Posts
    10,267
    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.
    20 years a Zencart User

  3. #3
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    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
    Cumbria, UK
    Posts
    10,267
    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...
    20 years a Zencart User

  5. #5
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    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
    Cumbria, UK
    Posts
    10,267
    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.
    20 years a Zencart User

  7. #7
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    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. v154 Trouble with Simplified Chinese language pack
    By jaemsy in forum General Questions
    Replies: 3
    Last Post: 6 Apr 2015, 02:03 AM
  2. v151 Language pack with custom template problem.
    By SavaTom in forum Addon Language Packs
    Replies: 6
    Last Post: 2 Mar 2014, 09:58 PM
  3. Errors with swedish language pack
    By shocker in forum Addon Language Packs
    Replies: 0
    Last Post: 17 Mar 2009, 12:15 PM
  4. HTML Problem with Language Pack
    By strongfarmer in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Feb 2008, 01:24 PM
  5. trouble with spanish language pack
    By wseyller in forum Addon Language Packs
    Replies: 0
    Last Post: 10 Jan 2007, 04:09 PM

Posting Permissions

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