Greetings and Regards
I installed Extension: DiscussionTools.
If $ wgLanguageCode = "fa"; Does not show the replay button
If $ wgLanguageCode = "en"; Indicates the replay button
I did not find the reason
mediawiki 1.36.1
https://extdist.wmflabs.org/dist/extensions/DiscussionTools-REL1_36-e13364f.tar.gz
Description
Event Timeline
Hi @Mahdi_Alavi_sokot, thanks for taking the time to report this! For future reference, please follow https://www.mediawiki.org/wiki/How_to_report_a_bug when creating tasks here, and follow the structure of the bug report template linked at the top of the page.
Could you please provide two screenshots which show the problem, plus check your web browsers developer tools how the code differs? Thanks!
Thank you very much for your prompt follow-up.
I sent you two photos as a link
Please see:
https://phabricator.wikimedia.org/F34641850
https://phabricator.wikimedia.org/F34641851
Images updated on Mozilla Developer
(For future reference, please upload screenshots to Phabricator itself instead of third-party websites.)
Could you please inspect and compare the HTML in the web browser's developer tools? See for example https://developer.mozilla.org/docs/Tools/Page_Inspector/How_to/Open_the_Inspector for Firefox.
Hi, I'll write this one last time: Could you please inspect and compare the HTML in the web browser's developer tools? See for example https://developer.mozilla.org/docs/Tools/Page_Inspector/How_to/Open_the_Inspector for Firefox.
I cannot, as displaying a "reply" link requires a login. It would be really helpful if you could inspect (!) the HTML source code (!) and compare between the two (!). See https://developer.mozilla.org/docs/Tools/Page_Inspector/How_to/Open_the_Inspector or so
Hi @Mahdi_Alavi_sokot, I had a look at your wiki.
It looks like you have customized the default date format used by the wiki (possibly using $wgDefaultUserOptions['date'] = 'persian';, although I can't check that). DiscussionTools doesn't currently support that :(
I'm sorry, but DiscussionTools doesn't currently support all of the date formats supported by MediaWiki. We've built the tool with Wikimedia wikis in mind, and we only added support for the date formats that they required (and the Persian Wikipedia uses the default date format).
Please try removing the override to use the default date format for the Persian language (or change it to use any format using the Gregorian calendar, where the current year is shown as 2021 or ۲۰۲۱, instead of the other available calendars).
(Also, note that only comments where the timestamp uses the currently configured date format and language can be recognized and have a [reply] button, so you'll have to post some new comments to test after changing those settings.)
If anyone wanted to add support for one of the unsupported MediaWiki date formats, you'd have to:
(1) Identify the formatting codes used by the date format, for example:
- https://gerrit.wikimedia.org/g/mediawiki/core/+/0369df7bf71f1d2c012a44e130da4c4d7d0eede3/languages/messages/MessagesFa.php#418 xij xiF xiY
- https://gerrit.wikimedia.org/g/mediawiki/core/+/0369df7bf71f1d2c012a44e130da4c4d7d0eede3/languages/messages/MessagesHe.php#347 xh xjj xjx xjY
Their meaning is documented here: https://gerrit.wikimedia.org/g/mediawiki/core/+/0369df7bf71f1d2c012a44e130da4c4d7d0eede3/includes/language/Language.php#814
(2) Add support for parsing them to DiscussionTools:
- Extend the regexp generator so that it can find the timestamps on the page:
- Extend the date parser, so that it can parse the date and time out of the timestamp: (and represent it in the Gregorian calendar)
Make sure that you use the same date calculations (except in the opposite direction) as MediaWiki uses to display these formats, e.g.:
- https://gerrit.wikimedia.org/g/mediawiki/core/+/0369df7bf71f1d2c012a44e130da4c4d7d0eede3/includes/language/Language.php#1523
- https://gerrit.wikimedia.org/g/mediawiki/core/+/0369df7bf71f1d2c012a44e130da4c4d7d0eede3/includes/language/Language.php#1414
(3) Add test cases here:
- https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/DiscussionTools/+/6da23e4d0088d5ac119a7a4c52d90810d9b28985/tests/cases/timestamp-regex.json
- https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/DiscussionTools/+/6da23e4d0088d5ac119a7a4c52d90810d9b28985/tests/cases/timestamp-parser.json