Projects BibleWeb Personal Translation Builder Export assembled translation
In Progress

Export assembled translation

Area: Personal Translation Builder Milestone: v3

Context

Problem: Users who have built up personal word-by-word gloss selections want to see and share their assembled translation — the result of all their word choices combined into readable verse text.

Solution: Collect all word selections for a user, join with the Greek word data to build complete verse text, and export as plain text, JSON, or Markdown.

Not included: A dedicated reading view for the personal translation (that could be a future feature). This is export/download only.

Functional

Users can export their assembled personal translation — all the verses where they've made word gloss selections, with their chosen glosses assembled into readable text.

Export formats:

  • Plain text: verse-by-verse with references
  • JSON: structured data with word positions and selections
  • Markdown: formatted with headers and verse references

User flow:

  1. User has made word selections across multiple verses over time
  2. Goes to Settings → Personal Translation section
  3. Clicks "Export" button
  4. Chooses format (text/JSON/Markdown)
  5. File downloads to their device

TODO: Add export button to Settings page under "Personal Translation" section

Edge cases:

  • User has no selections → export is empty or shows message
  • Some verses partially selected → unselected words use BSB default gloss
  • Very large exports (hundreds of verses) → should handle without timeout

UX & Design

Settings page integration:

  • New section: "Personal Translation"
  • Export button with format dropdown
  • Shows count of verses with selections

TODO: Design the Settings section UI

Technical

Data assembly:

  1. Fetch all word_selections for the user
  2. Group by verse coordinates (bookId, chapter, verse)
  3. For each verse, fetch greek_words to get full word list
  4. Replace default glosses with user selections at matching wordPosition
  5. Concatenate into readable sentence text

Export formats:

  • Plain text: "[assembled text] (Book Chapter:Verse)"
  • JSON: {verses: [{reference, words: [{position, original, gloss, isCustom}]}]}
  • Markdown: ## Book Chapter\n\n**Verse:** [text]\n\n---

Download: Reuse existing downloadFile(content, filename, mimeType) from apps/web/src/lib/utils/export.ts

TODO: Create bulk word selections endpoint (GET all for user) TODO: Implement assembly logic joining selections with greek_words

Files:

  • apps/web/src/routes/api/word-selections/+server.ts (create — bulk GET endpoint)
  • apps/web/src/lib/utils/export.ts (extend — add translation export formats)
  • apps/web/src/routes/(app)/settings/+page.svelte (modify — add export UI)

Status

Current: IN_PROGRESS Milestone: v3 Priority: Medium — makes the personal translation feature tangible

What's done:

  • Per-verse word selections API (GET/POST/DELETE)
  • Word selection persistence (localStorage + server)
  • Basic export utility exists (downloadFile() in export.ts)

What remains:

  • Bulk word selections endpoint (all selections for user)
  • Assembly logic (joining selections with greek_words)
  • Export format implementations (text, JSON, Markdown)
  • Settings page UI section

Dependencies:

  • Requires: word selections API (IN_PROGRESS), greek_words data (DONE)
  • Blocks: nothing (personal translation is usable without export)