Skip to content

unfoldingWord/tsv-twl-creation-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

155 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“š TSV TWL Creation App

๐Ÿš€ A Powerful React Web Application for Creating and Managing Translation Word Lists (TWL)

React Material-UI Vite

Transform USFM content into high-quality TWL files with advanced collaboration and quality control features

๐Ÿ“– Quick Start โ€ข ๐Ÿ” Features โ€ข ๐Ÿ› ๏ธ Development โ€ข ๐Ÿ“š Documentation


๐ŸŽฏ What Makes This App Special?

โœจ Smart Generation: Automatically creates TWL entries from USFM content using advanced algorithms
๐Ÿ” Interactive Table: Powerful search, filtering, and editing capabilities
๐Ÿ“– Scripture Viewer: Integrated biblical text analysis with word alignments
๐ŸŽจ Modern UI: Clean, responsive Material-UI design
๐Ÿ”„ Real-time Collaboration: Seamless integration with Door43 Content Service
๐Ÿ’พ Auto-save: Never lose your work with browser local storage
๐ŸŒ Multi-language Support: Handles Hebrew, Greek, and English content


๐Ÿš€ Quick Start Guide

1๏ธโƒฃ ๐Ÿ“– Select a Bible Book and Branch

Choose Your Book ๐Ÿ“š

  • Select from the dropdown menu (e.g., "Genesis (gen)", "Matthew (mat)")
  • Choose a branch from the DCS repository (defaults to 'master')
  • Branch selection is used when fetching existing TWL files from DCS

2๏ธโƒฃ ๐Ÿ“ฅ Import Existing TWL Content (Optional)

Three Ways to Import ๐Ÿ”„

๐Ÿ“‹ Method 1: Paste Text

  • Click "Paste text" and the app will read your clipboard
  • Paste TWL content directly into the text area

๐Ÿ“ Method 2: Upload File

  • Click "Import a saved TSV file" to upload a .tsv file from your computer
  • Works with both standard 6-column TWL files and extended format files

โ˜๏ธ Method 3: Fetch from DCS

  • Click "Fetch en_twl/twl_BOOK.tsv" to download current TWL from DCS
  • Uses selected branch to fetch the appropriate version

๐Ÿ“‹ Supported Formats:

  • 6-column format: For merging with newly generated TWLs
  • 8-12 column format: Extended format files load directly into table view

๐Ÿ”„ Merge Order Option (For 6-Column Imports)

When you import a 6-column TWL file, a checkbox appears to control how the app merges the fetched content with newly generated TWLs:

Default Behavior (Checkbox Checked - Default):

  • ๐Ÿ”„ Ignore Fetched TWLs' Sort Order (recommended for first-time generation)
  • The generated TWLs maintain their order (as created by the generation algorithm)
  • Fetched TWLs that don't match generated ones are inserted based on their Bible reference position in the generated list
  • Creates a completely new sort order based on the generation algorithm
  • After merging: Rows are automatically reordered within each verse to match their position in the ULT Bible text
  • ๐Ÿ’ก Use this when: Generating TWLs for a book that has never had automated TWLs generated before

Alternative Behavior (Checkbox Unchecked):

  • โœ… Keep Fetched TWLs' Sort Order (recommended for updates)
  • The fetched/existing TWLs maintain their original order from DCS
  • New generated TWLs are inserted before or after matching existing TWLs based on context
  • Preserves the structure of previously generated lists
  • ๐Ÿ’ก Use this when: Updating a recently generated list with new changes or improvements

๐ŸŽฏ Key Difference:

Scenario Use Setting
First-time generation for a book โœ… Check "Ignore fetched order" (default)
Updating an existing TWL with new changes โŒ Uncheck
Re-generating from scratch โœ… Check "Ignore fetched order" (default)
Preserving existing sort preferences โŒ Uncheck

3๏ธโƒฃ โšก Generate or Load TWL Content

Generate TWLs ๐Ÿ› ๏ธ: Creates new TWL entries automatically from USFM using the twl-generator library
Load into Table View ๐Ÿ“Š: If you imported extended format, loads directly without generation


๐ŸŽฎ Work with the Interactive Table

๐Ÿ’พ Persistent Work

  • ๐Ÿ”„ Your work is automatically saved to browser's local storage
  • โฐ Close browser and return later - your work is preserved!
  • ๐ŸŒ Works across browser sessions until you clear browser data

๐Ÿ”ง Table Features

๐Ÿ” Filtering & Search Options

Search Functionality ๐Ÿ•ต๏ธโ€โ™‚๏ธ

The search feature allows you to find content across multiple columns:

