Divay is a command-line tool written in Rust for extracting and translating text from The Elder Scrolls III: Morrowind game files (.esm and .esp). It provides a complete workflow for creating localized versions of Morrowind mods and the base game by extracting translatable text to CSV files, facilitating translation, and reinserting the translated content back into the game files.
- Text Extraction: Extract translatable text from ESM files to CSV format
- Smart Filtering: Automatically filters out scripts, code patterns, and non-translatable content
- Text Injection: Reinsert translated text back into game files while preserving binary structure
- Selective Processing: Extract only specific record types (BOOK, INFO, GMST, etc.)
- Python Integration: Optional automated translation using transformer models via Google Colab
- Rust (latest stable version)
- Cargo package manager
git clone https://github.com/kaicsm/divay
cd divay/cli
cargo build --release
The compiled binary will be available at target/release/divay
.
Divay provides two main commands: extract
and inject
.
Extract all translatable text from a Morrowind file:
divay extract -i Morrowind.esm -o text.csv
Extract only specific record types:
divay extract -i Morrowind.esm -o dialogue.csv --types INFO
Inject translated text back into the game file:
divay inject -i Morrowind.esm -c translated_text.csv -o Morrowind_translated.esm
Divay includes a Python script (tools/translate_colab.py
) for automated translation using transformer models. This script is optimized for Google Colab environments.
-
Upload your extracted CSV file to Google Colab.
-
Install required packages:
!pip install torch transformers pandas tqdm
- Run the translation script in your Colab notebook.
Here's a complete translation workflow:
-
Extract text from the original file:
divay extract -i "Morrowind.esm" -o "original_text.csv"
-
Translate the CSV file manually or using the Python script.
-
Inject translations back:
divay inject -i "Morrowind.esm" -c "translated_text.csv" -o "Morrowind_Portuguese.esm"
-
Test the translated file by replacing the original in your Morrowind installation.
This project is licensed under the MIT License. See the LICENSE file for details.
- The Elder Scrolls III: Morrowind by Bethesda Game Studios
- OpenMW project for documentation