Skip to content

Preserve warnings when loading translations - #3951

Merged
mathjazz merged 1 commit into
mozilla:mainfrom
MundiaNderi:3625-warning-classification
Feb 9, 2026
Merged

mathjazz merged 1 commit into
mozilla:mainfrom
MundiaNderi:3625-warning-classification

Conversation

@MundiaNderi

Copy link
Copy Markdown
Collaborator

Fixes #3625

Previously, we were indiscriminately reseting failed checks every time the editor result changed, including at the initial load of a translation.

This fix checks whether the current editor content differs from the initial loaded content before clearing the warnings.

To test this issue:

  1. Submit a string such as shown in the linked issue
  2. Get a warning and click on the save anyway button
  3. Click on the translated string to bring it back to the editor
  4. Warning should exist

Previews

  1. Before submitting
BeforeSubmitting
  1. Bring the string back to the editor after submitting
LoadingAfterSubmission
  1. Check that you're able to edit with the correct string and save
SavesWhenReEdited

Previously, we were indiscriminately reseting failed checks
every time the editor result changed, including at the initial load
of a translation.

This fix checks whether the current editor content differs from the initial
loaded content before clearing the warnings.
@MundiaNderi
MundiaNderi requested a review from mathjazz February 6, 2026 15:52
@MundiaNderi

Copy link
Copy Markdown
Collaborator Author

Now I've seen some inconsistencies after looking at the screenshots in depth. When you reload the translation it only shows the first warning and the others are not shown. Logs from the FailedChecksData.tsx useEffect

Screenshot 2026-02-06 at 19 09 09

@mathjazz

mathjazz commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the patch, @MundiaNderi!

Now I've seen some inconsistencies after looking at the screenshots in depth. When you reload the translation it only shows the first warning and the others are not shown. Logs from the FailedChecksData.tsx useEffect

Do you want me to hold off the review until these inconsistencies are resolved?

@MundiaNderi

MundiaNderi commented Feb 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks for the patch, @MundiaNderi!

Now I've seen some inconsistencies after looking at the screenshots in depth. When you reload the translation it only shows the first warning and the others are not shown. Logs from the FailedChecksData.tsx useEffect

Do you want me to hold off the review until these inconsistencies are resolved?

Yes please hold off the review

@MundiaNderi

Copy link
Copy Markdown
Collaborator Author

Thanks for the patch, @MundiaNderi!

Now I've seen some inconsistencies after looking at the screenshots in depth. When you reload the translation it only shows the first warning and the others are not shown. Logs from the FailedChecksData.tsx useEffect

Do you want me to hold off the review until these inconsistencies are resolved?

I looked at the inconsistencies and they appear to be intentional. The cl and p checks are stored in the database and shown to everyone, but tt checks aren't saved: https://github.com/mozilla/pontoon/blob/main/pontoon/checks/__init__.py

On first submission, it shows 4 warnings - 1 cl warning and 3 tt warnings. When you bring the translated string back into the editor, only the cl warning shows. The tt warnings are computed fresh on each submission based on

request.user.profile.quality_checks,

When loading a saved translation, tt warnings are never recalculated until you fix the cl warnings and try to submit again. That's when the tt failed checks reappear:

Screenshot 2026-02-09 at 18 46 12

@mathjazz

mathjazz commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Ah, sorry for not looking into your comment more deeply - yes, that's the expected behaviour.

@mathjazz mathjazz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job!

@mathjazz
mathjazz merged commit a4dec13 into mozilla:main Feb 9, 2026
6 checks passed
first-afk pushed a commit to first-afk/pontoon that referenced this pull request Feb 11, 2026
Previously, we were indiscriminately reseting failed checks
every time the editor result changed, including at the initial load
of a translation.

This fix checks whether the current editor content differs from the initial
loaded content before clearing the warnings.
@MundiaNderi
MundiaNderi deleted the 3625-warning-classification branch February 18, 2026 06: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.

Translations with warnings are not categorized as warnings in Pontoon UI

2 participants