pyUGT is a pure-python universal game translator: it takes screenshots from a region you select on your screen, uses OCR (via Tesseract v5) to extract the characters, then feeds it to a machine translator to then show you a translated text. It can use online machine translator for higher accuracy such as Google Translate or DeepL, but it also includes an offline translator called Argos, so that this app can fully run offline.
Since it works directly on images, there is no need to hack the game or anything to access the text, so it works on games where there is no text hooks, such as games in an emulator. It is also cross-platform (support for Windows and Linux - experimental support for MacOSX).
Changes:
- add: new shortcut CTRL+P to display a preview of the preprocessed image that will be fed to the OCR. This allows to tweak the preprocessing parameters in realtime in the config.ini file, and see the results directly. This is inspired by a similar feature by Visual Novel OCR (Kudos to the dev for the great app and workflow! Unfortunately it is closed source and appears not maintained anymore).
To install on Windows:
- First, install Tesseract v5, installers are provided by UB Mannheim. Make sure to install the additional languages you want to translate from (eg, Japanese, there is support for both horizontal and vertical Kanji).
- Then download the pyugt_v1.x.x_bin_win64.zip file attached below (where v1.x.x is the version number of the current release), which contains the pre-bundled binary. Unzip this folder anywhere.
- Inside the unzipped pyugt_v1.x.x_bin_win64 folder, execute pyugt.exe, then follow the instructions in the console window that appears. Essentially, press CTRL+F2 for the first translation, to select the region to translate, then CTRL+F3 for next translations.
- Edit config.ini inside this folder to change parameters. You can change the parameters on-the-fly while the app is launched, they will be used for the next translations in realtime.
To install on other platforms, it's necessary to install from source, please read the detailed instructions in the README.md.
Tested on Windows 10 x64 with Python 3.10.8 Miniconda3.
Note that due to the inclusion of the offline machine translator Argos, the filesize has dramatically increased, from 11MB before to 200MB zipped and 1GB unzipped! Although this is much bigger than before, we believe that it's worth including the Argos translator given the huge benefits. But for those who do not need it, it's possible to repack with pyinstaller and exclude Argos.
Note that the language packs for the OCR nor for the offline translator Argos are included, you have to download them separately, which increase further the storage space requirements, so expect to need about 2GB to 3GB of free space in total.
Argos language packs can be downloaded from this index (and note that IPFS links are provided, hence Argos is very future-proof! Kudos to the devs for thinking about everything and providing such a wonderful tool in open-source!).
Note: 32-bits binaries are not provided anymore because of the offline translator Argos Translate which requires CTranslate2, a library that only provides 64-bits builds (although it seems it's possible to manually build a 32-bit release according to the forums, but that's a lot of overcomplication for a small project like pyugt - but if you manage to do that, PRs are welcome!).