Repository navigation
Switching back to an article's language returns the original - #938
Merged
Merged
Conversation
translate_and_adapt_article took a translation as its own source, so going da -> it -> da translated the Italian adaptation back into Danish, with a new LLM call on every hop. Follow a translation back to its original: its own language returns the original, or its version at the reader's level, and any other language translates from the original and shares its cache key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ArchLens - No architecturally relevant changes to the existing views |
… urls A translation of an upload's translation lost source_upload_id, so a later switch followed its url to the teaser the upload was made to get past. And a translation whose url starts from a simplified version stopped at that version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching language in the reader from a translated article made a new translation of the translation: Danish → Italian → Danish showed "Adapting..." again, called the LLM, and gave back the Italian adaptation in Danish instead of the original. Every further switch added another hop, because the
#translated-fromkey kept growing and never hit the cache.translate_and_adapt_articlenow follows the open article back to its original (reusingSharedArticle.resolve_original_article_id):<original>#translated-from-da-to-X-leveland a language already visited comes from the cache.Left as they were:
source_upload_id, so this holds across hops.Also removes two local
UserArticleimports in the function. They duplicated the module-level import and made the name unbound at the new early return.Tests: 7 new cases in
test_translate_and_adapt_article_switch.py; 6 of them fail without the fix (the seventh pins the unchanged same-language behavior). All 468 API tests pass. Not tried in a browser or on a device. API only, no migration.🤖 Generated with Claude Code