Adding Dictionary feature #1060
SiddharthKalson
started this conversation in
Ideas
Replies: 3 comments
-
I agree, that would be amazing! |
Beta Was this translation helpful? Give feedback.
0 replies
-
there is python script to do so , for your reference # import sys
# from googletrans import Translator
# from .sioyek import Sioyek, clean_path
# import pyperclip
# if __name__ == '__main__':
# sioyek_path = clean_path(sys.argv[1])
# text = sys.argv[2]
# sioyek = Sioyek(sioyek_path)
# translator = Translator()
# # translation = translator.translate(text, dest='en')
# translation = translator.translate(text, dest='zh-cn') # Translate to Simplified Chinese first
# translation = translator.translate(translation.text, dest='zh-tw') # Translate to Traditional Chinese
# sioyek.set_status_string(translation.text)
# # Copy the translated text to the clipboard
# pyperclip.copy(translated.text)
import sys
from googletrans import Translator
import pyperclip
from .sioyek import Sioyek, clean_path
if __name__ == '__main__':
sioyek_path = clean_path(sys.argv[1])
text = sys.argv[2]
sioyek = Sioyek(sioyek_path)
translator = Translator()
translation = translator.translate(text, dest='zh-cn') # Translate to Simplified Chinese first
translation = translator.translate(translation.text, dest='zh-tw') # Translate to Traditional Chinese
translated_text = translation.text
sioyek.set_status_string(translated_text)
# Copy the translated text to the clipboard
pyperclip.copy(translated_text) |
Beta Was this translation helpful? Give feedback.
0 replies
-
new_command _translate_selected_text arch -arm64 python -m sioyek.translate "%{sioyek_path}" "%{selected_text}" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Like if i select a text it pulls its meaning and translation in a small window like it does for reference, don't want to go out of the program to look for a term everytime. Like somthing similar to a Kindle ereader.
Beta Was this translation helpful? Give feedback.
All reactions