Lucas_Werkmeister_WMDE added a comment.

While the current SummaryFormatter is integrated fairly closely to Wikibase, I feel like it would be possible to split it up into:

  • a generic SummaryFormatter class, where formatArg does little more than calling strval() on each message argument, and
  • a WikibaseSummaryFormatter, which extends SummaryFormatter and augments formatArg to correctly format arguments that are snaks, entity IDs, data values, etc.

To accommodate the hack in formatKeyValuePairs (“if the key looks like an entity ID, apply entity ID formatting”), a formatKey method could probably also be introduced, analogous to formatArg.

Then, I think we could extract a small package to handle automatically translated summaries (generate them with SummaryFormatter and display them with AutoCommentFormatter), and use a Wikibase-specific variant of that in Wikibase (i. ., WikibaseSummaryFormatter would stay in Wikibase) and the general variant for WikibaseSchema, because we don’t need support for entity ID arguments etc. there.


TASK DETAIL
https://phabricator.wikimedia.org/T214917

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Michael, Lucas_Werkmeister_WMDE
Cc: Michael, Tarrow, Aklapper, Lydia_Pintscher, Lucas_Werkmeister_WMDE, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, YULdigitalpreservation, LawExplorer, _jensen, abian, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to