Skip to content

fix(translation): translate mixed text and media article content - #1053

Draft
marcomarcogd wants to merge 1 commit into
DevXDojo:mainfrom
marcomarcogd:codex/fix-full-article-translation
Draft

fix(translation): translate mixed text and media article content#1053
marcomarcogd wants to merge 1 commit into
DevXDojo:mainfrom
marcomarcogd:codex/fix-full-article-translation

Conversation

@marcomarcogd

Copy link
Copy Markdown
Contributor

Description

Fixes article body translation when RSS content contains direct text nodes next to images or other media. The renderer now wraps orphaned text nodes into semantic paragraphs before the existing translation pipeline runs, keeps translation scoped to the active article, and allows failed translations to be retried.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✅ Test addition/update

Related Issues

Fixes #909

Changes Made

  • Wrap non-empty direct text nodes in rendered RSS content before collecting translatable elements.
  • Scope content translation to the current article container and discard stale responses after article switches.
  • Reset translation deduplication state after failures so retrying works.
  • Add an end-to-end regression case for text followed by an image.

Testing

Test Configuration

  • OS: macOS
  • MrRSS Version: current main
  • Node Version: 26.7.0

Test Steps

  1. npm run lint
  2. npm run build
  3. npm run test:e2e:spec -- cypress/e2e/article-operations.cy.ts

The new mixed text/media translation case passes. Two pre-existing filter-label cases in the same Cypress spec still fail unchanged because the current UI no longer exposes the text selectors used by those tests.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • The new regression test passes locally

Breaking Changes

None.

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.

[BUG] 我仍然不能全文翻译

1 participant