marhor.hr Posted January 10, 2013 Share Posted January 10, 2013 (edited) I'm trying to translate the product comments module. When writing new product comment, if Title and Comment fields are left empty the error messages for requiered fields is shown. Well, i can not translate these error messages. They are always shown in english (see attached screencshot). I have translated the "Title is incorrect" and "Comment is incorrect" fields in the backoffice (installed modules translation), but it isn't shown correctly. I'm using Prestashop 1.5.2, Product Comments module is the one that comes with prestashop, v2.3 Can anyone help? Edited February 28, 2013 by marhor.hr (see edit history) Link to comment Share on other sites More sharing options...
aminekaddioui Posted January 21, 2013 Share Posted January 21, 2013 I have the following error when I try to update the translation of any module. Can you please help? [PrestaShopException] Invalid theme "default" at line 1177 in file controllers/admin/AdminTranslationsController.php 1171. if ($existing_theme->directory == $theme) 1172. $theme_exists = true; 1173. if ($theme_exists) 1174. $this->theme_selected = Tools::safeOutput($theme); 1175. else 1176. throw new PrestaShopException(sprintf(Tools::displayError('Invalid theme "%s"'), $theme)); 1177. } 1178. else 1179. $this->theme_selected = self::DEFAULT_THEME_NAME; 1180. 1181. // Set the path of selected theme AdminTranslationsControllerCore->getInformations - [line 1213 - controllers/admin/AdminTranslationsController.php] - [0 Argument] AdminTranslationsControllerCore->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument] ControllerCore->run - [line 348 - classes/Dispatcher.php] - [0 Argument] DispatcherCore->dispatch - [line 50 - admin0/index.php] - [0 Argument] Link to comment Share on other sites More sharing options...
aminekaddioui Posted January 21, 2013 Share Posted January 21, 2013 anyone can help on this please ? Link to comment Share on other sites More sharing options...
marhor.hr Posted January 22, 2013 Author Share Posted January 22, 2013 anyone can help on this please ? sorry, beeing a newbie myself, i have no idea... Link to comment Share on other sites More sharing options...
El Patron Posted January 22, 2013 Share Posted January 22, 2013 http://screencast.com/t/tPpOUoCmPxi Link to comment Share on other sites More sharing options...
aminekaddioui Posted January 22, 2013 Share Posted January 22, 2013 Hi, I am not sure what is the solution you are suggesting. Thanks Amine Link to comment Share on other sites More sharing options...
El Patron Posted January 22, 2013 Share Posted January 22, 2013 Hi, I am not sure what is the solution you are suggesting. Thanks Amine I am answering the original posters question. You may want to open your own thread as your problem is not the same. Link to comment Share on other sites More sharing options...
marhor.hr Posted January 23, 2013 Author Share Posted January 23, 2013 Hello Elpatron, thank You for your answer, but it does not work. I have already translated all the fields into croatian, but output in the form fot these two error messages stays in english (like i described in first post, everything is translated except these error messages which appear when the mandatory fields are left blank). I suppose this must be a bug in the code, but i can't find it... Link to comment Share on other sites More sharing options...
yonizzz Posted February 19, 2013 Share Posted February 19, 2013 @Marhor This is a reply to the initial post of Marhor. I found the location of the text in the newcommentscreen : //ROOT/modules/productcomments/controllers/front/default.php (around line 78) These texts are not reflected in the admin translations of Prestashop. I haven't figured out how to achieve this but since my shop is only in one language, I have made a change of the text in the page itself (click link for image). If anybody knows the code to have the translation reflected in the backoffice, please reply. For now, maybe this helps you a litttle. Regards, Yoni ps. using 1.5.3 http://www.screencast.com/t/vyG56KBld 1 Link to comment Share on other sites More sharing options...
rferrero Posted February 21, 2013 Share Posted February 21, 2013 I have some problem Link to comment Share on other sites More sharing options...
marhor.hr Posted February 26, 2013 Author Share Posted February 26, 2013 thanks yonizzz, i have found the code. Weird thing is, that these strings are reflected in backoffice translations; but are not evaluated when output is generated. Probably it has to do with problem described in this topic: http://www.prestashop.com/forums/topic/134897-solved-extra-translations-not-in-modules/, but had'nt had the nerves to try it out. So I've done this: Line 78: $errors[] = $module_instance->l('ID product is incorrect'); change into $errors[] = Tools::displayError('ID product is incorrect'); Now I can translate the string in back office error messages translations, and it is displayed correctly... Bye! PS: i don't know how to change the topic title into "solved" if anyone can explain? Link to comment Share on other sites More sharing options...
karolis_sertek Posted April 19, 2013 Share Posted April 19, 2013 Hello, because ps parse front/default.php to 'default' source, so we should add this to make work correctly: if (!Validate::isInt(Tools::getValue('id_product'))) $errors[] = $module_instance->l('ID product is incorrect', 'default'); if (!Tools::getValue('title') || !Validate::isGenericName(Tools::getValue('title'))) $errors[] = $module_instance->l('Title is incorrect', 'default'); if (!Tools::getValue('content') || !Validate::isMessage(Tools::getValue('content'))) $errors[] = $module_instance->l('Comment is incorrect', 'default'); if (!$id_customer && (!Tools::isSubmit('customer_name') || !Tools::getValue('customer_name') || !Validate::isGenericName(Tools::getValue('customer_name')))) $errors[] = $module_instance->l('Customer name is incorrect', 'default'); if (!$this->context->customer->id && !Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS')) $errors[] = $module_instance->l('You must be logged in order to send a comment', 'default'); if (!count(Tools::getValue('criterion'))) $errors[] = $module_instance->l('You must give a rating', 'default'); $product = new Product(Tools::getValue('id_product')); if (!$product->id) $errors[] = $module_instance->l('Product not found', 'default'); Link to comment Share on other sites More sharing options...
jibonbokul Posted September 1, 2013 Share Posted September 1, 2013 (edited) Please any onse help me prestashop 1.5.5.0 Title is incorrect Comment is incorrect Product not found When i write review comment this time showing this problem on prestashop latest version of product comment module. Please any ones help me how can i slvoed this proboem. Thanks jibon Edited September 1, 2013 by jibonbokul (see edit history) 1 Link to comment Share on other sites More sharing options...
renaudbiemans Posted September 12, 2013 Share Posted September 12, 2013 it seems i have the same bug. i opened a new post for it : http://www.prestashop.com/forums/topic/274396-messages-derreurs-dans-le-formulaire-commentaire-produit/ Link to comment Share on other sites More sharing options...
PiterKa Posted November 7, 2013 Share Posted November 7, 2013 it seems i have the same bug. i opened a new post for it : http://www.prestashop.com/forums/topic/274396-messages-derreurs-dans-le-formulaire-commentaire-produit/ Hi, how you solved this problem ? I have tried replace data: $('#fancybox-content form').serialize(), with data: $('#new_comment_form form').serialize(), as mentioned in the topic you linked, but this is still not working for 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