๐ŸŽฏ Exact Match Columns (case-insensitive):

  • ๐Ÿ“ Reference: Search for exact Bible references (e.g., "1:1", "gen 1:1")

๐ŸŽฏ Exact Match Columns (case-sensitive):

  • ๐Ÿ“Š Merge Status: Search for exact status values ("OLD", "NEW", "MERGED")

๐Ÿ” Partial Match Columns (case-insensitive):

  • ๐Ÿ“ OrigWords: Search within original language words
  • ๐Ÿ”— TWLink: Search within Translation Word links
  • ๐Ÿ’ฌ GLQuote: Search within Gateway Language quotes
  • โ“ Disambiguation: Search within disambiguation options
  • ๐Ÿ”„ Variant of: Search within variant relationships
  • ๐Ÿ†” ID: Search within row IDs
  • ๐Ÿท๏ธ Tags: Search within tag values

๐Ÿ’ก Search Tips:

  • Search across all available columns simultaneously
  • Results shown if search term matches ANY column
  • Use exact matches for precise filtering
  • Use partial matches for broader searches

๐ŸŽ›๏ธ Other Filters:

  • โ“ Disambiguation Filter: Show only rows with disambiguation options
  • ๐Ÿ”„ Variant Filter: Show entries that are variants of other words
  • ๐Ÿ“Š Merge Status Filter:
    • โœ… Merged: Show rows where existing content was merged with generated content
    • โŒ Unmerged: Show rows that are either from existing content only or newly generated
  • ๏ฟฝ๏ธ Deleted Rows Filter:
    • ๐Ÿ‘๏ธ Show Deleted Rows: Show all rows including deleted ones
    • ๐ŸŽฏ Only Show Deleted Rows: Show only deleted rows
  • ๏ฟฝ๐Ÿ”— Invalid RC Links: Show entries with problematic Translation Word links

๐ŸŽฏ Row Operations

๐Ÿ—‘๏ธ 1. Delete Single Row (Smart Persistent Deletion)

  • Click the trash icon (๐Ÿ—‘๏ธ) to mark a row as deleted
  • ๐Ÿง  Smart Memory: Your deletions are remembered across sessions and future generations
  • ๐Ÿ”„ Persistent Behavior:
    • When you delete a row, it will be automatically filtered out in all future TWL generations for this book
    • When you restore (undelete) a row, it will always appear in future generations
    • Deleted rows show with a "DELETED" prefix and are visually grayed out
  • ๐Ÿšซ Protection: MERGED rows (existing TSV content) cannot be deleted to preserve existing work
  • โ†ถ Restore: Click the delete icon again on a DELETED row to restore it
  • โš ๏ธ Note: Only affects NEW and OLD rows; MERGED rows are protected from deletion

๐Ÿ”— 2. Unlink Word

  • Click the unlink icon (๐Ÿ”—) to remove all instances of that word
  • Removes ALL rows with the same OrigWords and TWLink combination
  • Also prevents this word from appearing in future TWL generations
  • โš ๏ธ Global Impact: Affects all users of the app - use carefully!

โœ๏ธ 3. Edit TWLink

  • Click anywhere in the TWLink column (except on the link text itself) to quickly enter edit mode
  • Click directly on the link text to open the Translation Word article modal
  • Allows you to correct or change which Translation Word article this entry links to
  • The TWLink column shows a subtle blue background on hover when clickable for editing

๐Ÿ“– 4. View Scripture Context

  • Click the book icon (๐Ÿ“–) to open the Scripture Viewer
  • Shows the aligned original Hebrew/Greek words with English translations
  • Displays lexicon data with Strong's numbers, lemmas, and morphology
  • Includes context verses (the target verse plus surrounding verses)
  • Words with lexicon data are highlighted and clickable for detailed information

๐ŸŽจ 5. Translation Word Articles

  • ๐Ÿ‘† Hover over TWLink or Disambiguation links: See a tooltip with the article's title/terms
  • ๐Ÿ–ฑ๏ธ Click TWLink: Opens the full Translation Word article in a modal popup
  • โ˜๏ธ View on DCS: From the article modal, click "View on DCS" to open the article on the DCS website

๐Ÿง  Smart Deletion System

The app features an advanced deletion system that remembers your choices across sessions and generations:

๐Ÿ”„ How It Works:

  1. Delete a Row: Marks the row with "DELETED" prefix and stores this decision in the cloud
  2. Future Generations: Deleted rows are automatically filtered out when generating new TWLs
  3. Restore Feature: Click delete again on a DELETED row to restore it permanently
  4. Cloud Sync: Your deletion preferences sync across devices and persist forever

