: Mafkers Docs

Smart Re-Patching

Learn how Smart Re-patching keeps your translation mod working after game updates.

Smart Re-patching is Mafkers’ flagship feature that keeps your translation mod working even after game updates.

How It Works

When a game updates, the update can change file hashes or structure, breaking your translation mod. Smart Re-patching solves this:

  1. Version Detection: Mafkers monitors your game’s version
  2. Hash Comparison: When the game updates, Mafkers detects changed files
  3. Delta Translation: Only strings that actually changed are re-translated
  4. Cache Utilization: Previous translations are reused from cache

This saves 80-95% of LLM cost compared to full re-translation.

Using Smart Re-Patching

  1. Open Mafkers
  2. Go to “History” tab
  3. If a game has been updated, you’ll see an “Update available” badge
  4. Click “Re-patch”
  5. Mafkers will:
    • Re-extract strings from updated game files
    • Compare with cached translations
    • Only translate new/changed strings
    • Inject updated translations

How Cache Works

Mafkers stores translation cache locally on your device (in ~/.mafkers/db.sqlite). Each translated string is cached with:

  • Source text
  • Translated text
  • Source language
  • Target language
  • Context hash

When re-patching, Mafkers looks up each source string in the cache. If found, the cached translation is used (no LLM call needed). Only strings not in cache are sent to the LLM.

cache/lookup.ts typescript
// Cache lookup example
const cached = await db.get('translations', {
source: "Hello, world!",
sourceLang: "en",
targetLang: "id"
});

if (cached) {
return cached.translated; // Use cached translation
} else {
return await llm.translate(source, sourceLang, targetLang);
}

What Triggers Re-Patch

  • Game update (version change detected)
  • Manual re-patch (via History → Re-patch button)
  • File hash mismatch (game file was modified)

Limitations

  • If game update changes the engine version significantly, full re-translation may be needed
  • Cache is per-project (different games have different caches)
  • Cache is stored locally - uninstalling Mafkers deletes cache

Cache Persistence

Cache is stored in ~/.mafkers/db.sqlite. If you uninstall Mafkers, the cache is deleted. Consider backing up this file if you want to preserve translation history.

Was this page helpful?