8000 feat(files): translate an asset's transcript into another language, when asked by adeelahmad · Pull Request #684 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(files): translate an asset's transcript into another language, when asked - #684

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-xfmkzn

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: a transcript could be read in another language only if someone uploaded a translation file for it.

After: the Files tab's Translate… has the configured model translate an asset's transcript into another language. Your browser's language is filled in, and an estimate of what it would take is shown first, labelled as an estimate. It runs only when asked, in the background, and sends the lines in batches marked as data, so instructions in a transcript are never followed. The result is kept as a translation file whose lines keep their times and speaker, and search, the Files tab and IIIF read it like an uploaded one. Every call goes in the activity ledger; a budget that would go over holds it, and one used up stops it. Agents use GET and POST /api/v1/resources/{id}/files/translate, the MCP tools translate_transcript and get_translation, and the assistant's translate_transcript, which asks first.

Motivation and Context

Item from the personal feature plan sheet (translate transcripts).

Screenshots (if appropriate):

n/a

Steps to reproduce (if appropriate):

Open an asset with a transcript, Files tab, Translate…, keep the filled-in language and press Enter: after it runs, a translation file appears in the Files tab, and searching a translated word finds the line.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (tests/api/test_translations.py, tests/api/test_mcp.py, __tests__/recording-translate.test.tsx).
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/api.md, Translating a transcript).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md. Written as changelog.d/translate.md, per build(release): changelog fragments in changelog.d/ instead of one Unreleased section #581.

Done questions (AGENTS.md)

  • Goal: delivers what the user wanted, merged on green CI.
  • Agents: usable through the API, MCP or an assistant tool. Two routes, two MCP tools and an assistant tool.
  • Zero setup: no new prerequisite, .env edit or manual step. Uses the model already configured.
  • Fewest clicks and keystrokes. One button, language filled in, Enter runs it.
  • Configurable: new settings in the web app with defaults; wizard asks only what is required. n/a: no settings.
  • Light: default install still runs on a Raspberry Pi with cloud models.
  • Private and secure: data local and encrypted, passkeys, threat model updated. New row for model-made translations: lines sent marked as data, links the transcript doesn't hold broken up.
  • Cost: cheapest path, model calls in the activity ledger, budgets respected. An estimate first, every call in the ledger, budgets hold or stop it.
  • User decides: consequential or new actions wait for the user; defaults unchanged. Runs only when asked; the assistant asks first.
  • Upgrades: existing installs upgrade safely (upgrade step for stored-data changes). Stored as the existing translation file kind; nothing changes for existing data.
  • Honest: sources cited; labelled built, in progress or planned. The cost is labelled an estimate.
  • Tests, docs and generated files updated (make openapi).
  • Open standards; dependencies keep Lens MIT. n/a: no dependencies.
  • Result reported with evidence; "refine later" items written down.
  • Reuse: existing Lens code and permissive libraries reused, nothing reinvented. Reuses supplementary translation files, the ledger and untrusted.wrap.

Local CI: the container ran several times slower than usual, so I ran the changed tests directly. test_translations.py, test_mcp.py, test_setup_assistant.py and test_scaling_agents.py passed (42 passed), and ruff is clean; the threat model validator agrees. A full ci/local-ci.sh run is still going; GitHub CI decides the merge.


Generated by Claude Code

…hen asked

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QFUNzy1QZy5HhKAyJxTAYJ
@adeelahmad adeelahmad self-assigned this Oct 19, 2026
@adeelahmad
adeelahmad merged commit 6875a47 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-xfmkzn branch October 19, 2 7575 026 13:51
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.

2 participants

0