Add WebLLM support, fix progress bar blocking at 90%, add timeout protection

This commit is contained in:
2025-11-30 11:54:33 +01:00
parent 1d2784602b
commit 9410b07512
4 changed files with 247 additions and 8 deletions

View File

@@ -139,6 +139,16 @@ class OllamaTranslationProvider(TranslationProvider):
return []
class WebLLMTranslationProvider(TranslationProvider):
"""WebLLM browser-based translation (client-side processing)"""
def translate(self, text: str, target_language: str, source_language: str = 'auto') -> str:
# WebLLM translation happens client-side in the browser
# This is just a placeholder - actual translation is done by JavaScript
# For server-side, we'll just pass through for now
return text
class TranslationService:
"""Main translation service that delegates to the configured provider"""