(self, original_text: str, translation: str)
| 84 | return result.translation if result else None |
| 85 | |
| 86 | def set(self, original_text: str, translation: str): |
| 87 | try: |
| 88 | _TranslationCache.create( |
| 89 | translate_engine=self.translate_engine, |
| 90 | translate_engine_params=self.translate_engine_params, |
| 91 | original_text=original_text, |
| 92 | translation=translation, |
| 93 | ) |
| 94 | except Exception as e: |
| 95 | logger.debug(f"Error setting cache: {e}") |
| 96 | |
| 97 | |
| 98 | def init_db(remove_exists=False): |
no outgoing calls