Page MenuHomePhabricator

Extract AutoCommentFormatter and SummaryFormatter into a new Library
Closed, DeclinedPublic


As investigated in T214917, we want to extract a simple SummaryFormatter and AutoCommentFormatter into an external library.
This library should be independent from Wikibase and be reusable by other MediaWiki extensions that do not have a connection to or similarity with Wikibase.

acceptance criteria

  • create gerrit repository
  • start security review
  • start packagist deployment
  • extract library from Wikibase and have Wikibase depend on that library

Event Timeline

Michael triaged this task as Medium priority.Feb 5 2019, 4:42 PM
Michael created this task.

Thinking about possible names for the library that is to be extracted.


  • mediawiki/CommentAutoFormatter
  • mediawiki/MultilingualComments
  • mediawiki/TranslatableComments
  • ???

I get the impression that “edit summary” is the user-facing term and “comment” the developer-facing term (see e. g. the [comment table]( And I think something emphasizing the functionality would make more sense, i. e. I’d prefer “multilingual comments” (what the extension provides) over “comment auto-formatter” (one of its compontents).

”mediawiki/TranslatableComments” would be another suggestion, but I think “multilingual” sounds better to me.

+1 mediawiki/TranslatableComments

Change 488519 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Split SummaryFormatter class into interface+classes

I went ahead and implemented the part of this that can already be done without a new Gerrit repository: splitting the Wikibase code into what will be extracted and what will stay in Wikibase.

We discussed the naming a bit more and settled on TranslatableSummaries.
The reasoning was:

  1. translatable communicates what is provided but also indicates that there is more work to be done
  2. Summaries explains which part of MediaWiki we are talking about. While comments seems indeed to be the more dev-facing term, as a name for a library it might create confusion with the comments on a talk-page becoming translatable

@LucasWerkmeister, @Tarrow and @hoo: What do you think about that name?

“Summaries” also sounds misleading to me – I would prefer at least “EditSummaries” so it doesn’t sound like a summary of a Wikipedia article or something like that.

(Do we use translatable comments for anything other than edit summaries, e. g. log messages? Not as far as I’m aware, at least…)

We decided that we’re not going to extract this new library after all (my preliminary patch Id635a82f4a already indicates that the split might not be as clean as we hoped). Instead, we’ll implement this independently from Wikibase, and experiment with using the comment_data field in the new comment table instead of just the comment text. The experience we gather here should hopefully also help us with T215422 in Wikibase.

Change 488519 abandoned by Lucas Werkmeister (WMDE):
Split SummaryFormatter class into interface classes

per T215296#4934965, we’re not extracting this library after all.