Page MenuHomePhabricator

translatewiki shows Gadgets-legacy/he as outdated even though it was edited after the English message
Closed, ResolvedPublicBUG REPORT

Description

The message MediaWiki:Gadgets-legacy/en was updated on May 9, 2020.

The translation MediaWiki:Gadgets-legacy/he was updated on December 26, 2020.

To test:

Observed: A yellow bar appears, saying "This translation may need to be updated".

Expected: The yellow bar is not supposed to appear.

Status

A maintenance script was created and deployed to translatewiki.net. The script needs to be run for all projects and found issues need to be fixed.

Expected outcome

Some translations are no longer incorrectly shown as outdated due to message definition getting out of sync.

Event Timeline

You know you can link directly to the message?

If I inspect the translationaids API request, I see:

definitiondiff: {,…}
html: [snip]
language: "en"
revisionid_new: 9414880
revisionid_old: 9414880
value_new: "Gadget is not loaded. Please migrate to ResourceLoader. ([https://www.mediawiki.org/wiki/Special:MyLanguage/ResourceLoader/Migration_guide_(users) Learn more])"
value_old: "Gadget is not loaded. Please migrate to ResourceLoader. ([https://www.mediawiki.org/wiki/Special:MyLanguage/Special:MyLanguage/ResourceLoader/Migration_guide_(users) Learn more])"

Then if I check the revtag table:

MariaDB [translatewiki_net]> select * from bw_revtag where rt_revision = '9414880';
+-------------+---------+-------------+----------+
| rt_type     | rt_page | rt_revision | rt_value |
+-------------+---------+-------------+----------+
| tp:transver | 4453023 |     9414880 | 9414880  |
+-------------+---------+-------------+----------+
1 row in set (0.001 sec)

MariaDB [translatewiki_net]> select * from bw_page where page_id = '4453023'\G
*************************** 1. row ***************************
           page_id: 4453023
    page_namespace: 8
        page_title: Gadgets-legacy/en
 page_restrictions: 
  page_is_redirect: 0
       page_is_new: 0
       page_random: 0.420246329573
      page_touched: 20200509200837
       page_latest: 9414880
          page_len: 178
page_content_model: wikitext
page_links_updated: 20200509200837
         page_lang: NULL
1 row in set (0.000 sec)

This means that for some reason we are adding revtags in the source language as well, but that is just a red herring.

Anyway, given revision_new and revision_old should be the same, there should be no difference. Yet, there is and this is because MessageGroupCache is outdated wrt. to the wiki. Or so I thought... It's not confirmed by manual testing:

>>> $group = MessageGroups::getGroup( 'ext-gadgets-user' );
=> MediaWikiExtensionMessageGroup {#4067}
>>> $group->getMessage( 'gadgets-legacy', 'en' );
=> "Gadget is not loaded. Please migrate to ResourceLoader. ([https://www.mediawiki.org/wiki/Special:MyLanguage/ResourceLoader/Migration_guide_(users) Learn more])"

So the other option is that the wiki is not up to date wrt to the MessgaeGroupCache. On further inspection that is the case: https://translatewiki.net/w/i.php?title=MediaWiki:Gadgets-legacy/en&diff=9414880&oldid=9414859 is the diff where @Raymond accidentally adds double prefix to the English string as well. I have now reverted that change, but the translation needs to be updated once more to reset the tp:transver tag.

So the other option is that the wiki is not up to date wrt to the MessgaeGroupCache. On further inspection that is the case: https://translatewiki.net/w/i.php?title=MediaWiki:Gadgets-legacy/en&diff=9414880&oldid=9414859 is the diff where @Raymond accidentally adds double prefix to the English string as well. I have now reverted that change, but the translation needs to be updated once more to reset the tp:transver tag.

@Nikerabbit No idea why I have done this, my fault anyway. I checked all translations and reverted 2 more double "Special:MyLanguage"

You know you can link directly to the message?

Yeah, but I thought I need a URL parameter, and I didn't remember it, and now I see that there's a "Link to this message" thing. Thanks :)

