Skip to main content

Multi-Translation Support

GospeLib supports multiple Bible translations across 31 languages, with a graph schema designed to store 4.4 million Translation nodes alongside the canonical KJV text. The interlinear view aligns different translations to the same original-language word sequence, enabling deep comparative study.

Overview

The multi-translation system addresses a fundamental architectural challenge: how to store, query, and display multiple translations of the same verse without data collisions. Each translation gets its own Translation nodes in the graph, linked to the canonical Passage node via a typed relationship that preserves the translation identity.

Supported Translations

The system is designed for 31 languages. The initial corpus includes 8 English translations under corpus/translations/, with additional languages planned for post-MVP.

The Interlinear Alignment Spine

The key insight is that the canonical alignment spine is the original-language word sequence (Hebrew for OT, Greek for NT). Each translation renders those words differently, but they all anchor to the same Strong's numbers:

Hebrew: bereishit bara elohim
Strong's: H7225 H1254 H0430
KJV: "In the beginning" "created" "God"
NRSV: "When ... began" "to create" "God"
ESV: "In the beginning" "created" "God"

This alignment enables the interlinear view to show how different translations handle the same original-language word, which is one of the Scholar tier's most valuable features.

Comparison View

The compound tab comparison system displays 2-4 translations side-by-side within a single tab:

  • Scroll sync via IntersectionObserver (100ms debounce) keeps all columns aligned at the verse level
  • Amber diff highlighting shows where translations diverge
  • Collapsible columns can be reduced to 40px strips to focus on specific translations
  • Tab identity updates to show compared translations (e.g., "Alma 32 -- KJV | JST")

Entry Points for Comparison

Users can enter comparison mode through:

  • Hover card "Compare translations" action
  • Vertical toolbar Compare button
  • Gutter indicators on verses with textual variants
  • Command palette "compare" queries

JST (Joseph Smith Translation)

The Joseph Smith Translation variants are displayed inline alongside KJV verses with word-level diff highlighting. Users can see exactly where Joseph Smith's revision diverges from the KJV text. Tapping a variant shows the source manuscript and context from the Joseph Smith Papers Project.

JST display is a Scholar-tier feature, accessed through the witness layer pull-down or the interlinear panel.

Deep Dive: Graph Schema

The multi-translation architecture uses a Modified Option C approach from the MULTI-TRANSLATION-SPEC:

  • Each verse retains a canonical Passage node with the KJV text (the default reading text)
  • Additional translations are stored as Translation nodes with a translation_id field (e.g., nrsv, esv, net)
  • Translation nodes link to the canonical Passage via a HAS_TRANSLATION relationship
  • The passage ID format for translations is {book}.{chapter}.{verse}:{translation} (e.g., gen.1.1:nrsv)

This approach avoids the last-writer-wins bug that originally caused NRSV text to overwrite KJV text in the graph, while keeping the canonical KJV text as the default response when no translation is specified.