Skip to content

Add newsletter translation with NEWSLETTER_LANGUAGES - #10

Merged
kevinhermawan merged 1 commit into
mainfrom
feat/newsletter-translation
Jun 19, 2026
Merged

Add newsletter translation with NEWSLETTER_LANGUAGES#10
kevinhermawan merged 1 commit into
mainfrom
feat/newsletter-translation

Conversation

@kevinhermawan

Copy link
Copy Markdown
Collaborator

Summary

Adds a post-assembly translation step: after each English newsletter is assembled, every language in NEWSLETTER_LANGUAGES is translated by a new translator agent and archived in a new newsletter_translations table. English stays the only language emailed. A translation failure is logged but never blocks the English send.

Also moves beats, campaign, and orchestrator from src/agents/ into a new src/newsroom/ package, keeping agent definitions in src/agents/ and orchestration logic in src/newsroom/.

Related issues

Closes #9

Changes

  • src/newsroom/ — new package with beats, campaign, orchestrator, and translation (the translation orchestration step moved from src/agents/)
  • src/agents/translator.py — new translator agent via make_agent()
  • src/agents/skills/translation/SKILL.md — tone and fidelity rules for the translator
  • src/db/newsletter_translations.pyNewsletterTranslation model and upsert_translation/get_translation helpers
  • alembic/versions/0002_newsletter_translations.py — migration for the new table
  • src/db/newsletters.py — status string changed from "complete" to "completed" for consistency
  • Tests, docs, and .env.example updated to match

How to test

  1. alembic upgrade head — should apply 0002_newsletter_translations cleanly.
  2. pytest — all 142 tests should pass.
  3. Set NEWSLETTER_LANGUAGES=Indonesian and run python src/app.py run; check newsletter_translations in Postgres for a row per delivered ticker.

@kevinhermawan
kevinhermawan merged commit 68fde8a into main Jun 19, 2026
2 checks passed
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.

Add newsletter translation with NEWSLETTER_LANGUAGES

1 participant