Page MenuHomePhabricator

Fix duplicate language codes in some sense edit summaries
Open, Needs TriagePublic


In some edit summaries for lexicographical data, we currently repeat the language code:

Changed [en] gloss of Sense L​3-S6: en: the sixth sense

The first one is the explicit language code of the summary, which we set in some cases if only a single gloss was affected (i. e., when there is only one language code). If more than one gloss was affected, the language code of the summary is null. This is the part of the message where we would in the future like to use language names instead of language codes – see T200814.

The second one comes from the fact that we add all the affected glosses as key-value pairs as the auto summary part, which is then rendered in key: value form. Here, the keys are not necessarily language codes: other Wikibase APIs might use property IDs as keys here, for example. And in general, this is useful:

Removed glosses of Sense L​3-S9: de: zwei Glossen, als: zwoa Glossa

If we didn’t include the keys in the auto summary, or if they weren’t rendered, you wouldn’t know from the summary which languages this edit affected.

However, we should still try to find a solution that doesn’t duplicate the language code if only a single gloss was affected.

(This was originally part of T196290: See summary of edit including Senses.)

Note that form representations in principle have the same problem; however, we currently never set the language code of the summary for them, so there’s never a duplicate language code. However, this will become necessary if we want to implement T200814 for form representations as well.

Event Timeline

I spent far too long this morning confused by these edits:

Bildschirmfoto_2021-01-05_07-39-17.png (61×467 px, 16 KB)

That looks like the user added "en: " to the beginning but when I went to remove it again, it wasn't there, so I went back to the history to see who had undone it before I could, but there weren't any new edits, so I went back to see if I had looked at an old version of the page...