Page MenuHomePhabricator

Language bar percentages are off
Closed, ResolvedPublic

Description

URL is fully tranalated, but until it was purged, it showed "This page is a translated version of a page MediaWiki 1.22/wmf3 and the translation is 83% complete." The language bar percentage also indicated 83% translated.


Version: master
Severity: normal
URL: https://www.mediawiki.org/wiki/MediaWiki_1.22/wmf3/nl?uselang=en
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=48971

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:22 AM
bzimport set Reference to bz47864.
bzimport added a subscriber: Unknown Object (MLST).

Sometimes cache lasts few weeks and purging doesn't help (no idea if it's same issue).

http://meta.wikimedia.org/wiki/Single_User_Login_finalisation_announcement/zh-hans

There exists 1 outdated message, but it still says 100% complete. Not sure if it's the same cache problem or it's a separate bug.

Still an issue.

As an example I just translated [1] with two translation units:

  • during translation on Special:Translate the progress bar reached 100 %
  • afterwards I noticed on the linked page that it said only 50 % were completed (purging had no effect)
  • back at Special:Translate the progress bar now also back at 50 %
  • Message group statistics also show 50 % although both translation units are translated

[1] https://commons.wikimedia.org/wiki/Template:ESO-source/i18n/de

It seems that always one translation goes uncounted (e.g. 4 translation units translated for a message group results in 75 % completion).

I noticed however that by translating an already translated unit again (enter and delete a char to bypass the initially disabled button) will update the percentage so it shoes correctly afterwards.

Be warned though, that the progress bar will go crazy during this:

  • If you do what I just described after step 1 of comment 3 the progress bar will increase by one (e.g. reaching 125 % in a message group with 4 translation units)
  • If you do what I just described after step 3 of comment 3 the progress bar will actually DEcrease by one (e.g. reaching 50 % in a message group with 4 translation units)

But at least the actual completion is correctly updated...

Thanks Eduard, but this bug is about the so called language bar i.e. the output of <languages/> on translation pages. The bug with the bar on Special:Translate was filed as bug 46739, duped to 45700, re-appeared disguised as bug 48971 and filed again as bug 60949. I'm copying your comments there.

Thanks and sorry for mixing stuff up since actually I was talking about both bugs.

I just wanted to note that the status bar on Special:Tranlsate was differently broken from the translation completion percentage shown in the <languages/> tag and the "Message group statistics". At least the latter two are the same internal value and therefore the same (this) bug I hope?

(In reply to Eduard Braun from comment #6)

At least the latter two
are the same internal value and therefore the same (this) bug I hope?

Not necessarily, they have separate caching. There is or was another bug (or multiple) for LanguageStats / MessageGroupStats, but devs think nothing can be done until the underlying cause of bug 46716 is fixed (and that bug is blocked, see there).

Sometimes cache lasts few weeks and purging doesn't help (no idea if it's same issue).

These are two different issues, at least in the current code. The actual issue reported in the task description says that purging updated the statistics but the current code doesn't actually recalculate statistics for regular purges; it only refreshes the page cache and thus the language bar from stats already calculated and stored in the DB. From my understanding, in the current code, that issue could happen if the purging was done before the DB updates are commited. But it probably won't happen frequently anymore since purge update is after the normal transactions. So this is probably not an issue anymore and if it does happen, it should be resolved simply by purging.

To investigate the other issue of stats not accounting for the latest translation after translating (see report at T106262), I added some debugging statements locally in MessageCollection::load* methods (when doing the DB query) and found that during onSave() updates, it loads from slave for calculating stats. These should be changed to load from master.

[mcloadInfo] Queried slave for update: TranslateEditAddons::onSave/MessageGroupStats::forItem/MessageGroupStats::forItemInternal/MessageGroupStats::calculateGroup/MessageCollection->filter/MessageCollection->applyFilter/MessageCollection->filterFuzzy/MessageCollection->loadInfo
[mcloadReviewInfo] Queried slave for update: TranslateEditAddons::onSave/MessageGroupStats::forItem/MessageGroupStats::forItemInternal/MessageGroupStats::calculateGroup/MessageCollection->filter/MessageCollection->applyFilter/MessageCollection->filterReviewer/MessageCollection->loadReviewInfo

Change 283491 had a related patch set uploaded (by Glaisher):
Use data from master when recalculating statistics after a translation update

https://gerrit.wikimedia.org/r/283491

Change 283491 merged by jenkins-bot:
Use data from master when recalculating statistics after a translation update

https://gerrit.wikimedia.org/r/283491

Glaisher claimed this task.

I think we can consider this resolved now. If anyone experiences issues (after this gets deployed), please re-open this task and report them here. Expected behavior is:

  • (null)? editing a translation unit will do a recalculate of the statistics and purge all the translation pages in addition to the source page.
  • purging a translation page will flush out the outdated cache (no stats recalculating). This shouldn't generally be needed, I think.