Last modified: 2014-08-02 01:31:10 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/patches/561/ Reported by: acstroe Created on: 2012-08-16 07:18:55 Subject: archivebot.py edit summary i18n improvement Original description: The edit summary of archivebot explains how old archived messages are, by using the configuration string, e.g. 45d or 24h. On request from some users on ro.wp, I have added a function that interprets these strings in accordance with the local wiki settings. It uses the MediaWiki:Hours and MediaWiki:Days messages to obtain the local language string. Since all wikis I tries use the PLURAL parser function and parser functions are not interpreted in the wiki edit summary, I parsed the PLURAL function to obtain the actual string. If the PLURAL function is not supported, then the exact text of the MediaWiki:Hours and MediaWiki:Days is used \(after replacing $1 with the actual number\). If the MediaWiki:Hours or MediaWiki:Days messages are not found, then the initial configuration string is used. See also https://ro.wikipedia.org/wiki/Wikipedia:Sarcini\_pentru\_robo%C8%9Bi\#Arhivare\_automat.C4.83\_a\_paginilor\_de\_discu.C8.9Bii
Revised implementation, using API suggested by xqt
I attached a new patch, one that uses the API you suggested. Is it usable?
That plural implementation does not work for a lot of languages including ro-wiki. See the current plural\_rules at plural.py.
(In reply to comment #3) > That plural implementation does not work for a lot of languages including > ro-wiki. See the current plural\_rules at plural.py. Plural rules ar copied from mediawiki plural rules. If a language is not explicit on plural.py it use the default behaviour which works for the most languages. So could you explain what is wrong with ro-wiki (and others)?
Ah I see, it's mediawiki's
Change 150228 had a related patch set uploaded by Whym: archivebot: localized duration (hours, days) in edit summary https://gerrit.wikimedia.org/r/150228
Change 150228 merged by jenkins-bot: archivebot: localized duration (hours, days) in edit summary https://gerrit.wikimedia.org/r/150228
Above patch works for me. Although I also note that the simple ordering of two elements "<older-than> <duration>", using a space as a separator, might not be ideal for all languages. That may be another bug to fix.