I have now reverted that change, but the translation needs to be updated once more to reset the tp:transver tag.

OK, I updated the translation, and it fixes it for this message.

Do you think it's a problem just in this message, or something systematic?

It's not systematic.

OK, so I guess this can be closed? :)

... Here are two more messages that appear to have the same problem:

Happy new year :)

Can you confirm whether those two you reported earlier are now fixed? I forgot to report back. Also, how are you finding these messages? I'm considering writing a script to find these.

Yes, all the previous ones are fixed.

I'm not doing something very systematic to find such messages specifically. Recently I've been fixing some Hebrew translations to make the terminology more consistent, and a few times I ran into messages that I remembered editing recently, and seeing them with the yellow warning.

Change 655860 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/Translate@master] Add script to find unsynchronized definitions

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

Change 655860 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Add script to find unsynchronized definitions

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

Nikerabbit changed the subtype of this task from "Task" to "Bug Report".Jan 19 2021, 7:25 AM

@Raymond This script is now deployed. You can run it like:

twn:/srv/mediawiki/workdir/extensions/Translate (master)$ php scripts/findUnsynchronizedDefinitions.php core
Pattern matched 1 file based message group(s).
Left side is the expected value. Right side is the actual value in wiki.
MediaWiki:Editwarning-warning/en
'Leaving this page may cause you to    | 'Leaving this page may cause you to   
lose any changes you have made.        | lose any changes you have made. If you
If you are logged in, you can disable  | are logged in, you can disable this   
this warning in the                    | warning in the "{{int:prefs-editing}}"
"{{int:prefs-editing}}" section of     | section of your preferences.'         
your preferences.'                     |                                       MediaWiki:Allmessages-filter-submit/en
'Filter'                               | 'Go'                                  MediaWiki:Specialmute-label-mute-email/en
'Mute emails from this                 | 'Mute emails from this user'          
{{GENDER:$1|user}}'                    |

There is a --fix parameter that deleted the cache for the affected group(s) that makes it easy to fix these. You can also use wildcards such as 'ext-*' to process all extensions.

This script will also highlight trailing spaces, which ought to be fixed upstream.

I am planning to run this script to fix issues in non-mediawiki projects. Would you do this for mediawiki?

I am planning to run this script to fix issues in non-mediawiki projects. Would you do this for mediawiki?

Sure I will run it for MediaWiki soon.

Works well for ext-* and mediawiki-skin-*

raymond@web2:/srv/mediawiki/workdir/extensions/Translate$ php scripts/findUnsynchronizedDefinitions.php ext-*
Pattern matched 923 file based message group(s).
Left side is the expected value. Right side is the actual value in wiki.
MediaWiki:User-fanbox-title/en
'Fanboxes'                             | 'Userboxes'

MediaWiki:Wikibaselexeme-formidformatter-separator-grammatical-features/en
', '                                   | ','

MediaWiki:Contactpage-pagetext-affcomusergroup/en
' '                                    | ''

MediaWiki:Wm-license-information-permission-reusing-link/en
'c:Commons:Reusing content outside     | 'c:c:Commons:Reusing content outside
Wikimedia'                             | Wikimedia'

core, ext-* and mediawiki-skin-* repaired now

Any idea how often I should run this script?

Ideally, no desynchronization should happen. I am not sure of the causes of these (apart from trailing whitespace), but some certainly are people modifying /en pages before we added AbuseFilter rule that prevents that.

I'd suggest something like once or twice a month to begin with. If we notice new cases, we can try to see what is the cause and do something to prevent that from happening again. If new issues do not appear, we could run the script only if we get user reports like this.

OK, I will try to run the scripts every few weeks for MediaWIki as long as no error reports show up.

@Amire80 There is currently one message left which differs in others than trailing whitespace. I've filed multiple bugs to get rid of those trailing whitespace issues too. Is this good enough to close this task?