http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9809
Revision: 9809 Author: xqt Date: 2011-12-17 14:03:05 +0000 (Sat, 17 Dec 2011) Log Message: ----------- i18n support
Modified Paths: -------------- trunk/pywikipedia/fixing_redirects.py
Modified: trunk/pywikipedia/fixing_redirects.py =================================================================== --- trunk/pywikipedia/fixing_redirects.py 2011-12-17 14:01:16 UTC (rev 9808) +++ trunk/pywikipedia/fixing_redirects.py 2011-12-17 14:03:05 UTC (rev 9809) @@ -16,15 +16,16 @@ # # This script based on disambredir.py and solve_disambiguation.py # -# (C) Pywikipedia team, 2004-2010 +# (C) Pywikipedia team, 2004-2011 # # Distributed under the terms of the MIT license. # __version__='$Id$' # +import re, sys import wikipedia as pywikibot import pagegenerators -import re, sys +from pywikibot import i18n
# This is required for the text that is shown when you run this script # with the parameter -help. @@ -32,23 +33,6 @@ '¶ms;': pagegenerators.parameterHelp, }
-msg = { - 'ar': u'بوت: إصلاح التحويلات', - 'cs': u'Robot opravil přesměrování', - 'en': u'Bot: Fixing redirects', - 'fa': u'ربات:تصحیح تغییرمسیرها', - 'he': u'בוט: מתקן הפניות', - 'is': u'Robot: Laga tilvísanir', - 'ja': u'ロボットによる:リダイレクト回避', - 'nn': u'robot: retta omdirigeringar', - 'no': u'Robot: Retter omdirigeringer', - 'pl': u'Bot: naprawa przekierowań', - 'pt': u'Bot: Arrumando redirects', - 'sv': u'Bot: Rättar omdirigeringar', - 'vi': u'Robot: Sửa đổi hướng', - 'zh': u'機器人: 修復重定向', -} - featured_articles = { 'ar': u'ويكيبيديا:مقالات مختارة', 'cs': u'Wikipedie:Nejlepší články', @@ -191,7 +175,7 @@ continue text = treat(text, page2, target) if text != page.get(): - comment = pywikibot.translate(mysite, msg) + comment = i18n.twtranslate(mysite, 'fixing_redirects-fixing') pywikibot.showDiff(page.get() ,text) try: page.put(text, comment)