jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/994332?usp=email )
Change subject: [bugfix] Add hy to special languages in TimeStripper ......................................................................
[bugfix] Add hy to special languages in TimeStripper
Also hy needs to check both upper and lower case for months.
Bug: T356175 Change-Id: Ibc7982084102735ffa87fd8d97f6a2813c7176ca --- M pywikibot/textlib.py 1 file changed, 20 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 75c3d87..788df3a 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -1,6 +1,6 @@ """Functions for manipulating wiki-text.""" # -# (C) Pywikibot team, 2008-2023 +# (C) Pywikibot team, 2008-2024 # # Distributed under the terms of the MIT license. # @@ -1985,10 +1985,13 @@ self.site = pywikibot.Site() if site is None else site
self.origNames2monthNum = {} - # use first_lower/first_upper for 'vi' language because monthsnames - # were changed: T324310 - functions = [first_upper, - first_lower] if self.site.lang == 'vi' else [str] + # use first_lower/first_upper for those language where month names + # were changed: T324310, T356175 + if self.site.lang in ('hy', 'vi'): + functions = [first_upper, first_lower] + else: + functions = [str] + for n, (long, short) in enumerate(self.site.months_names, start=1): for func in functions: self.origNames2monthNum[func(long)] = n