Page MenuHomePhabricator

Customize date format of warning message header
Closed, ResolvedPublic

Description

Add a configuration value to customize date format. The current format is month year. On Chinese Wikipedia, we can change the text of the month, but cannot set the order of the year and month.
Actual Results: 2月 2019
Expected Results: 2019年2月

Warning example: https://zh.wikipedia.org/w/index.php?oldid=53150546
Month config: https://zh.wikipedia.org/wiki/Wikipedia:Huggle/Config#Classification

Event Timeline

Restricted Application added a subscriber: Cosine02. · View Herald TranscriptFeb 23 2019, 12:10 AM
94rain added a subscriber: 94rain.Feb 23 2019, 7:42 AM
Petrb added a subscriber: Petrb.May 17 2019, 3:30 PM

Not sure if this is going to work since you are using deprecated config format (new one is yaml), but according to documentation at https://www.mediawiki.org/wiki/Manual:Huggle/Deploying/DefaultConfig.yaml

##############################################################################
# Reverting and templates
# Configuration of reverting and various templates
##############################################################################
# Specify type of headings to use when sending a message to user
# standard will use text in "template-header"
# page will use page in question as header
# none will not use any headers
headings: standard

# Use for "standard" headers. Uncomment if you want to change it # LOCALIZE ME #
# template-header: "Your edits to $1"

You can see that if you change headings to standard, then you can define which text will be used for template header. I suppose it could contains some wiki-text that would have the timestamp in format you prefer.

Petrb added a comment.EditedMay 17 2019, 3:33 PM

For example:

template-header: "{{CURRENTYEAR}}年{{CURRENTMONTH}}月:"

Petrb closed this task as Resolved.May 17 2019, 3:37 PM
Petrb claimed this task.

Please reopen if this solution doesn't work for your use-case

You can see that if you change headings to standard, then you can define which text will be used for template header. I suppose it could contains some wiki-text that would have the timestamp in format you prefer.

After my test, I found the documentation is wrong. The "headings" should be "page".

For example:

template-header: "{{CURRENTYEAR}}年{{CURRENTMONTH}}月:"

It works. But I hope the warnings in same month should be merge into single section (Expected result, Actual result).

Shizhao moved this task from Backlog to Closed on the Chinese-Sites board.May 21 2019, 3:13 AM