http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11317
Revision: 11317 Author: xqt Date: 2013-04-01 13:56:43 +0000 (Mon, 01 Apr 2013) Log Message: ----------- use the right code for plural dict
Modified Paths: -------------- trunk/pywikipedia/pywikibot/i18n.py
Modified: trunk/pywikipedia/pywikibot/i18n.py =================================================================== --- trunk/pywikipedia/pywikibot/i18n.py 2013-04-01 13:09:37 UTC (rev 11316) +++ trunk/pywikipedia/pywikibot/i18n.py 2013-04-01 13:56:43 UTC (rev 11317) @@ -277,9 +277,11 @@ for alt in _altlang(code) + ['_default', 'en']: if alt in xdict: trans = xdict[alt] + code = alt break else: trans = xdict.values()[0] + code = xdict.keys()[0] if not trans: return # return None if we have no translation found if parameters is None: @@ -300,7 +302,6 @@ num = int(parameters) else: num = parameters - # we only need the lang or _default, not a _altlang code # TODO: check against plural_rules[lang]['nplurals'] try: index = plural_rules[code]['plural'](num)
pywikipedia-svn@lists.wikimedia.org