Switch screen OCR translation plugin based on Tesla

Hi, I'm shipengliang.

There are some games on the market that do not have English. If they can be translated in real time, more people will have the opportunity to experience different games.

Recently found a great plugin that can do OCR on screenshots and translate them into the target language using Google Translate.
Based on the author's authorization, I wrote a guide, so I came here to publish a tutorial, hoping to help interested students.
This plugin wrote by https://github.com/kawaii-flesh, GitHub Link: https://github.com/kawaii-flesh/TraNX/blob/main/README-en.md

If you are not a beginner, you can directly visit the GitHub link above to deploy the environment and use the plugin yourself.

The following tutorial is only for beginners. You should already installed Tesla in your switch.



Server deploy
GitHub Link: https://github.com/kawaii-flesh/TraNX-Server/blob/main/README-en.md

  1. Download and install Python: https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe
  2. Download and unzip to drive C: https://github.com/kawaii-flesh/TraNX-Server/releases
  3. Open cmd command, and go to the TraNX-Server folder:
    Code:
    cd C:\TraNX-Server-4.0.0
  4. Enter
    Code:
    python -m venv tranx-venv
    and press Enter to create a virtual environment (this command only needs to be executed once).
  5. Enter
    Code:
    tranx-venv\Scripts\activate
    and press Enter to activate the virtual environment.
  6. Copy and paste the following instructions for installing related dependencies (only need to be executed once) into the cmd window and press Enter:
  7. Code:
    pip install paddlepaddle==2.6.2 -f https://www.paddlepaddle.org.cn/whl/windows/cpu-mkl-avx/stable.html
    pip install paddleocr==2.10.0
    pip install flask==3.1.0 pillow==11.0.0 opencv-python==4.11.0.86 sentencepiece==0.2.0 protobuf==3.20.2 requests==2.32.3 symspellpy==6.9.0
    pip install googletrans==4.0.0-rc1
  8. Enter
    Code:
    python server.py --translator google
    and press Enter to start service with Google translate.
  9. If your firewall prompts whether to allow access, allow all.
  10. Only then can your Switch access your service through the LAN. If there is no error, the service on the computer is set up.
  11. If you need to shut down the server, activate the cmd command window and press the shortcut key Ctrl+C to terminate the service.

Switch deploy

  1. Download exefs.nsp: https://github.com/kawaii-flesh/nx-ovlloader/releases
  2. Replacement it to the directory sdmc:/atmosphere/contents/420000000007E51A
  3. Download and unzip TraNx : https://github.com/kawaii-flesh/TraNX/releases
  4. Copy the atmosphere and switch folders to the root directory of the memory card.
  5. Call out the Tesla floating layer and select the plug-in starting with TraNX. At this point, a green pixel block will appear in the upper left corner of the screen.
  6. Press the L joystick once and the pixel block in the upper left corner will turn yellow, which represents touch interaction mode.
  7. Press the left arrow key, the pixel block in the upper left corner disappears, and the TraNX translation plug-in is exited.
  8. In DBI's MTP mode or Hekate's USB mode, copy the
    Code:
    /config/TraNX/config.ini
    file to your computer.
  9. Open the ini file, change the 127.0.0.1 after the uploadURL to the LAN IP of the computer where the service is located, and then overwrite the configuration file.
  10. The configuration of Switch is now complete. As long as the computer LAN IP does not change, there is no need to edit the configuration file.
  11. Start the game you want to translate, call out the Tesla pop-up window, select the plug-in starting with TraNX, and a green pixel block will appear in the upper left corner of the screen.
  12. Press the L joystick once, the pixel block in the upper left corner will turn yellow, and you will enter touch interaction mode.
  13. Press and hold the right arrow key and drag with your right hand to select the area to be translated. After dragging, press the R joystick to send the translation request.
  14. If the network is normal, your computer command line will show that the request has been received. At this time, the computer browser visits http://127.0.0.1:1785, and you can see the game's TID and settings interface.Scroll to the bottom, the Source Language under Translation Settings is the original language of the text you need to translate;Target Language is the language you want to translate into;
  15. 1749443779562.png
  16. After setting, click Save Settings to save the configuration.
  17. Scroll to the top and click Recognize Text in the Text Recognition Results section to test the translation results. If the results are displayed normally, all debugging has passed.
  18. After that, return to Switch and press the L joystick to switch to interactive mode, hold down the right arrow key, drag with your right hand to select the area to be translated, press the R joystick to translate, and then press the L joystick again to switch back to game mode to play the game.
  19. If the translation area does not change, you only need to press the L joystick once each time to switch to interactive mode, press the R joystick to translate, and then press the L joystick again to switch back to game mode to play the game.
  20. To exit the translation plugin, in interactive mode, press the left arrow key.
 
One suggestion, perhaps it may be easier for the user if a special camera app is made for PC. User buy a hdmi to usb stick that cost like $10. Run this camera app and get real time translation without any more action needed by the user. There will be latency when camera app is used to play game but other than action that requires precise timing this would work quite well for most game.
 
One suggestion, perhaps it may be easier for the user if a special camera app is made for PC. User buy a hdmi to usb stick that cost like $10. Run this camera app and get real time translation without any more action needed by the user. There will be latency when camera app is used to play game but other than action that requires precise timing this would work quite well for most game.
Roger. Wow, it's an honor to receive advice from the Cheat master. I'll pass it on.
 
  • Like
Reactions: TomSwitch
Fwiw using Google Lens to ocr and any good LLM for translation would improve it significantly.
For local OCR oneocr (snipping tool ocr) on Windows and apple live text on mac are both great
For Lens/live text i have a python implementation here https://github.com/AuroraWright/owocr
oneocr here https://github.com/AuroraWright/oneocr
I know from experience paddleocr is pretty terrible in comparison to either of those
 

Site & Scene News

Popular threads in this forum