Skip to main content

Novel Translation Utility using Sugoi Translator

Project description

Unit Test codecov

otonari-ln-translator

About the project

This automatically translates a file with Japanese into English line by line using the Sugoi Translator. This is used by the Otonari no Tenshi-sama fan translation team to generate preliminary machine translations for new novels.

Features

  1. Timeout detection
    If a 'too many requests' timeout is detected on Sugoi TL, the translation will automatically pause and resume after 5 minutes.
  2. Name translation disruption prevention
    Sometimes kanji names are misinterpreted by Sugoi TL as they have connotations (e.g Mahiru vs mid day). This translator replaces all registered names with temporary placeholders (usually the name in katakana) so they will be recognized as names and not disrupt the translation. The placeholder names are then replaced with the English character names.

Dependencies

pyautogui - for cursor / keyboard simulation
pyperclip - to interface copy / paste clipboard with python

You can install these dependencies using these two commands:

pip install pyautogui
pip install pyperclip

How to use

  1. Download translator.py and install dependencies.

  2. Configure the following constants to interface with Sugoi Translator.
    Pixel count of your monitor. This is used so you are interfacing with percentages when setting cursor locations.
    image
    Then, you need to set the cursor location so that the it lands in the correct positions on the Sugoi TL site. Right is +x and down is +y. Use the 3 commented out methods in the main code to see if the cursor lands in the spots specified below.
    imageimage image

  3. Prepare input file.
    The input file should be lines of Japanese with paragraphs separated with a blank line. Usually running OCR will give the desired format. Then, place the file in the same folder as the translator.
    image

  4. Run the code, and switch to the tab with Sugoi TL. The translation process should run until the entire file is translated.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tenshitranslator-0.0.1.tar.gz (26.2 kB view hashes)

Uploaded Source

Built Distribution

tenshitranslator-0.0.1-py3-none-any.whl (27.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page