Open Bug 1179954 Opened 4 years ago Updated 2 years ago

Add translation status field to replace approved & fuzzy

Categories

(Webtools :: Pontoon, defect, P3)

defect

Tracking

(firefox42 affected)

Tracking Status
firefox42 --- affected

People

(Reporter: osmose, Unassigned)

References

Details

The routine that updates the translated_count attribute on Stats instances is wrong; it sometimes comes up with negative counts, which is why we currently have a workaround in place to handle negative counts (https://github.com/mozilla/pontoon/blob/cf6b55b375c9a696325103ede7f28b21f0f1b2ff/pontoon/base/models.py#L550).

We should probably investigate this to see if there's a more correct way of calculating it.
Hi,

I've had a look on the bug and would love to work on it. I suspect the cause is that you're double-counting translations by separating fuzzy and approved translations. It looks like it's possible for a translation to be both approved and fuzzy in the database at once. Perhaps a better solution overall would be to have a single variable keeping track of the current state, instead of booleans for each state.
Alex,

Thank you for looking into this bug. I like your idea of using e.g. status field with different states instead of separate fields.

I'm NIing :Osmose, who has been working on refactoring Stats recently and probably has an opinion on this.
Flags: needinfo?(mkelly)
As long as we are confident that fuzzy, approved, and unapproved are all mutually exclusive, a single state field for them is a fine idea. We can use a PositiveIntegerField with some choices for the actual field itself.

Are there any other states a translation can be in that we'd want to add to the list? Is there a better term than "fuzzy" for what the fuzzy status represents?
Flags: needinfo?(mkelly)
They are mutually exclusive.

The term fuzzy comes from the PO file format and since it's the only file format using this property, I don't see the point in renaming it.

We made add another state later (rejected) if we add an option to reject unapproved translations. That would allow us to split unapproved strings into 2 groups - rejected ("triaged") and unapproved ("non-triaged"). But that's not the topic of this bug.
Priority: -- → P3
Duplicate of this bug: 1226421
Summary: Stats.translated_count calculation is incorrect → Stats.fuzzy_count calculation is incorrect
Summary: Stats.fuzzy_count calculation is incorrect → Add translation status field to replace approved & fuzzy
See Also: → 1409724
You need to log in before you can comment on or make changes to this bug.