Xqt has submitted this change and it was merged.
Change subject: Bugfix for python 2.5: "plural_rules" is the valid function ......................................................................
Bugfix for python 2.5: "plural_rules" is the valid function
Change-Id: Iaafa4ba2a8500eefad5277114c399470ee47358f --- M pywikibot/i18n.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index d180604..9fb7ec1 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -25,7 +25,7 @@ @param code The language code @type code string @return a list of strings as language codes - + If no translation is available to a specified language, translate() will try each of the specified fallback languages, in order, until it finds one with a translation, with 'en' and '_default' as a last resort. @@ -387,7 +387,7 @@ Support is implemented like in MediaWiki extension. If the tw message contains a plural tag inside which looks like {{PLURAL:<number>|<variant1>|<variant2>[|<variantn>]}} - it takes that variant calculated by the plural_func depending on the number + it takes that variant calculated by the plural_rules depending on the number value.
Examples: @@ -455,7 +455,7 @@ # Compatibility check for old python releases which are unable # to use plural.py - use _default rules for all if sys.version_info < (2, 5): - plural_func = lambda n: (n != 1) + plural_rules = lambda n: (n != 1) index = plural_rules(num) else: from plural import plural_rules