Skip to content

Vin-meido/XUnity-AutoTranslator-SugoiOfflineTranslatorEndpoint

Repository files navigation

XUnity-AutoTranslator-SugoiOfflineTranslatorEndpoint

Translation endpoint to support Sugoi Translator's offline translation backend (https://www.youtube.com/watch?v=r8xFzVbmo7k)

Tested to support Sugoi Toolkit V10.

The Sugoi Translator's offline model boasts comparability with Deepl translations, not to mention shorter translation delay and nonexistent throttling limits.

Though just like any machine translators, there will be oddities and unexpected mistranslations. You're still better off using official/fan translations/localizations if those are available.

Even so, unless you already use SugoiTranslator (and its offline model), you might be better off using the google, deepl, or other official translation endpoints (unless you have the disk space and processing power to spare).

Requirements

XUnity.AutoTranslator 5.0.0 or newer.

SugoiTranslator's offline mode recommends at least 8GB of RAM. Make sure you have that + the amount of memory the game you're running also requires.

CUDA support requires an NVIDIA graphics card that supports it (GTX10xx, RTX series).

Installation

  1. Install XUAT. See https://github.com/bbepis/XUnity.AutoTranslator#installation for installation instructions, and then get that working with the default translators before proceeding.

  2. Install Sugoi Toolkit. See https://www.youtube.com/watch?v=r8xFzVbmo7k for details on installation and setup. Make sure you have a working translator first by running the offline translator script Sugoi-Translator-Toolkit (click here).bat then select "Sugoi Translator Offline".

  3. Get the latest SugoiOfflineTranslator.dll file from the latest release: https://github.com/Vin-meido/XUnity-AutoTranslator-SugoiOfflineTranslatorEndpoint/releases/latest/. Save it in XUAT's Translators folder. The location of this folder depends on the loader you are using to use for XUAT. Consult XUAT's installation instructions as to where to expect this folder is located at.

  4. Run your game once to generate/update the XUAT configuration file. Once the game has run and initialized properly, exit the game.

  5. Backup your XUAT configuration file (AutoTranslatorConfig.ini). After you have a backup copy, edit the configuration and change the Endpoint setting to SugoiOfflineTranslator. Your [Service] section should look like this:

[Service]
Endpoint=SugoiOfflineTranslator
FallbackEndpoint=
  1. (optional) Go to the [SugoiOfflineTranslator] section of the configuration and set the InstallPath setting to the full path where Sugoi Translator is installed/extracted. This folder is the folder that contains Sugoi-Translator-Toolkit (click here).bat.

If you installed the CUDA support, set EnableCuda to True and increase MaxBatchSize to a larger value (e.g. 100).

Optionally, if you want the translations to reflect faster, set EnableShortDelay to True. There's a bunch more configuration options you can set (refer to the configuration section for details on what they do)

Usage

Run the game. If you set the InstallPath setting, do not run the SugoiTranslator's offline mode, as the endpoint starts its own version of the server.

Once the game is running you can press Alt+0 to bring up the XUAT panel to confirm that you've configured the endpoint properly and if it's translating.

Updating

The translator endpoint may be updated by just extracting / overwriting the old plugin based on your installation. Though there may be additional steps based on what version you are upgrading from:

Version 1.5.0

Version 1.5.0+ supports SugoiToolkit V10 or newer. If you are using old versions of the toolkit, remain in version 1.4.0. This only applies if you are using the InstallPath setting.

Versions older than 1.4.0

Versions prior to 1.4.0 had an optional instruction to install XUATHooks. As of XUAT 4.21.0 / endpoint version 1.4.0, this is no longer needed. Remove the old XUATHooks dll when updating, and then set EnableShortDelay to True in the updated configuration.

Versions older than 1.2.0

Versions prior to 1.2.0 had instructions to extract SugoiOfflineTranslatorServer.py together with the translator dll. This is no longer needed and removing the old server.py file can be done.

Configuration

InstallPath: The location of your Sugoi Translator install. When set, automatically starts the translation backend internally when you start the game. This must be set to the folder that contains the various .bat batch files to start the different translator modes.

ServerPort: Dedicated port to use for the internal backend endpoint.

EnableCuda: Enables CUDA / graphics card acceleration for translation. Set to True if you installed the CUDA extensions for Sugoi Translator

MaxBatchSize: Sets the maximum amount of untranslated lines to send to the translator per batch. If your pc specifications can handle it, you can set it to a high value (100). However, the default should work fine in most cases.

CustomServerScriptPath: Sets the custom script server to use if you want to use your own or customize the backend server script.

LogServerMessages: Logs the backend server's messages into the console of your game (if your loader has it enabled). Useful when reporting a problem (or when you want to see how fast each line is getting translated).

EnableShortDelay: Reduces the 0.9s delay used by XUAT to throttle translation requests. This results in making the translations reflect faster (if your pc can handle it). If your game has scrolling text (e.g. dialog/message windows), make sure to set them to as fast as possible to avoid sending multiple requests for partial text. Disable this if you are having issues with fast scrolling / changing text.

DisableSpamChecks: Disables the general spam checks associated with online translators (since this is an offline backend, we don't necessarily need it). If your pc cannot handle too many translations requests, you can disable this, but the default should be fine for most setups.

About

TranslatorEndpoint for Sugoi Offline Translator

Resources

License

Stars

Watchers

Forks

Packages

No packages published