http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9271
Revision: 9271 Author: xqt Date: 2011-05-26 05:59:01 +0000 (Thu, 26 May 2011) Log Message: ----------- use i18n method for translating i18n messages (bug reported by Ezarate); cosmetic changes
Modified Paths: -------------- trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2011-05-23 04:26:09 UTC (rev 9270) +++ trunk/pywikipedia/replace.py 2011-05-26 05:59:01 UTC (rev 9271) @@ -644,11 +644,11 @@ replacements.append((commandline_replacements[0], commandline_replacements[1])) if not summary_commandline: - editSummary = pywikibot.translate(pywikibot.getSite(), - 'replace-replacing', - {'description': ' (-%s +%s)' - % (commandline_replacements[0], - commandline_replacements[1])}) + editSummary = i18n.twtranslate(pywikibot.getSite(), + 'replace-replacing', + {'description': ' (-%s +%s)' + % (commandline_replacements[0], + commandline_replacements[1])}) elif (len(commandline_replacements) > 1): if (fix is None): for i in xrange (0, len(commandline_replacements), 2): @@ -676,15 +676,15 @@ old = pywikibot.input( u'Please enter another text that should be replaced, or press Enter to start:') if old == '': - change = change + ')' + change += ')' break new = pywikibot.input(u'Please enter the new text:') - change = change + ' & -' + old + ' +' + new + change += ' & -' + old + ' +' + new replacements.append((old, new)) if not summary_commandline: - default_summary_message = i18n.twtranslate(pywikibot.getSite(), - 'replace-replacing', - {'description': change}) + default_summary_message = i18n.twtranslate(pywikibot.getSite(), + 'replace-replacing', + {'description': change}) pywikibot.output(u'The summary message will default to: %s' % default_summary_message) summary_message = pywikibot.input(
pywikipedia-svn@lists.wikimedia.org