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

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.

For example:

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

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