http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10134
Revision: 10134 Author: xqt Date: 2012-04-18 14:45:33 +0000 (Wed, 18 Apr 2012) Log Message: ----------- some translated input messages
Modified Paths: -------------- trunk/pywikipedia/noreferences.py trunk/pywikipedia/pagegenerators.py trunk/pywikipedia/redirect.py trunk/pywikipedia/replace.py
Modified: trunk/pywikipedia/noreferences.py =================================================================== --- trunk/pywikipedia/noreferences.py 2012-04-18 14:40:22 UTC (rev 10133) +++ trunk/pywikipedia/noreferences.py 2012-04-18 14:45:33 UTC (rev 10134) @@ -645,7 +645,7 @@ for arg in pywikibot.handleArgs(): if arg.startswith('-xml'): if len(arg) == 4: - xmlFilename = pywikibot.input(u'Please enter the XML dump's filename:') + xmlFilename = i18n.input('pywikibot-enter-xml-filename') else: xmlFilename = arg[5:] gen = XmlDumpNoReferencesPageGenerator(xmlFilename)
Modified: trunk/pywikipedia/pagegenerators.py =================================================================== --- trunk/pywikipedia/pagegenerators.py 2012-04-18 14:40:22 UTC (rev 10133) +++ trunk/pywikipedia/pagegenerators.py 2012-04-18 14:45:33 UTC (rev 10134) @@ -21,7 +21,7 @@ __version__='$Id$'
import wikipedia as pywikibot -from pywikibot import deprecate_arg +from pywikibot import deprecate_arg, i18n import config
import traceback @@ -242,7 +242,7 @@ def getCategoryGen(self, arg, length, recurse=False): site = pywikibot.getSite() if len(arg) == length: - categoryname = pywikibot.input(u'Please enter the category name:') + categoryname = i18n.input('pywikibot-enter-category-name') else: categoryname = arg[length + 1:] categoryname = categoryname.replace('#', '|') @@ -259,7 +259,7 @@ def setSubCategoriesGen(self, arg, length, recurse = False): site = pywikibot.getSite() if len(arg) == length: - categoryname = pywikibot.input(u'Please enter the category name:') + categoryname = i18n.input('pywikibot-enter-category-name') else: categoryname = arg[length + 1:]
@@ -289,8 +289,8 @@ if arg.startswith('-filelinks'): fileLinksPageTitle = arg[11:] if not fileLinksPageTitle: - fileLinksPageTitle = pywikibot.input( - u'Links to which image page should be processed?') + fileLinksPageTitle = i18n.input( + 'pywikibot-enter-file-links-processing') if fileLinksPageTitle.startswith(site.namespace(6) + ":"): fileLinksPage = pywikibot.ImagePage(site, @@ -325,7 +325,7 @@ elif arg.startswith('-interwiki'): title = arg[11:] if not title: - title = pywikibot.input(u'Which page should be processed?') + title = i18n.input('pywikibot-enter-page-processing') page = pywikibot.Page(site, title) gen = InterwikiPageGenerator(page) elif arg.startswith('-randomredirect'):
Modified: trunk/pywikipedia/redirect.py =================================================================== --- trunk/pywikipedia/redirect.py 2012-04-18 14:40:22 UTC (rev 10133) +++ trunk/pywikipedia/redirect.py 2012-04-18 14:45:33 UTC (rev 10134) @@ -748,8 +748,7 @@ api = True elif arg.startswith('-xml'): if len(arg) == 4: - xmlFilename = pywikibot.input( - u'Please enter the XML dump's filename: ') + xmlFilename = i18n.input('pywikibot-enter-xml-filename') else: xmlFilename = arg[5:] elif arg.startswith('-moves'): @@ -758,10 +757,8 @@ ns = arg[11:] if ns == '': ## "-namespace:" does NOT yield -namespace:0 further down the road! - ns = pywikibot.input( - u'Please enter a namespace by its number: ') -# u'Please enter a namespace by its name or number: ') -# TODO! at least for some generators. + ns = i18n.input('pywikibot-enter-namespace-number') +# TODO! at least for some generators enter a namespace by its name or number if ns == '': ns = '0' try:
Modified: trunk/pywikipedia/replace.py =================================================================== --- trunk/pywikipedia/replace.py 2012-04-18 14:40:22 UTC (rev 10133) +++ trunk/pywikipedia/replace.py 2012-04-18 14:45:33 UTC (rev 10134) @@ -499,7 +499,7 @@ page.site().hostname(), page.site().nice_get_address(page.title()) )) - pywikibot.input("Press Enter when finished in browser.") + i18n.input('pywikibot-enter-finished-browser') try: original_text = page.get(get_redirect=True, force=True) except pywikibot.NoPage: @@ -659,8 +659,7 @@ xmlStart = arg[10:] elif arg.startswith('-xml'): if len(arg) == 4: - xmlFilename = pywikibot.input( - u'Please enter the XML dump's filename:') + xmlFilename = i18n.input('pywikibot-enter-xml-filename') else: xmlFilename = arg[5:] elif arg =='-sql': @@ -794,7 +793,7 @@ if old == '': change += ')' break - new = pywikibot.input(u'Please enter the new text:') + new = i18n.input('pywikibot-enter-new-text') change += ' & -' + old + ' +' + new replacements.append((old, new)) if not summary_commandline:
pywikipedia-svn@lists.wikimedia.org