Page MenuHomePhabricator

Support parsing date formats that do not use the Gregorian calendar (e.g. Persian, Hebrew)
Open, Needs TriagePublic

Description

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

Event Timeline

Aklapper renamed this task from Extension:DiscussionTools to Does not show Reply button wirh $wgLanguageCode = "fa" on third-party installation.Sep 13 2021, 11:32 AM

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!

Aklapper changed the task status from Open to Stalled.Sep 13 2021, 11:34 AM

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.

(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.

The above links were updated for the screenshot

Please see my previous comment again.

Please see my previous comment again.

Respectfully
Images updated on Mozilla Developer
Thanks

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

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
Please delete your username and password after viewing this page
Thanks

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.)

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 :(

Hi @matmarex

Hi @Aklapper

I made the corrections you said

The problem was completely solved

Thank you very much for following up

Thanks for posting

Aklapper renamed this task from Does not show Reply button wirh $wgLanguageCode = "fa" on third-party installation to Does not show Reply button after customizing $wgDefaultUserOptions['date'] on third-party installation.Sep 14 2021, 1:32 PM
Aklapper changed the task status from Stalled to Open.
matmarex renamed this task from Does not show Reply button after customizing $wgDefaultUserOptions['date'] on third-party installation to Support parsing date formats that do not use the Gregorian calendar (e.g. Persian, Hebrew).Feb 13 2024, 8:28 PM

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:

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:

Make sure that you use the same date calculations (except in the opposite direction) as MediaWiki uses to display these formats, e.g.:

(3) Add test cases here: