Skip to content

Add translations and transliteration support to lyrics - #152

Open
adaliea wants to merge 23 commits into
masterfrom
07-19-add_translations_and_transliteration_support_to_lyrics
Open

Add translations and transliteration support to lyrics#152
adaliea wants to merge 23 commits into
masterfrom
07-19-add_translations_and_transliteration_support_to_lyrics

Conversation

@adaliea

@adaliea adaliea commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Languages tab for generating, editing, aligning, and importing translations and transliterations, with TTML import/export support for main and background vocals. Alternate-language text shares the original lyrics' timing rather than creating a second timing track.

Languages panel with Korean transliteration, English and Spanish translations, and background-vocal fields

What changed

  • Language authoring: automatic transliteration and English translation, selectable source language, additional translation targets, editable main/background fields, and regeneration of all or selected tracks. Existing project languages stay synchronized across loads and undo/redo.
  • Review workflow: stale-content and alignment-error summaries, navigation badges, links to affected lines, and per-field review indicators.
  • Explicit timing alignment: an “Align timing” editor maps transliteration fragments to existing timed syllables. Pronunciation/word spacing is preserved independently of timing; spaces are untimed and dashes are literal text.
  • Paste import: multiline pastes open an editable line-mapping dialog. Mapping first preserves blank rows, then retries without them, with manual correction available before applying.
  • Sync and Timeline: an Original / Transliteration toggle (L), paired original/transliteration syllable splitters, and alternate-language preview rendering.
  • TTML round trips: translations and transliterations use iTunes metadata linked to lyric lines, including background vocals. Valid transliteration mappings retain the original timing; unresolved mappings export canonical text without fabricated word timing.
  • Editing consistency: track text and timing mappings are reconciled through edits, splits, merges, group/template duplication, and fill/copy operations, preserving explicit fragments and joiners and removing obsolete mappings when a track is cleared.
  • Provider safeguards: bounded concurrency, caching, cancellation, response validation, script fallback, and normalized Chinese language aliases. Request failures are distinguished from successful responses with no alternate text.
  • Navigation: Languages is Mod+3; Sync, Timeline, Preview, and Export move to Mod+4 through Mod+7.

Preservation and compatibility

  • Automatic generation preserves manual edits. Explicit regeneration replaces the selected existing content; unselected tracks and edits made while a request is running are protected. Late results are checked against the current project, source, lines, and targets before being applied. Failed main/background requests preserve the affected existing track.
  • Saved projects now use format version 3, with migrations from versions 1 and 2. Pre-PR lyric lines without alternate-language fields remain valid; migration does not discard them.
  • Migration was code-audited and helper-tested, but is not exhaustively covered by legacy-project end-to-end or interrupted-storage-write tests. Older Composer versions reject version-3 project imports, so retain a pre-upgrade project export if rollback is needed.

Screenshots

Fresh captures from the rebased branch using manually authored demo lyrics in an isolated browser session.

Selective regeneration

Choose transliteration and/or individual translation languages; only selected content is replaced.

Selective regeneration menu

Timing alignment and formatting help

Place invisible boundaries against existing timed parts and inspect the resulting mapping before saving.

Transliteration alignment editor with original timings and a bam / ha / neul mapping

Formatting help explains pronunciation spacing, word spacing, and literal dashes.

Transliteration formatting help

Review and alignment-error states

Separate summaries and navigation badges distinguish content needing review from incomplete timing mappings.

Language review and alignment-error summaries with navigation badges

Multiline paste import

Preview and correct the mapping before importing; this example ignores an extra blank row.

Paste import dialog with English line mapping

Sync, Timeline, and paired syllable splitting

Transliteration labels in Sync retain the original timing controls, including background vocals.

Sync with transliteration labels

Timeline labels and the preview sidebar show the same alternate-language content.

Timeline with transliteration labels and preview sidebar

The paired splitter lets authors choose matching original and transliteration boundaries.

Paired original and transliteration syllable splitter

Playback preview

Original lyrics, transliteration, and translation appear together, including background content.

Playback preview with original lyrics, transliteration, and English translation

Verification

Rebased onto master (0a0f611) without conflicts; verified at 0fe6643:

  • 3,515 unit tests passed across 213 files.
  • 1,800 browser tests passed across 220 files.
  • TypeScript typecheck passed.
  • Regression coverage includes partial/malformed provider failures, in-flight edits and cancellation, project-load target synchronization, exact group mappings/joiners, cleared tracks, and unresolved TTML export.

Manual review checklist

  • Load lyrics and open Languages; check generation, source selection, and additional targets.
  • Verify automatic generation preserves manual edits; selective regeneration replaces only selected content. Edit during a request and confirm the new edit survives.
  • Paste more than three rows, including blank rows, and review the mapping before importing.
  • Correct an inferred timing map with Align timing; check review/error navigation and spacing preservation.
  • Toggle labels with L in Sync/Timeline and use the paired splitter without changing unrelated timings.
  • Export and re-import TTML with translations, transliteration, and background vocals; confirm unresolved transliteration text is retained.
  • Open a copy of a pre-PR version-1 project and compare lyrics, timing, groups, metadata, and audio before saving/exporting as version 3.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
composer b5fb402 Commit Preview URL Sep 05 2026, 04:46 AM

adaliea commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@adaliea
adaliea force-pushed the 07-19-add_translations_and_transliteration_support_to_lyrics branch from 923ed30 to 3b7bad4 Compare July 20, 2026 06:53
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit b5fb402.

@adaliea
adaliea marked this pull request as ready for review September 1, 2026 21:55
@adaliea
adaliea force-pushed the 07-19-add_translations_and_transliteration_support_to_lyrics branch from f61675f to dcdc249 Compare September 1, 2026 22:02
@adaliea
adaliea force-pushed the 07-19-add_translations_and_transliteration_support_to_lyrics branch from a55da65 to 0fe6643 Compare September 4, 2026 23:57
@adaliea
adaliea requested a review from boidushya September 5, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant