Projects BibleWeb Personal Translation Builder Per-word gloss selection
Done

Per-word gloss selection

Area: Personal Translation Builder Milestone: v3

Context

Problem: Bible translations are interpretive — every Greek or Hebrew word can be translated multiple ways. Readers who study the original languages want to explore alternative translations and build their own understanding of each word's meaning in context.

Solution: In the interlinear popup, users can click any Greek or Hebrew word to see all possible translations (glosses), then select the one they prefer. Their selections build up a personal "translation" of each verse, shown in a composed bar at the bottom of the popup.

Not included: Free-text input for custom glosses. Users choose from the available options (BSB glosses, Strong's meanings, KJV usage variants). This is selection, not authoring.

Functional

When viewing the interlinear popup for a verse, users can click individual word cards to expand them. The expanded view shows alternative translation options. Clicking an option selects it as the user's preferred gloss for that word.

User flow:

  1. User opens the interlinear popup on a verse (via context menu → Greek/Hebrew)
  2. Greek/Hebrew words displayed as cards with: original text, transliteration, Strong's number, default gloss
  3. User clicks a word card → it expands showing: full definition, synonyms, selectable meaning chips
  4. User clicks a meaning chip → that word's gloss updates to the selected meaning
  5. The composed translation bar at the bottom updates, showing the user's choices assembled into a sentence
  6. Clicking the same chip again deselects it (toggles back to default)

Composed translation bar:

  • Shows at the bottom of the popup: "YOUR TRANSLATION: [word1] [word2] [word3] ..."
  • Each word is clickable — links back to its card
  • Unselected words use the BSB default gloss
  • Selected words show the user's choice (underlined)

Edge cases:

  • Hebrew words have fewer gloss options than Greek (no bsb_gloss field — heuristic extraction)
  • In Dutch mode, uses sv_gloss for word alignment and meaningsNl for Dutch alternatives
  • KJV usage drill-down (frequency-sorted translation variants with example verses) is Greek-only

UX & Design

Word cards (collapsed):

  • Greek/Hebrew text, transliteration, Strong's number, short gloss
  • Teal accent color for Greek, matching theme

Word cards (expanded):

  • Full Strong's definition (truncated at 300 chars)
  • "Also: ..." synonyms line
  • Selectable meaning chips (up to 12 for Greek, 8 for Hebrew)
  • "Translated as" frequency list with example verse drill-down (Greek only)

Selection indicator:

  • Selected word card gets word-card--selected CSS class
  • Badge showing selected text
  • Composed translation bar updates immediately

Composed translation bar:

  • Fixed at bottom of popup
  • Label: "YOUR TRANSLATION:"
  • Each word rendered as a clickable button

Technical

Component: InterlinearPopup.svelte — handles word display, expansion, and selection

Gloss sources:

  • Greek: bsb_gloss (primary), kjv_usage parsed alternatives, strongs_greek.meanings
  • Hebrew: heuristic extractShortGloss(definition, verseText), strongs_hebrew.meanings
  • Dutch: sv_gloss, meaningsNl (JSON array from strongs_greek.meanings_nl)

Selection function: selectMeaning(word, gloss) — toggles the selection in local state, updates composed translation, persists to localStorage and optionally server

Composed translation: composeTranslation() in apps/web/src/lib/utils/popup.ts — builds sentence from selected glosses, falls back to BSB for unselected words

Tier: Pro+ (interlinear feature gate)

Files:

  • apps/web/src/lib/components/bible/InterlinearPopup.svelte — main UI and selection logic
  • apps/web/src/lib/utils/popup.tscomposeTranslation(), buildGreekWordDisplays(), buildHebrewWordDisplays()
  • apps/web/src/lib/utils/text.tsextractGreekMeanings(), extractHebrewMeanings(), extractGreekGloss()
  • apps/web/src/routes/api/interlinear/[bookId]/[chapter]/[verse]/+server.ts — word data API
  • apps/web/src/routes/api/interlinear/translations/[strongsNumber]/+server.ts — KJV usage variants

Status

Current: DONE Milestone: v3 Priority: High — core of the Personal Translation Builder concept

History:

  • Concept inspired by the BibleGame interlinear view, but significantly expanded
  • Greek word-level BSB glosses aligned from the TAGNT dataset
  • Dutch SV glosses generated via Claude Sonnet alignment script

Dependencies:

  • Requires: interlinear data (DONE), Strong's lexicon (DONE)
  • Enables: word selection persistence (DONE), export assembled translation (IN_PROGRESS)

Screenshots

Feature screenshot