http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9233
Revision: 9233 Author: xqt Date: 2011-05-10 08:24:20 +0000 (Tue, 10 May 2011) Log Message: ----------- i18n tw support for editarticle, update from rewrite r9232
Modified Paths: -------------- trunk/pywikipedia/editarticle.py
Modified: trunk/pywikipedia/editarticle.py =================================================================== --- trunk/pywikipedia/editarticle.py 2011-05-10 07:30:31 UTC (rev 9232) +++ trunk/pywikipedia/editarticle.py 2011-05-10 08:24:20 UTC (rev 9233) @@ -6,7 +6,7 @@
# # (C) Gerrit Holl 2004 -# (C) Pywikipedia team, 2004-2010 +# (C) Pywikipedia team, 2004-2011 # __version__ = "$Id$" # @@ -28,21 +28,10 @@ import optparse import tempfile
-import wikipedia as pywikibot +import pywikibot +from pywikibot import i18n import config
-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 +177,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)
pywikipedia-svn@lists.wikimedia.org