๐Ÿ›ก๏ธ Protection Rules:

  • โœ… Can Delete: NEW rows (newly generated content)
  • โœ… Can Delete: OLD rows (existing content that wasn't merged)
  • ๐Ÿšซ Cannot Delete: MERGED rows (existing TSV content that was successfully merged)

๐Ÿ’ก Use Cases:

  • Remove Errors: Delete incorrectly generated entries that you never want to see again
  • Clean Up: Remove unwanted translation word associations permanently
  • Quality Control: Hide problematic entries while preserving good existing content

๐ŸŽฏ Visual Indicators:

  • Regular Rows: Normal appearance
  • DELETED Rows: Grayed out with red text and "DELETED" prefix in Reference column
  • MERGED Rows: Cannot be deleted (delete button disabled for these rows)

โฌ†๏ธ 6. Move Row Up/Down

  • โฌ†๏ธ Up Arrow: Move row up within the same reference (verse)
  • โฌ‡๏ธ Down Arrow: Move row down within the same reference (verse)
  • ๐Ÿ“ Same Reference Only: Can only move rows within the same Bible reference
  • ๐Ÿšซ Hidden States:
    • Arrow buttons are completely hidden when search/filter is active
    • Up arrow disabled if it's the first row of a reference
    • Down arrow disabled if it's the last row of a reference
  • โ†ถ Undo Support: Moving rows enables the Undo button to reverse the action
  • ๐Ÿ“„ Cross-Page Movement: If moving causes a row to move to another page, the table updates accordingly

โ“ 6. Handle Disambiguations

  • ๐Ÿ‘† Hover over disambiguation links: See the terms for each alternative word definition
  • ๐Ÿ–ฑ๏ธ Click disambiguation links: Switch between alternative word definitions
  • โ˜‘๏ธ Clear disambiguations: Click the checkbox in the Disambiguation column to remove all disambiguation options

โšก Advanced Features

๐Ÿ“ Raw Text Editing

  • ๐Ÿ”„ Switch to "Raw Text" mode to edit the TSV content directly
  • ๐Ÿ’พ Click "Save & Return to Table View" when finished
  • ๐Ÿ› ๏ธ Useful for bulk edits or complex changes

โ†ถ Undo Functionality

  • Single-level undo: Reverses your most recent change
  • Available after row deletions, disambiguations, and other table modifications
  • Only remembers one step back

๐Ÿ› ๏ธ Manage Unlinked Words

Click "Manage Unlinked Words" ๐Ÿ”ง to access the global unlinked words system:

  • ๐Ÿ‘€ View all unlinked words: See what words have been unlinked across all books
  • โž– Remove words from unlinked list: Re-enable words that were previously unlinked
  • ๐ŸŒ Global impact: Changes here affect all users of the app
  • ๐ŸŽฏ Purpose: Prevents problematic or incorrect word links from appearing in future TWL generations

๐Ÿ’พ Save and Share Your Work

๐Ÿ“ Save to File

  • Click "Save TWLs to File" ๐Ÿ“ฅ to download your complete work
  • Creates a .tsv file with all columns (8-12 columns depending on content)
  • Others can import this file into the app to continue your work
  • Useful for collaboration and backup

๐Ÿค Share with Others

  • Send your exported file to other translators or editors
  • They can import it using the "Import a saved TSV file" option
  • Preserves all your edits, disambiguations, and merge status

๐Ÿš€ Commit to DCS (Final Step)

When your TWL is complete and reviewed โœ…

  1. ๐Ÿ–ฑ๏ธ Click "Commit to DCS"
  2. ๐Ÿ‘ค Enter your name and email address
  3. ๐Ÿ’ฌ Add an optional commit message
  4. ๐Ÿ“ค Click "Commit & Create PR"

๐Ÿ”„ What Happens Next:

  • ๐Ÿ“Š Only the first 6 columns (standard TWL format) are uploaded to DCS
  • ๐ŸŒฟ A new branch is created with your changes
  • ๐Ÿ”„ A Pull Request is automatically opened for review
  • ๐Ÿ“ Extended columns (Disambiguation, etc.) are not included in DCS

โš ๏ธ Before Committing, Ensure:

  • โ“ All disambiguation options have been reviewed and selected
  • ๐Ÿ”„ Variant word relationships are correct
  • ๐Ÿ“Š Unmerged rows have been reviewed (decide if they should stay or be removed)
  • ๐Ÿ”— Invalid RC links have been checked using the filter

๐Ÿ“‹ Complete Workflow

Here's the recommended step-by-step process ๐Ÿ—บ๏ธ

๐Ÿ Phase 1: Setup and Import

  1. ๐Ÿ“– Select your target Bible book
  2. ๐ŸŒฟ Choose appropriate branch (if fetching from DCS)
  3. ๐Ÿ“ฅ Import existing TWL content (if available) using paste, upload, or fetch
    • โš ๏ธ Important Merge Strategy Decision: After importing, you'll see a checkbox to "Ignore fetched TWLs' sort order"
    • First-time generation? (no automated TWLs exist yet) โ†’ โœ… Check the box
    • Updating recent changes? (has automated TWLs) โ†’ โŒ Leave unchecked (default)
  4. โšก Generate new TWLs or load extended format content

๐Ÿ” Phase 2: Review and Edit

  1. ๐Ÿ‘€ Review the generated content in table view
  2. ๐Ÿ“– Use the Scripture Viewer to verify word alignments and context:
    • Click the book icon (๐Ÿ“–) for any row to see the biblical text with word alignments
    • Verify that OrigWords and GLQuote match correctly in context
    • Check lexicon data for accuracy of Strong's numbers and lemmas
  3. ๐ŸŽ›๏ธ Use filters to focus on specific issues:
    • Start with "Unmerged" to review new/old content
    • Check "Invalid RC Links" for broken references
    • Review "Disambiguation" entries for multiple word options
    • Check "Variant of" entries to verify any irregular forms of the article term used in the scripture
  4. โœ๏ธ Make necessary edits:
    • Delete incorrect rows (single row deletion)
    • Unlink problematic words (affects all instances globally)
    • Edit TWLinks for better accuracy
    • Select appropriate disambiguation options using hover tooltips for guidance

โœ… Phase 3: Quality Control

  1. โ“ Handle disambiguation options:
    • Hover over disambiguation links to preview terms for each option
    • Click through disambiguation links to select the best option
    • Clear disambiguations that aren't needed
  2. ๐ŸŽจ Verify Translation Word articles:
  • Hover over TWLinks to quickly check article terms
  • Click TWLinks to read full articles and ensure they match the biblical context
  • Use the Scripture Viewer to confirm word alignments make sense
  1. ๐Ÿ”„ Review variant relationships using the variant filter
  2. ๐Ÿ“Š Check merge status - ensure merged content looks correct
  3. ๐Ÿ” Use the search function to find and fix specific issues

๐ŸŽฏ Phase 4: Finalization

  1. ๐Ÿ’พ Save your work to file for backup and collaboration
  2. ๐Ÿ”„ Final review - go through filters one more time
  3. ๐Ÿš€ Commit to DCS when completely satisfied with the results
  4. ๐Ÿ“ค Share the Pull Request link with reviewers if needed

๐ŸŒŸ Additional Features

๐Ÿ“– Scripture Viewer

The Scripture Viewer provides advanced biblical text analysis ๐Ÿ”ฌ

๐Ÿš€ Accessing the Scripture Viewer:

  • ๐Ÿ–ฑ๏ธ Click the book icon (๐Ÿ“–) in any table row to open the Scripture Viewer for that specific verse

โœจ Features:

  • ๐ŸŒ Multi-language Display: Shows original Hebrew/Greek text alongside English translations (ULT and UST)
  • ๐Ÿ”— Word Alignment: Visual highlighting shows how original language words align with English translations
  • ๐Ÿ“š Lexicon Integration: Click on any word to see detailed lexical information:
    • Strong's numbers and lemmas
    • Morphological analysis (grammatical information)
    • English glosses and meanings
  • ๐Ÿ“„ Context Verses: Displays the target verse plus several verses before and after for better understanding
  • ๐ŸŽฏ Interactive Highlighting: Words matching your TWL entry are automatically highlighted
  • โšก Punctuation Handling: Smart matching works even when words have punctuation (commas, periods, etc.)

๐Ÿ” How Word Alignment Works:

  • ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡ฌ๐Ÿ‡ท Original language words (Hebrew/Greek) show lexical data when clicked
  • ๐Ÿ‡บ๐Ÿ‡ธ English words show alignment information linking back to the original language
  • โœจ Highlighting shows the specific words mentioned in your TWL entry
  • ๐Ÿ”— Supports complex quotes with multiple word parts separated by "&"

๐ŸŽจ Translation Word Article Integration

Seamless integration with Translation Word articles ๐Ÿ“š

๐Ÿ‘† Hover Tooltips

  • ๐Ÿ”— TWLink Column: Hover over any Translation Word link to see the article's main terms
  • โ“ Disambiguation Links: Hover over disambiguation options to preview their specific terms
  • โšก Dynamic Loading: Tooltips are loaded dynamically from the Translation Word articles

๐Ÿ–ฑ๏ธ Article Viewer

  • ๐Ÿ”— Click TWLink: Opens the full Translation Word article in an elegant modal popup
  • ๐Ÿ“ Formatted Content: Articles are displayed with proper markdown formatting (headings, lists, links, etc.)
  • ๐Ÿ“œ Scrollable Content: Long articles have scrollbars for easy reading
  • โ˜๏ธ DCS Integration: Click "View on DCS" to open the article on the Door43 Content Service website
  • โŒ Easy Navigation: Close with the X button to return to your work

๐ŸŒŸ Other Features

  • ๐Ÿ“ Reference Links: Click any Bible reference to open Translation Notes in a new window
  • ๐Ÿ’ฌ Long Text Tooltips: Hover over long content to see full details in a tooltip
  • ๐Ÿ‘๏ธ Column Visibility: Control which columns are displayed
  • โœ… Automatic Validation: The app checks TWL format and shows validation errors
  • ๐ŸŒ Browser Compatibility: Works in modern web browsers with localStorage support
  • ๐Ÿ“ฑ Responsive Design: Works on desktop and tablet devices

๐Ÿ”ง Troubleshooting

Common Issues & Solutions ๐Ÿ› ๏ธ

  • ๐Ÿ’พ Lost Work: Check if your browser's localStorage was cleared
  • ๐Ÿ“ฅ Import Errors: Ensure your TSV file has the correct number of columns and headers
  • โšก Generation Fails: Verify the book selection and try again
  • โ˜๏ธ DCS Commit Issues: Check your internet connection and credentials


๐Ÿ‘จโ€๐Ÿ’ป For Developers

๐Ÿ› ๏ธ Tech Stack

React Material-UI Vite Node.js

๐Ÿ“‹ Prerequisites

  • Node.js (v16 or higher) ๐ŸŸข
  • pnpm package manager ๐Ÿ“ฆ

๐Ÿš€ Getting Started

  1. ๐Ÿ“ฅ Clone the repository

    git clone https://github.com/unfoldingWord/tsv7-twl-creation-app.git
    cd tsv7-twl-creation-app
  2. ๐Ÿ“ฆ Install dependencies

    pnpm install
  3. โšก Start development server

    pnpm run dev
  4. ๐ŸŒ Open in browser Navigate to http://localhost:5173/

๐Ÿ› ๏ธ Development Commands

Command Description
pnpm run dev ๐Ÿš€ Start development server with hot reload
pnpm run build ๐Ÿ“ฆ Create production build
pnpm run preview ๐Ÿ‘€ Preview production build locally
pnpm run lint ๐Ÿ” Run ESLint for code quality checks

๐Ÿ—๏ธ Architecture

This application has been refactored into a modular, maintainable architecture ๐Ÿ›๏ธ

โœจ Key Architectural Highlights:

  • ๐Ÿงฉ Modular structure with separated concerns
  • ๐ŸŽฃ Custom React hooks for state management
  • ๐Ÿ”„ Reusable components and utility functions
  • ๐Ÿ”ง Service layer for API calls and complex processing
  • ๐Ÿ“š Comprehensive documentation and JSDoc comments

๐Ÿ“– ARCHITECTURE.md - Complete architecture documentation

๐Ÿค Contributing

Guidelines for Contributors ๐Ÿ‘ฅ

  1. ๐Ÿ“– Read the ARCHITECTURE.md to understand the codebase structure
  2. ๐Ÿ”„ Follow the established patterns for new features
  3. ๐Ÿ“ Add appropriate documentation and comments
  4. ๐Ÿงช Test changes thoroughly before submitting PRs

๐Ÿ“Š Technical Details

๐ŸŽจ Frontend

  • โš›๏ธ React 18 with Material-UI components
  • โšก Vite for fast development and building
  • ๐ŸŽฃ Custom hooks with React's built-in state

๐Ÿ”ง External Libraries

  • ๐Ÿ“š twl-generator for TWL generation from USFM
  • ๐Ÿ’ฌ tsv-quote-converters for quote processing

๐Ÿ”— API Integration

  • โ˜๏ธ Door43 Content Service (DCS) for content fetching
  • ๐Ÿš€ Netlify-ready with build configurations

๐ŸŽ‰ This tool streamlines the Translation Word List creation process while maintaining compatibility with the Door43 translation workflow.


Made with โค๏ธ by the unfoldingWord team

About

App to create TSV TWL files for a book of the ULT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages