Lucas_Werkmeister_WMDE added a comment.
In T218127#5020863 <https://phabricator.wikimedia.org/T218127#5020863>, @Anomie wrote: > In T218127#5020389 <https://phabricator.wikimedia.org/T218127#5020389>, @Lucas_Werkmeister_WMDE wrote: > > > Then why are we even using the `Message` class for comments? > > > Because Wikibase wants i18n. Well, `Message` doesn’t have to be the only way to do i18n. We can add some hook that lets us completely bypass the `Message` and `comment_text`, and instead directly return HTML based on the `comment_data`, but then other extensions (or core) might run into the same problem later. And since nothing uses `comment_data` yet as far as I’m aware, now we still have the opportunity to find some better solution in core, instead of having Wikibase work around the issue. By the way, I noticed that this is not the first time that `Message`’s output formats aren’t quite adequate – API errors and warnings have a situation that feels similar to me. Non-legacy errors support several error formats, including `wikitext` (i. e. `$msg->text()`) and `html` (`$msg->parse()`), but also `plaintext`, “intended for human display in HTML-incapable clients.” And to generate this plaintext, which doesn’t directly match any `Message` output format, the `ApiErrorFormatter` takes the `->text()` of the message and then strips a bit of markup with a custom function, in “a minimal, best-effort transformation to make the message … more readable”. We could apply a similar transformation to a message to get its `comment_text` (except in this case the target format isn’t quite plain text), while fully parsing the message in places where HTML is expected. TASK DETAIL https://phabricator.wikimedia.org/T218127 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Lucas_Werkmeister_WMDE Cc: WMDE-leszek, hoo, Aklapper, Lucas_Werkmeister_WMDE, Anomie, daniel, pdehaye, alaa_wmde, Michael, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, YULdigitalpreservation, LawExplorer, Salgo60, _jensen, rosalieper, MGChecker, abian, Wikidata-bugs, aude, Dinoguy1000, Lydia_Pintscher, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
