MCPcopy
hub / github.com/emacs-eaf/emacs-application-framework / immersive_translation

Method immersive_translation

core/webengine.py:739–752  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

737
738 @interactive(insert_or_do=True)
739 def immersive_translation(self):
740 if shutil.which("crow"):
741 if self.immersive_translation_js is None:
742 self.immersive_translation_js = self.read_js_content("immersive_translation.js")
743
744 translate_list = self.execute_js(self.immersive_translation_js)
745 thread = TranslateThread(translate_list)
746 thread.fetch_result.connect(self.handle_immersive_translation_result)
747 self.thread_queue.append(thread)
748 thread.start()
749
750 message_to_emacs("Translate...")
751 else:
752 message_to_emacs("Please install the translation tool 'crow' before experiencing immersive translation.")
753
754 @PostGui()
755 def handle_immersive_translation_result(self, translates):

Callers

nothing calls this directly

Calls 4

read_js_contentMethod · 0.95
execute_jsMethod · 0.95
TranslateThreadClass · 0.85
message_to_emacsFunction · 0.85

Tested by

no test coverage detected