Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

How to replace error message "Password must be between 8 and 64 characters long"

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 12-18-2024, 06:59 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 459
 

Default How to replace error message "Password must be between 8 and 64 characters long"

I am using X-cart 5.4, the language is set to French. I realized the error message "Password must be between 8 and 64 characters long". I didn't find the expression in the translation module, which is more or less normal because it is not a label.... More precisely, we have
Code:
if (\strlen($data['password']) < 8 || \strlen($data['password']) > 6 4) { $result = false; $this->addErrorMessage( 'password', 'Password must be between 8 and 64 characters long' );
in View/Model/Profile/Main.php


How do I replace this message with its French transaltion? And, more generally, where do I find all messages that are not labels (and replace them with labels)?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #2  
Old 12-19-2024, 05:35 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,199
 

Default Re: How to replace error message "Password must be between 8 and 64 characters long"

You will have to have a custom module and decorate the class overriding the method that adds this error message with your own. In your own method you can use language variable or hardcode the message as they did.


As for finding all message that are not labels - you can't really do this unless you inspect every file manually - you can search all the files for say "addErrorMessage" or whatever the method setting the message is, as it can be error or warning or success... And again you have to use custom module to make the changes
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Ed B. (12-22-2024)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:49 AM.

   

 
X-Cart forums © 2001-2020