@@ -206,9 +206,7 @@ def perform_translation_without_validation(
206206 target_language : str ,
207207 detail_language : Optional [str ] = None ) -> str :
208208 """Performs translation without validation for single words or short phrases."""
209- # Extract leading/trailing whitespace from original
210- leading_ws = text [:len (text ) - len (text .lstrip ())]
211- trailing_ws = text [len (text .rstrip ()):]
209+ # Strip text before sending to AI (whitespace will be restored in validate_translation)
212210 text_stripped = text .strip ()
213211
214212 # Use the detailed language name if provided, otherwise use the short code
@@ -297,15 +295,17 @@ def _process_bulk_response(
297295 response_text : str ,
298296 original_texts : List [str ],
299297 target_language : str ,
300- stripped_texts : Optional [List [str ]] = None ) -> List [str ]:
298+ _stripped_texts : Optional [List [str ]] = None ) -> List [str ]:
301299 """Process a bulk translation response.
302300
303301 Args:
304302 response_text: The raw response from the AI provider
305303 original_texts: The original texts WITH whitespace
306304 target_language: Target language code
307- stripped_texts : The stripped texts that were sent to AI (for validation )
305+ _stripped_texts : The stripped texts sent to AI (unused, for future use )
308306 """
307+ # Note: _stripped_texts parameter kept for future validation features
308+ # Current validation happens per-entry using original_texts
309309 try :
310310 # Clean the response text for formatting issues
311311 clean_response = self ._clean_json_response (response_text )
0 commit comments