SATT is an automatic translation tool for text files from S.T.A.L.K.E.R. Anomaly mod.
The tool can translate base game files and mod files, for this, this tool make uses of OpenAI API and Directus as BaaS (Backend as a Service) to be able to storage the data from the text files and translate.
It´s possible to translate from other languages 😁
You need the following requirements:
Directus is used as BasS (Backend as a Service) to storage data from text files and translate later. You need to create a new project and configure the database, you can do this using a cloud service or self-hosted.Read more
You will need a collection called "Translations" with the following fields:
- id: integer
- user_created: string
- user_updated: string
- date_created: datetime
- date_updated: datetime
- filename: string (required)
- key: string (required)
- value_en: string (required)
- value_es: string (required)
- status: enum (Aprobado, Pendiente)
To install dependencies:
npm install
Create the .env
file with the following:
OPENAI_API_KEY="OpenAI Api key"
DIRECTUS_URL="Directus API URL"
DIRECTUS_STATIC_TOKEN="Directus API Token"
MODS_FOLDER="Path to MO2 mod folder"
SOURCE_LANGUAGE_KEY=eng
SOURCE_LANGUAGE=english
TARGET_LANGUAGE_KEY=spa
TARGET_LANGUAGE=spanish
Note: Source language and target language can be changed based on your preferences, but remember, you must create the folders inside src/data/
.
The following example shows how to use the tool when you need to translate from English
to Spanish
.
npm run copy:mods
Copy the files from MO2 mods folder, defined on MODS_FOLDER
from .env
file, to src/data/eng/mods
npm run translate
Translate base files from game, XML files must be on src/data/eng/base
, and then store translated files on Directus database.
npm run translate:mods
Translate mods files, XML files must be on src/data/eng/mods
, and then store translated files on Directus database.
npm run build
This command merge all translated files stored on database and generate the XML files on src/data/spa
.
Credits to: Luis Sandoval