Page MenuHomePhabricator

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

Description

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.