jayvdb added subscribers: jayvdb, Mpaa.
jayvdb added a comment.
We have a humongous date.py library which can do this.
>>> s = pywikibot.Site('fa', 'wikipedia')
>>> fd = pywikibot.date.FormatDate(s)
>>> fd(10, 3)
u'3 \u0627\u06a9\u062a\u0628\u0631'
>>> pywikibot.date.formatYear('fa', 2013)
u'\u06f2\u06f0\u06f1\u06f3 (\u0645\u06cc\u0644\u0627\u062f\u06cc)'
I am not sure how to stitch the year and month+day together correctly for a
locale, but I am sure the voodoo is in that library somewhere .. ;-)
We could also use the site messages for month names, which is the approach that
textlib.TimeStripper uses, and ensures good localisation. I wonder if there
are other site messages which describe the format of a date used on the wiki.
TASK DETAIL
https://phabricator.wikimedia.org/T102174
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb
Cc: Mpaa, jayvdb, pywikibot-bugs-list, Purodha, valhallasw, Aklapper, Malyacko,
P.Copp
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs