http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9485
Revision: 9485 Author: xqt Date: 2011-09-01 05:51:41 +0000 (Thu, 01 Sep 2011) Log Message: ----------- if a site is given instead of a code, use its language; update from trunk r9484
Modified Paths: -------------- branches/rewrite/pywikibot/i18n.py
Modified: branches/rewrite/pywikibot/i18n.py =================================================================== --- branches/rewrite/pywikibot/i18n.py 2011-09-01 05:50:47 UTC (rev 9484) +++ branches/rewrite/pywikibot/i18n.py 2011-09-01 05:51:41 UTC (rev 9485) @@ -325,6 +325,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