BarNet Posted January 2, 2012 Share Posted January 2, 2012 Hi all This is my first attempt at a module and I thought all was cool but it is not getting accepted in the back-end. I have tweaked and re-uploaded half a dozen times ( and more!) but really need someone to run their eyes over it and let me know what I have done incorrectly. php page is: <?php class googlelanguages extends Module{ function __construct(){ $this->name = 'googlelanguages'; $this->tab = 'Blocks'; $this->version = 0.2; parent::__construct(); $this->displayName = $this->l('Google Languages'); $this->description = $this->l('Adds Google Languages block'); } function install() { if (!parent::install()) return false; if (!$this->registerHook('top')) return false; return true; } function hookTop($params){ return $this->display(__FILE__, 'googlelanguages.tpl'); } } ?> and then the .tpl code: <!-- Block languages module --> <div class="languages_block_top"> <div id="google_translate_element"></div> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en', includedLanguages: 'zh-CN,zh-TW,en', multilanguagePage: true, layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> </div> <!-- /Block languages module --> Can anyone see any bloppers? Thanks in advance Catherine Barclay PS. Happy New Year!!! Link to comment Share on other sites More sharing options...
bellini13 Posted January 2, 2012 Share Posted January 2, 2012 can you clarify what "not being accepted in the back-end" means? Link to comment Share on other sites More sharing options...
bellini13 Posted January 2, 2012 Share Posted January 2, 2012 i have installed this module on my test site and it works perfectly actually. so the only thing I can say, have you named the folder and files correctly? folder=googlelanguages php=googlelanguages.php template=googlelanguages.tpl Link to comment Share on other sites More sharing options...
BarNet Posted January 2, 2012 Author Share Posted January 2, 2012 Thanks so much. that was one thing I didn't pick up on ... my folder was a different name. All is appearing in the administration now. Much Appreciated Catherine Link to comment Share on other sites More sharing options...
bellini13 Posted January 2, 2012 Share Posted January 2, 2012 good news, glad its working now Link to comment Share on other sites More sharing options...
mirni Posted January 18, 2012 Share Posted January 18, 2012 Hi! I am using latest prestashop version but in google translation is not working for me, it keeps on loading and loading and shows some url . is there a module I must add? do you mind giving me the link? I do not understand why in version 1.4.4.1 worked so well and now it's giving me troubles. Link to comment Share on other sites More sharing options...
freshairoahu Posted January 24, 2012 Share Posted January 24, 2012 Aloha! I am having a similar problem. Will the above code make google translate work for version 1.3.1? My site is http://hawaiianfishhooknecklace.com/store/ check it out and let me know if this will work. Thanks! Link to comment Share on other sites More sharing options...
shacker Posted February 6, 2012 Share Posted February 6, 2012 What module are using? i see that works on your site Link to comment Share on other sites More sharing options...
oroszzs Posted February 10, 2012 Share Posted February 10, 2012 Hi All! I have also problems with translating because the google translator is not free and I use the Prestashop (1.4.6.2) in Hungary. I found the Micosoft Bing translator. It is free and it has a good API. I made some changes in gg-translate.js to use Bing for translation. You need to get an Appilcation Id for Bing translator. Follow: http://www.microsoft.com/web/post/using-the-free-bing-translation-apis In gg-translte.js you have to change your App ID var myAppId = "Your app Id is here"; You can download this javascript file, and copy into js/ folder. http://weboldal-programozas.hu/gg-translate.php Good luck, Zsolt 1 Link to comment Share on other sites More sharing options...
mar7in Posted February 22, 2012 Share Posted February 22, 2012 Zsolt, thank you a lot! Link to comment Share on other sites More sharing options...
oroszzs Posted February 22, 2012 Share Posted February 22, 2012 You are welcome! If you find some problem with the gg-translate.js please tell to me. Link to comment Share on other sites More sharing options...
HandCraft Posted February 26, 2012 Share Posted February 26, 2012 Is that really working fine on ur presta site? Can you plz post ur site address here or as private message? Thanks!!! You are welcome! If you find some problem with the gg-translate.js please tell to me. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now