Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Google Translate Widget Rate Topic   - - - - -

 
  • ketutg
  • Member
  • Trial users
  • Join Date: 27-Nov 14
  • 16 posts

Posted 30 March 2015 - 01:19 AM #1

I have created a static template with the following Google Translate widget code below but when i add this block to a layout it breaks the site. I've tried adding the js in
templates/addons/my_changes/hooks/index/scripts.post.tpl
as well to no avail. Can anyone tell me what i'm doing wrong?

<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>

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20080 posts

Posted 30 March 2015 - 09:29 AM #2

I have created a static template with the following Google Translate widget code below but when i add this block to a layout it breaks the site. I've tried adding the js in
templates/addons/my_changes/hooks/index/scripts.post.tpl
as well to no avail. Can anyone tell me what i'm doing wrong?

<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 make sure that { and } symbols do not exist on one string. Please try

<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>

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • ketutg
  • Member
  • Trial users
  • Join Date: 27-Nov 14
  • 16 posts

Posted 01 April 2015 - 05:27 AM #3

Thanks eComLabs. It works now. Did not know that having the { like that would break it.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11456 posts

Posted 01 April 2015 - 06:10 AM #4

Always safest to replace '{' with {ldelim} and '}' with {rdelim}.

It's a Smarty thang!

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20080 posts

Posted 02 April 2015 - 02:49 PM #5

Thanks eComLabs. It works now. Did not know that having the { like that would break it.


You are welcome!

It's a Smarty thang!


{ and } on different strings is also feature of Smarty 3
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Valuesbig
  • Advanced Member
  • Members
  • Join Date: 05-Jan 20
  • 83 posts

Posted 22 January 2020 - 08:37 AM #6

Hello @ecom lab We wish to integrate the similar widget on our front end which is based on Google translation API www.valuesbig.com So that the common visitor can switch between the languages and translate pages Since we are afraid of making any changes at backend, can you please help us in this regard? Sent from my LND-L29 using Tapatalk

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20080 posts

Posted 22 January 2020 - 01:03 PM #7

Try the code above. Not sure if this service still supported by Google


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Valuesbig
  • Advanced Member
  • Members
  • Join Date: 05-Jan 20
  • 83 posts

Posted 24 January 2020 - 05:50 PM #8

We are asked by another developer that it no more supports Google API. Can you please just try at your end to see the results? Sent from my LND-L29 using Tapatalk

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20080 posts

Posted 27 January 2020 - 05:50 AM #9

Mentioned code works for me on the demo

 

https://prnt.sc/qtb93p


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • Valuesbig
  • Advanced Member
  • Members
  • Join Date: 05-Jan 20
  • 83 posts

Posted 28 January 2020 - 07:51 AM #10

PL share screenshot It's not opening Sent from my LND-L29 using Tapatalk

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20080 posts

Posted 28 January 2020 - 01:42 PM #11

For some reason I cannot upload image here. But the URL from my post works correctly for me


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)