sioyek-python-extensions icon indicating copy to clipboard operation
sioyek-python-extensions copied to clipboard

Translate from English

Open aybed opened this issue 2 years ago • 4 comments

Regarding translate extension, is it possible to translate selected text from English to any other language by using DeepL or google translate in the next coming versions? Meanwhile, this is definitely the best pdf reader for reading academic papers.

aybed avatar May 10 '23 07:05 aybed

As an example, you can modify the python script called translate.py as shown below to to translate to French.

translation = translator.translate(text, dest='fr')

gokberkgunes avatar May 10 '23 08:05 gokberkgunes

Thank you for quick reply. Could you please tell me possible locations of this file? I mean I just installed extensions by "python -m pip install sioyek'' then edited prefs_user.config file according to extension. Thanks

aybed avatar May 10 '23 08:05 aybed

Thank you for quick reply. Could you please tell me possible locations of this file? I mean I just installed extensions by "python -m pip install sioyek'' then edited prefs_user.config file according to extension. Thanks

The file is located under src/sioyek/ directory.

You may follow below approach in order to install the extensions. I am assuming you're on some sort of UNIX-like system, e.g. Linux.

  1. Clone the repository
git clone https://github.com/ahrm/sioyek-python-extensions.git
  1. Edit translate.py file.
cd sioyek-python-extensions
vim src/sioyek/translate.py
  1. Install the package
doas python -m pip install . || sudo python -m pip install .

gokberkgunes avatar May 10 '23 09:05 gokberkgunes

Thank you very much. I managed to edit python file. For windows users, the related python files for extensions are stored on Lib folder under python installation directory.

aybed avatar May 10 '23 09:05 aybed