http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11450
Revision: 11450
Author: drtrigon
Date: 2013-04-25 09:11:13 +0000 (Thu, 25 Apr 2013)
Log Message:
-----------
bug fix; AttributeError: 'module' object has no attribute 'translate'
(follow-up to r11429)
Modified Paths:
--------------
branches/rewrite/scripts/clean_sandbox.py
Modified: branches/rewrite/scripts/clean_sandbox.py
===================================================================
--- branches/rewrite/scripts/clean_sandbox.py 2013-04-25 08:29:15 UTC (rev 11449)
+++ branches/rewrite/scripts/clean_sandbox.py 2013-04-25 09:11:13 UTC (rev 11450)
@@ -144,9 +144,9 @@
self.site = pywikibot.Site()
self.site.login()
if self.getOption('user'):
- localSandboxTitle = pywikibot.translate(self.site,
- user_sandboxTemplate,
- fallback=False)
+ localSandboxTitle = i18n.translate(self.site,
+ user_sandboxTemplate,
+ fallback=False)
localSandbox = pywikibot.Page(self.site, localSandboxTitle)
content.update(user_content)
sandboxTitle[self.site.lang] = [item.title() \
@@ -164,8 +164,8 @@
while True:
wait = False
now = time.strftime("%d %b %Y %H:%M:%S (UTC)", time.gmtime())
- localSandboxTitle = pywikibot.translate(self.site, sandboxTitle,
- fallback=False)
+ localSandboxTitle = i18n.translate(self.site, sandboxTitle,
+ fallback=False)
if type(localSandboxTitle) is list:
titles = localSandboxTitle
else:
@@ -175,8 +175,8 @@
pywikibot.output(u'Preparing to process sandbox page %s' %
sandboxPage.title(asLink=True))
try:
text = sandboxPage.get()
- translatedContent = pywikibot.translate(self.site, content,
- fallback=False)
+ translatedContent = i18n.translate(self.site, content,
+ fallback=False)
translatedMsg = i18n.twtranslate(self.site,
'clean_sandbox-cleaned')
subst = 'subst:' in translatedContent