z4m0lx3 Posted March 20, 2011 Share Posted March 20, 2011 Hello,I have installed prestashop and a template from TM with no problem.The language pack is Romanian, but that doesn't matter. It worked perfectly until I've changed something in Admin>Translations.Now the blocks Cart, Categories, Specials and User Info show english language. Before it was OK, it was showing romanian.I don't know how to restore it, or where the problem might be. The modules language .php and Admin>Translations are OK.The link is www[dot]girl-fashion[dot]roThank you. Link to comment Share on other sites More sharing options...
olea Posted March 20, 2011 Share Posted March 20, 2011 Hi,Where did you find you translation pack ?Do you still have a copy of this pack before you've done modification in the transaltion ?In that case, can you paost here, the ru.php file you can find in on of these modules ?(or send me in PM) Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 Yeah sure..I got it from here.Thing is, when I change {l s='Featured products' mod='homefeatured'} for example in {l s='Translated Line' mod='homefeatured'} the module shows the translated line. Just that it seems it doesn't get the translation from the file or something.The ro.php shows OK. Here is an example:<?phpglobal $_MODULE;$_MODULE = array();$_MODULE['<{homefeatured}prestashop>homefeatured_cd2c2dc24eaf11ba856da4a2e2a248be'] = 'Produse promitionale in pagina acasa';$_MODULE['<{homefeatured}prestashop>homefeatured_b494beb5de5dd7b4fad67262e0de6321'] = 'Arata produse promotionale in mijlocul paginii acasa';$_MODULE['<{homefeatured}prestashop>homefeatured_c888438d14855d7d96a2724ee9c306bd'] = 'Setările au fost salvate';$_MODULE['<{homefeatured}prestashop>homefeatured_f4f70727dc34561dfde1a3c529b6205c'] = 'Setări';$_MODULE['<{homefeatured}prestashop>homefeatured_6df1f9b5662398a551a2c9185b26638a'] = 'Pentru a putea adauga produse in pagina acasa, adauga produsele in categoria acasa.';$_MODULE['<{homefeatured}prestashop>homefeatured_20c47700083df21a87e47d9299ef4dc4'] = 'Numarul produselor afisate';$_MODULE['<{homefeatured}prestashop>homefeatured_ada7594fb1614c6b6d271699c8511d5e'] = 'Numarul produselor afisate in pagina acasa (implcit: 10)';$_MODULE['<{homefeatured}prestashop>homefeatured_c9cc8cce247e49bae79f15173ce97354'] = 'Salvează';$_MODULE['<{homefeatured}prestashop>homefeatured_ca7d973c26c57b69e0857e7a0332d545'] = 'Produse promotionale';$_MODULE['<{homefeatured}prestashop>homefeatured_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Mai mult';$_MODULE['<{homefeatured}prestashop>homefeatured_4351cfebe4b61d8aa5efa1d020710005'] = 'Vezi';$_MODULE['<{homefeatured}prestashop>homefeatured_2d0f6b8300be19cf35e89e66f0677f95'] = 'Adaugă în coş';$_MODULE['<{homefeatured}prestashop>homefeatured_e0e572ae0d8489f8bf969e93d469e89c'] = 'Nici un produs.';I've only done modifications in the Admin>Translations (not in the ro.php file) Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 Oh...one other thing I noticed.The modules that doesn't show the OK language are the ones in the theme/modules folder. Link to comment Share on other sites More sharing options...
olea Posted March 20, 2011 Share Posted March 20, 2011 What is the name of the directory containing your theme, with exact capitalized letter ? Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 /themes/girl-fashion/I've tried copying the ro.php from themodules/homefeatured tothemes/girl-fashion/modules/homefeaturedbut it still doesn't work Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 i've also tried reinstalling the module..i've created an en.php in the modules folder and copied the .ro php contentit doesn't worki think something happened when i changed something in Tools>Translations>Module Translations Link to comment Share on other sites More sharing options...
olea Posted March 20, 2011 Share Posted March 20, 2011 Which version of Prestashop ? Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 prestashop 1.3.2.3 Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 I remember I was usually modifying the language directly in the modules ro.phpBut I needed to change something in a user module and I used the Translations interface.When I saved the translations...puff* I got this problem Link to comment Share on other sites More sharing options...
olea Posted March 20, 2011 Share Posted March 20, 2011 When you use the translator to transmate one module, it may modify all the modules.Do you still have the ro.php file stored in theme//modules/blockcart/ and others so that you can restore them ? Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 I don't but I don't think that would work...because I already copied the ro.php from the modules/ to theme/girl-fashion/modules and it doesn't work ( Link to comment Share on other sites More sharing options...
z4m0lx3 Posted March 20, 2011 Author Share Posted March 20, 2011 i didn't want to do this..but here it isI copied the modules from the template into the modules/ folder of prestashop and changed the name of themes/girl-fashion/modules so it won't have access to that.Now it gets the modules directly from the prestashop modules/ folder and the language as well...I really can't see the problem, but this is a temporary solution..If anyone has another idea? 1 Link to comment Share on other sites More sharing options...
JRGandara Posted April 10, 2011 Share Posted April 10, 2011 I'm having the very same problem! I installed a Off Line Credit Card module . When I made some Portuguese translating for this module, my Cart and Featured Block lost their Spanish and Portuguese and only works in English! I tried to uninstall the Credit Card module but wont help. I'm using Prestashop 1.3.2.1.Any suggestions? Link to comment Share on other sites More sharing options...
basile1967 Posted April 13, 2011 Share Posted April 13, 2011 I also had the same problem (version 1.4.0.17). When you use the translator to edit a language translation, the system replaces the language files in every module and if the language files doesn't exist it will create it.That means that the system also creates an empty language file in every module under themes folder. Then when you reload your store the translations of the modules that exist in the modules folder under themes folder don't work.I found out that when I delete the language files of every module under theme folder the translations work ok again. But I must do this every time I use the translator. I can not imagine why that happens but doing this the translation problem is solved. Link to comment Share on other sites More sharing options...
allienato Posted December 2, 2011 Share Posted December 2, 2011 I also had the same problem (version 1.4.0.17). When you use the translator to edit a language translation, the system replaces the language files in every module and if the language files doesn't exist it will create it. That means that the system also creates an empty language file in every module under themes folder. Then when you reload your store the translations of the modules that exist in the modules folder under themes folder don't work. I found out that when I delete the language files of every module under theme folder the translations work ok again. But I must do this every time I use the translator. I can not imagine why that happens but doing this the translation problem is solved. correct, this issue still exists in ps 1.4.4.1. did anybody submit that to bug tracker? Link to comment Share on other sites More sharing options...
swissmark Posted January 16, 2012 Share Posted January 16, 2012 Same problem here on one of my prestashop installations... v. 1.3.5 Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted January 20, 2012 Share Posted January 20, 2012 Similar problem here. When I update modules translations, it erases more than half of the translations... Curiousily, the modules that lose that translation are within F and Z in the alphabetic order. :S For example, nothing happens to "bankwire" module translation, while "homefeatured" lose its translations. v1.3.2 Link to comment Share on other sites More sharing options...
frosticek Posted January 31, 2012 Share Posted January 31, 2012 same problem occured in my ps 1.3.2 after 1 year of using Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted January 31, 2012 Share Posted January 31, 2012 same problem occured in my ps 1.3.2 after 1 year of using Exactly! Very strange bug. Now I avoid doing module translations through the BO to avoid loosing old translations... Link to comment Share on other sites More sharing options...
falrc Posted February 21, 2012 Share Posted February 21, 2012 Got the same problem, all is fine until i try to translate a module. All gets reseted. Link to comment Share on other sites More sharing options...
falrc Posted February 21, 2012 Share Posted February 21, 2012 i didn't want to do this..but here it is I copied the modules from the template into the modules/ folder of prestashop and changed the name of themes/girl-fashion/modules so it won't have access to that. Now it gets the modules directly from the prestashop modules/ folder and the language as well... I really can't see the problem, but this is a temporary solution.. If anyone has another idea? Just tried that, it works. Will have to do it like this until fixed. Thanks Link to comment Share on other sites More sharing options...
bostjant Posted March 14, 2012 Share Posted March 14, 2012 Hi, I have the same problems with translating block modules. Some translation works but the most important that are on frontpage doesn't work. I use Presta 1.3.0.. Any idea? Thanks Link to comment Share on other sites More sharing options...
Soter13 Posted March 21, 2012 Share Posted March 21, 2012 Just tried that, it works. Will have to do it like this until fixed. Thanks I had the very same problem and I solved with the above way, although it is not a profeciaonaly solution. Thw dissapointing thik is that I see that this problem exists on over a year on several editions and noone did something to fix it in a proper way... Link to comment Share on other sites More sharing options...
Nozonda Posted May 27, 2012 Share Posted May 27, 2012 (edited) Hey guys, I also had this problem (with version 1.4.7.3) and decided to look into the code to fix it The problem is that the function to write the files, first checks if a file exists, if not, it will make it. Then it checks if the content is empty or not, if it is empty it ignores it and otherwise it writes it. So I changed that a bit. I made it so it will not make an empty file if the content is empty. What I did: First delete all the empty language files from themes/yourtheme/modules/*/ Then open /admin/tabs/AdminTranslations.php, search for the function findAndWriteTranslationsIntoFile Change: // Set file_name in static var, this allow to open and wright the file just one time if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) ) { $str_write = ''; $_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name] = true; if (!file_exists($file_name)) file_put_contents($file_name, ''); if (!is_writable($file_name)) die ($this->l('Cannot write the theme\'s language file ').'('.$file_name.')'.$this->l('. Please check write permissions.')); // this string is initialized one time for a file $str_write .= "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n"; $array_check_duplicate = array(); } to: // FIX BY NOZONDA - NICO // Fix: first get all the content, then check if it's not empty, and if not > make file. // Set file_name in static var, this allow to open and wright the file just one time if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) ) { // this string is initialized one time for a file $str_write = "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n"; $array_check_duplicate = array(); } // END OF FIX BY NOZONDA - NICO And after the foreach() loop add: // FIX BY NOZONDA - NICO if (!isset($_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name]) && $str_write != "<?php\n\nglobal \$_MODULE;\n\$_MODULE = array();\n") { $_cache_file[($is_default ? self::DEFAULT_THEME_NAME : $theme_name).'-'.$file_name] = true; if (!file_exists($file_name)) file_put_contents($file_name, ''); if (!is_writable($file_name)) die ($this->l('Cannot write the theme\'s language file ').'('.$file_name.')'.$this->l('. Please check write permissions.')); } // END OF FIX BY NOZONDA - NICO I think making changes in the core is very bad, but in this case it seems necessary. That is why I added my own name and company name as comment. I recommend you all to do the same with all core changes. This way you can easily find all core changes when you update Prestashop. Good luck. Edited May 27, 2012 by Nozonda (see edit history) 1 Link to comment Share on other sites More sharing options...
prestasmart Posted December 12, 2012 Share Posted December 12, 2012 Hello all, Problem solved here, just posted about it (french) : http://www.prestashop.com/forums/topic/162104-probleme-de-traduction-des-modules/ Hope it helps. 1 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