http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11318
Revision: 11318 Author: xqt Date: 2013-04-01 13:58:49 +0000 (Mon, 01 Apr 2013) Log Message: ----------- use the right code for plural_rules dict, update from trunk r11317
Modified Paths: -------------- branches/rewrite/pywikibot/i18n.py
Modified: branches/rewrite/pywikibot/i18n.py =================================================================== --- branches/rewrite/pywikibot/i18n.py 2013-04-01 13:56:43 UTC (rev 11317) +++ branches/rewrite/pywikibot/i18n.py 2013-04-01 13:58:49 UTC (rev 11318) @@ -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: @@ -297,7 +299,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)