It is a simple real-time translation application that transforms the picture taken from the screenshot into text with tesseract, then translates it to the language you want and displays it on the screen. Frankly, I wrote this program so as not to constantly go to translation while reading a pdf file.
Download from here and install. I installed to "C:\Tesseract-OCR\tesseract.exe". If you are going to install it somewhere else, you need to change the path in code.
pytesseract.pytesseract.tesseract_cmd = r"C:\Tesseract-OCR\tesseract.exe"
You can install the necessary modules by typing the following code in the folder.
pip install -r requirements.txt
You can start the program by typing the code below in the terminal. After that, just take the mouse wherever you want to translate.
python realTimeTranslate.py
You can change language from here
result = translate(details, 'tr','en') #translate(text,dest,src)
You can change translating are from here
w=1000 #width
h=130 #height
Also you can increase the height with the "+" key and decrease with the "-" key while the program is running.