http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9232
Revision: 9232
Author: xqt
Date: 2011-05-10 07:30:31 +0000 (Tue, 10 May 2011)
Log Message:
-----------
i18n tw support for editarticle
Modified Paths:
--------------
branches/rewrite/scripts/editarticle.py
Modified: branches/rewrite/scripts/editarticle.py
===================================================================
--- branches/rewrite/scripts/editarticle.py 2011-05-10 07:18:06 UTC (rev 9231)
+++ branches/rewrite/scripts/editarticle.py 2011-05-10 07:30:31 UTC (rev 9232)
@@ -6,7 +6,7 @@
#
# (C) Gerrit Holl 2004
-# (C) Pywikipedia team, 2004-2009
+# (C) Pywikipedia team, 2004-2011
#
__version__ = "$Id$"
#
@@ -29,20 +29,8 @@
import tempfile
import pywikibot
-from pywikibot import config
+from pywikibot import config, i18n
-msg = {
- 'ar': u'تعديل يدوي: %s',
- 'de': u'Manuelle Bearbeitung: %s',
- 'en': u'Manual edit: %s',
- 'fa': u'ویرایش دستی: %s',
- 'he': u'עריכה ידנית: %s',
- 'ja': u'手動編集: %s',
- 'pt': u'Editando manualmente com bot: %s',
- 'sv': u'Manuell redigering: %s',
- 'is': u'Handvirk breyting: %s',
- 'zh': u'手動編輯: %s',
-}
class TextEditor:
def __init__(self):
@@ -188,7 +176,8 @@
if new and old != new:
pywikibot.showDiff(old, new)
changes = pywikibot.input(u"What did you change?")
- comment = pywikibot.translate(pywikibot.getSite(), msg) % changes
+ comment = i18n.twtranslate(pywikibot.getSite(), 'editarticle-edit',
+ {'description': changes})
try:
self.page.put(new, comment=comment, minorEdit=False,
watchArticle=self.options.watch)