@@ -145,19 +145,28 @@ def check_keywords(self, message: MeshMessage) -> List[tuple]:
145145 content_lower = content .lower ()
146146
147147 # Check for help requests first (special handling)
148- if content_lower .startswith ('help ' ):
149- command_name = content_lower [5 :].strip () # Remove "help " prefix
150- help_text = self .get_help_for_command (command_name , message )
151- # Format the help response with message data (same as other keywords)
152- help_text = self .format_keyword_response (help_text , message )
153- matches .append (('help' , help_text ))
154- return matches
155- elif content_lower == 'help' :
156- help_text = self .get_general_help ()
157- # Format the help response with message data (same as other keywords)
158- help_text = self .format_keyword_response (help_text , message )
159- matches .append (('help' , help_text ))
160- return matches
148+ # Check both English "help" and translated help keywords
149+ help_keywords = ['help' ]
150+ if 'help' in self .commands :
151+ help_command = self .commands ['help' ]
152+ if hasattr (help_command , 'keywords' ):
153+ help_keywords = [k .lower () for k in help_command .keywords ]
154+
155+ # Check if message starts with any help keyword
156+ for help_keyword in help_keywords :
157+ if content_lower .startswith (help_keyword + ' ' ):
158+ command_name = content_lower [len (help_keyword ):].strip () # Remove help keyword prefix
159+ help_text = self .get_help_for_command (command_name , message )
160+ # Format the help response with message data (same as other keywords)
161+ help_text = self .format_keyword_response (help_text , message )
162+ matches .append (('help' , help_text ))
163+ return matches
164+ elif content_lower == help_keyword :
165+ help_text = self .get_general_help ()
166+ # Format the help response with message data (same as other keywords)
167+ help_text = self .format_keyword_response (help_text , message )
168+ matches .append (('help' , help_text ))
169+ return matches
161170
162171 # Check all loaded plugins for matches
163172 for command_name , command in self .commands .items ():
@@ -360,6 +369,9 @@ def get_help_for_command(self, command_name: str, message: MeshMessage = None) -
360369 except TypeError :
361370 # Fallback for commands that don't accept message parameter
362371 help_text = command .get_help_text ()
372+ # Use translator if available
373+ if hasattr (self .bot , 'translator' ):
374+ return self .bot .translator .translate ('commands.help.specific' , command = command_name , help_text = help_text )
363375 return f"Help { command_name } : { help_text } "
364376
365377 # If not found, search through all commands and their keywords
@@ -372,6 +384,9 @@ def get_help_for_command(self, command_name: str, message: MeshMessage = None) -
372384 except TypeError :
373385 # Fallback for commands that don't accept message parameter
374386 help_text = cmd_instance .get_help_text ()
387+ # Use translator if available
388+ if hasattr (self .bot , 'translator' ):
389+ return self .bot .translator .translate ('commands.help.specific' , command = command_name , help_text = help_text )
375390 return f"Help { command_name } : { help_text } "
376391
377392 # If still not found, return unknown command message with helpful suggestion
@@ -381,7 +396,10 @@ def get_help_for_command(self, command_name: str, message: MeshMessage = None) -
381396 if hasattr (cmd_instance , 'keywords' ):
382397 available_commands .extend (cmd_instance .keywords )
383398
384- return f"Unknown: { command_name } . Available: { ', ' .join (sorted (set (available_commands )))} . Try 'help' for command list."
399+ available_str = ', ' .join (sorted (set (available_commands )))
400+ if hasattr (self .bot , 'translator' ):
401+ return self .bot .translator .translate ('commands.help.unknown' , command = command_name , available = available_str )
402+ return f"Unknown: { command_name } . Available: { available_str } . Try 'help' for command list."
385403
386404 def get_general_help (self ) -> str :
387405 """Get general help text from config (LoRa-friendly compact format)"""
@@ -481,9 +499,11 @@ async def execute_commands(self, message):
481499 # Check if command can execute (cooldown, DM requirements, etc.)
482500 if not command .can_execute_now (message ):
483501 if command .requires_dm and not message .is_dm :
484- await self .send_response (message , f"Command '{ command_name } ' can only be used in DMs" )
502+ error_msg = command .translate ('errors.dm_only' , command = command_name )
503+ await self .send_response (message , error_msg )
485504 elif command .requires_admin_access ():
486- await self .send_response (message , f"❌ Access denied: Command '{ command_name } ' requires admin privileges" )
505+ error_msg = command .translate ('errors.access_denied' , command = command_name )
506+ await self .send_response (message , error_msg )
487507 elif hasattr (command , 'get_remaining_cooldown' ) and callable (command .get_remaining_cooldown ):
488508 # Check if it's the per-user version (takes user_id parameter)
489509 import inspect
@@ -494,7 +514,8 @@ async def execute_commands(self, message):
494514 remaining = command .get_remaining_cooldown ()
495515
496516 if remaining > 0 :
497- await self .send_response (message , f"Command '{ command_name } ' is on cooldown. Wait { remaining } seconds." )
517+ error_msg = command .translate ('errors.cooldown' , command = command_name , seconds = remaining )
518+ await self .send_response (message , error_msg )
498519 return
499520
500521 try :
@@ -536,7 +557,8 @@ async def execute_commands(self, message):
536557 except Exception as e :
537558 self .logger .error (f"Error executing command '{ command_name } ': { e } " )
538559 # Send error message to user
539- await self .send_response (message , f"Error executing { command_name } : { e } " )
560+ error_msg = command .translate ('errors.execution_error' , command = command_name , error = str (e ))
561+ await self .send_response (message , error_msg )
540562
541563 # Capture failed command for web viewer
542564 if (hasattr (self .bot , 'web_viewer_integration' ) and
0 commit comments