Skip to content

0xra0/Xml-Lore-Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XML Lore Translator

v2.2.1.0 — AI-powered translation tool for Bethesda game mod XML files (Skyrim, Fallout, Starfield).

Translates SSTXMLRessources XML files used by SST (Script Simulator Tool) and similar Bethesda modding tools, using a local Ollama model, DeepL, or any OpenAI-compatible cloud API.


Features

  • Multi-backend translation — Ollama (local LLM), DeepL API, or any OpenAI-compatible endpoint
  • Batch processing — Tier 1 → Tier 2 → Tier 3 cascade for maximum accuracy and retry resilience
  • Prompt customization — per-universe style presets (Skyrim / Fallout / Starfield / General), formality, vocabulary, grammar, expression rules, and free-text context
  • User glossary — force specific term translations, applied as a priority override
  • Dictionary manager — stack-based native and XML dictionaries per game profile
  • Partial save on stop — emergency save of already-translated entries when interrupted
  • Drag & drop — drop XML files or entire folder queues onto the app window
  • Multi-language UI — interface available in multiple languages
  • Dark theme — custom dark UI built with customtkinter

Supported XML Format

<SSTXMLRessources>
  <Content>
    <String sID="000016" List="0">
      <Source>Original text</Source>
      <Dest/>
    </String>
  </Content>
</SSTXMLRessources>

Requirements

  • Python 3.13+
  • Ollama (for local translation) — or a DeepL/OpenAI-compatible API key
  • Dependencies:
pip install -r requirements.txt
Package Purpose
customtkinter Modern dark-theme GUI
tkinterdnd2 Drag & drop support
requests HTTP calls to Ollama / cloud APIs

Installation

git clone https://github.com/0xra0/Xml-Lore-Translator.git
cd Xml-Lore-Translator
pip install -r requirements.txt
python main.py

Usage

  1. Select backend — choose Ollama (local), DeepL, or Cloud API in the URL/settings bar
  2. Select model — pick an Ollama model or enter your API key
  3. Set target language — choose the output language
  4. Load files — drag & drop XML files or use the file picker
  5. Configure prompt (optional) — click the Prompt button to set universe style, formality, glossary
  6. Start — click Start; progress is shown live; Stop saves partial results

Configuration

config.json is created automatically on first run. Key settings:

Key Default Description
target_language Portuguese (Brazil) Output language
batch_size 20 Strings per translation batch
ui_language en Interface language

Project Structure

main.py                          # Application entry point & GUI
modules/
  translator.py                  # OllamaTranslator — batch/tier translation engine
  xml_processor.py               # XML extract → JSONL → reinject pipeline
  openai_compatible_translator.py # DeepL / OpenAI-compatible API backend
  prompt_manager.py              # Style preset builder
  style_presets.py               # Universe-specific prompt templates
  ui_dictionaries.py             # Dictionary manager window
  ui_translations.py             # App UI string translations
  user_glossary.py               # User glossary manager
  bethesda_loader.py             # Bethesda game path detection
  glossario.py                   # Glossary term lookup
  utils.py                       # Shared utilities

License

MIT — see LICENSE for details.

About

AI-powered translation tool for Bethesda game mod XML files (Skyrim, Fallout, Starfield) — Ollama, DeepL, OpenAI-compatible

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages