http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9601
Revision: 9601
Author: xqt
Date: 2011-10-08 11:02:54 +0000 (Sat, 08 Oct 2011)
Log Message:
-----------
use i18n tw support with fixes.py, update from trunk r9364
Modified Paths:
--------------
branches/rewrite/scripts/fixes.py
branches/rewrite/scripts/replace.py
Modified: branches/rewrite/scripts/fixes.py
===================================================================
--- branches/rewrite/scripts/fixes.py 2011-10-08 10:54:20 UTC (rev 9600)
+++ branches/rewrite/scripts/fixes.py 2011-10-08 11:02:54 UTC (rev 9601)
@@ -188,7 +188,7 @@
'be':u'Бот: Карэкцыя вiкi-сiнтаксiсу',
'cs':u'Oprava wikisyntaxe',
'de':u'Bot: Korrigiere Wiki-Syntax',
- 'en':u'Bot: Fixing wiki syntax',
+ 'en':u'Robot: Fixing wiki syntax',
'eo':u'Bot: Korektado de vikia sintakso',
'fa':u'ربات:تصحیح قالب ویکینویسی',
'fr':u'Bot: Corrige wiki-syntaxe',
@@ -264,7 +264,7 @@
'be':u'Бот: Карэкцыя вiкi-сiнтаксiсу',
'cs':u'Oprava wikisyntaxe',
'de':u'Bot: Korrigiere Wiki-Syntax',
- 'en':u'Bot: Fixing wiki syntax',
+ 'en':u'Robot: Fixing wiki syntax',
'eo':u'Bot: Korektado de vikia sintakso',
'fa':u'ربات:تصحیح قالب ویکینویسی',
'fr':u'Bot: Corrige wiki-syntaxe',
@@ -415,21 +415,7 @@
'isbn': {
'regex': True,
- 'msg': {
- 'ar': u'روبوت: تصليح صيغة ISBN',
- 'be': u'Бот: Карэкцыя ISBN фармату',
- 'cs': u'Oprava formátu ISBN',
- 'de': u'Bot: Korrigiere ISBN-Format',
- 'en': u'Robot: Fixing ISBN format',
- 'es': u'Arreglando formato ISBN',
- 'eo': u'Bot: Korekto de teksto en ISBN-formato',
- 'fa': u'ربات:تصحیح شابک',
- 'he': u'בוט: מתקן פורמט ISBN',
- 'ja': u'ロボットによる: ISBNフォーマット修正',
- 'ru': u'Бот: Коррекция ISBN формата',
- 'uk': u'Бот: Корекція ISBN формату',
- 'zh': u'機器人: 修正ISBN格式',
- },
+ 'msg': 'isbn-formatting', # use i18n translations
'replacements': [
# colon
(r'ISBN: (\d+)', r'ISBN \1'),
Modified: branches/rewrite/scripts/replace.py
===================================================================
--- branches/rewrite/scripts/replace.py 2011-10-08 10:54:20 UTC (rev 9600)
+++ branches/rewrite/scripts/replace.py 2011-10-08 11:02:54 UTC (rev 9601)
@@ -497,7 +497,7 @@
elif arg.startswith('-page'):
if len(arg) == 5:
PageTitles.append(pywikibot.input(
- u'Which page do you want to change?'))
+ u'Which page do you want to change?'))
else:
PageTitles.append(arg[6:])
elif arg.startswith('-excepttitle:'):
@@ -601,8 +601,12 @@
if "regex" in fix:
regex = fix['regex']
if "msg" in fix:
- edit_summary = \
- pywikibot.translate(pywikibot.getSite(), fix['msg'])
+ if isinstance(fix['msg'], basestring):
+ edit_summary = i18n.twtranslate(pywikibot.getSite(),
+ str(fix['msg']))
+ else:
+ edit_summary = pywikibot.translate(pywikibot.getSite(),
+ fix['msg'])
if "exceptions" in fix:
exceptions = fix['exceptions']
if "nocase" in fix: