http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9484
Revision: 9484 Author: xqt Date: 2011-09-01 05:50:47 +0000 (Thu, 01 Sep 2011) Log Message: ----------- if a site is given instead of a code, use its language
Modified Paths: -------------- trunk/pywikipedia/pywikibot/i18n.py
Modified: trunk/pywikipedia/pywikibot/i18n.py =================================================================== --- trunk/pywikipedia/pywikibot/i18n.py 2011-08-29 19:17:43 UTC (rev 9483) +++ trunk/pywikipedia/pywikibot/i18n.py 2011-09-01 05:50:47 UTC (rev 9484) @@ -336,6 +336,9 @@ param = None if type(parameters) == dict: param = parameters + # If a site is given instead of a code, use its language + if hasattr(code, 'lang'): + code = code.lang # we send the code via list and get the alternate code back code = [code] trans = twtranslate(code, twtitle, None)
pywikipedia-svn@lists.wikimedia.org