FIX: Do not translate new posts if show=original #271
Merged
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.
When a new post is created, and a user is in "show original" translation mode when inline translation is enabled, the new post comes in translated.
This PR fixes that by registering a custom post message callback, and checking if the user is in "show original".
Before fix
(with
show=original
new post written in Chinese, translated to English when it should not)Screen.Recording.2025-04-09.at.6.51.00.PM.mov
After fix
(with
show=original
new post written in Chinese, not translated to English with added delay)Screen.Recording.2025-04-09.at.6.47.25.PM.mov
Reviewer note: I attempted to write a system spec, but due to the way the jobs are triggered, it is not very possible.
Additional note: This case does not yet cover scrolling down the post stream.