Skip to content

Commit 912da6a

Browse files
committed
fix: improve empty text validation in recognize_locale method
1 parent bd95894 commit 912da6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lingodotdev/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def recognize_locale(self, text: str) -> str:
366366
Returns:
367367
A locale code (e.g., 'en', 'es', 'fr')
368368
"""
369-
if not text.strip():
369+
if not text or not text.strip():
370370
raise ValueError("Text cannot be empty")
371371

372372
url = urljoin(self.config.api_url, "/recognize")

0 commit comments

Comments
 (0)