Page MenuHomePhabricator

See summary of edit including Senses
Closed, ResolvedPublic8 Story Points

Description

Narrative:
As an editor of Wikidata-Lexeme I want to be able to see a summary of an edit including Senses so I can more easily and quickly see what was done in an edit.

BDD
GIVEN an edit that adds a Sense
THEN the edit summary says "Added new Sense L1-S1 with English Gloss: foo"

GIVEN an edit that removes a Sense
THEN the edit summary says "Removed Sense L1-S1 with English Gloss: foo"

GIVEN an edit that adds a Statement on a Sense
THEN the edit summary says "Created claim: foo"

GIVEN an edit that edits a Statement on a Sense
THEN the edit summary says "Changed claim: foo"

GIVEN an edit that removes a Statement on a Sense
THEN the edit summary says "Removed claim: foo"

GIVEN an edit that adds a Gloss to a Sense
THEN the edit summary says "Added English Gloss: foo"

GIVEN an edit that edits a Gloss to a Sense
THEN the edit summary says "Changed English Gloss: foo"

GIVEN an edit that removes a Gloss to a Sense
THEN the edit summary says "Removed English Gloss: foo"

GIVEN An edit that makes several atomic changes to a gloss
THEN The edit summary says "Glosses of L1-S1 changed"

Acceptance criteria:

  • Any edit involving a Sense produces an edit summary
  • Statement edit summaries are the same as when editing statements on items

Personas to take into account:
Niels - Active editor on Wikidata
Alex - Data user in small startup

Event Timeline

Vvjjkkii renamed this task from See summary of edit including Senses to tqbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
CommunityTechBot renamed this task from tqbaaaaaaa to See summary of edit including Senses.Jul 1 2018, 11:58 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
WMDE-leszek updated the task description. (Show Details)Jul 31 2018, 11:30 AM
WMDE-leszek updated the task description. (Show Details)Jul 31 2018, 11:34 AM
WMDE-leszek set the point value for this task to 8.Jul 31 2018, 11:40 AM

@Lydia_Pintscher do you have an example of an existing edit summary that includes the language name instead of the language code? When I tested it just now, item label addition, editing and removal all used the [language-code] form.

Edit: Nevermind, it’s [fr] locally and “French” on Wikidata. I need to figure out where that’s coming from.

Okay, so the way that “added French label” works on Wikidata is that the message wikibase-entity-summary-wbsetlabel-set is locally overridden there, with the following content:

Changed {{#language:$2|{{int:Lang}}}} label

{{#language:}} is a parser function which will render the language code $2 (the part that the original message has in brackets) as a language name in the language {{int:Lang}}. {{int:}} is a parser function that renders the message Lang in the current user language. And finally, Lang is a custom interface message in the MediaWiki namespace that has been overridden to return the current language code in each language (e. g. fr, de, be-x-old). Therefore, the message is transformed {{#language:fr|{{int:Lang}}}}{{#language:fr|en}} → “French”.

The {{#language:}} parser function requires the CLDR extension for the list of language names in other languages, otherwise it falls back to displaying the language’s autonym (e. g. «français»), which MediaWiki knows out of the box.

Presumably, the same hack could be made to work on Wikidata for Sense summaries as well, as long as we provide language codes where possible (when only one gloss is affected). But if I’m not mistaken, to make this work out-of-the-box without on-wiki hacks would require a) that we declare a dependency on CLDR (unless we judge that autonyms are no less user friendly than plain language codes?), and b) a parser function to get the current user language (and I assume there are very good reasons why this doesn’t already exist, probably related to cache headaches).

@Lydia_Pintscher: what do you make of this? Is it okay if we produce [en] instead of “English” in the summaries for now, leaving it to the Wikidata community to implement the same hack for Sense messages as well, with the option that perhaps in the future, we’ll clean this up properly, not just for Senses but also for ordinary Wikibase messages?

Here are three edits with inconsistent language handling in the edit summary:

Is this just because the local hack is inconsistently applied? Or is there more to it? Either way this local hack sounds bad. We should do this properly on our side if there is nothing keeping us from doing it.

I think it’s just inconsistently applied, yes. wikibase-entity-summary-wbsetlabel-set is overridden, -add and -remove aren’t.

Ok then go with [en] etc and we'll do a proper cleanup for all these messages in a different ticket.

Note that the language code is also included in the “auto summary” part of the message, for forms as well. For example:

Added representation of Form L123-F3: en: sandbox

I suppose when the language code is included in the “auto comment” part, we should get rid of that?

Change 449507 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Ignore auto-summary key if equal to language code

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

Lydia_Pintscher added a comment.EditedAug 9 2018, 9:21 AM

The edit summary for changing a Gloss is still wrong. It says "Set [de] gloss of Sense L1-S1: de: foo" instead of "Changed [de] gloss of Sense L1-S1: foo". Rest looks good.

hoo added a subscriber: hoo.Aug 9 2018, 1:20 PM

Hm, the message key for this is wikibase-lexeme-summary-set-sense-glosses (which is in line with wikibase-lexeme-summary-set-form-representations for form representations). Form representation change edit summaries currently render as: Changed representation of Form L1-F1: de-at: foo.

We can easily change the message content… but I'm wondering whether we should also change the message key (which is still possible given that this is not in production yet… but this would make this inconsistent with form representations).

Change 451651 had a related patch set uploaded (by Hoo man; owner: Hoo man):
[mediawiki/extensions/WikibaseLexeme@master] Change edit summary for Gloss changes

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

hoo claimed this task.Aug 9 2018, 3:57 PM
hoo moved this task from Test (Product Review) to Peer Review on the Wikidata-Senses-Iteration2 board.
hoo added a subscriber: Lucas_Werkmeister_WMDE.

After discussing this with Lydia, we decided to change the message content and no longer append the language key. The message should look like this: "Changed [de] gloss of Sense L1-F1: foobar".

We probably also want to remove the additional language autosummary arg from representations, but that's offtopic here.

hoo added a comment.Aug 10 2018, 4:43 PM

Ok, so I just looked into this again and removing the redundant languages after the summary is not easily possible. These are needed as it's possible to add/remove/change several glosses at once and still be able to denote their respective languages.

If we want a nicer solution for that, this should probably be a separate tasks. The same limitations apply to form representation edit summaries, btw.

Change 451270 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseLexeme@master] Update i18n message for changing glosses

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

Change 451270 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Update i18n message for changing glosses

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

@hoo I uploaded a suggested patch to resolve the double language code further up (https://gerrit.wikimedia.org/r/449507), but it’s not pretty. I don’t have any better solutions for that yet.

But I’ll go ahead and move this task back to product review again, since the “set” → “changed” update is done, and open a separate task for the language codes.

Change 451651 abandoned by Hoo man:
Change edit summary for Gloss changes

Reason:
duplicate

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