Revision: 4424
Author: huji
Date: 2007-10-05 17:22:12 +0000 (Fri, 05 Oct 2007)
Log Message:
-----------
*Updates three more modules, so they can use the new translate() function.
*Updates messages.py accordingly.
Modified Paths:
--------------
branches/pywikipedia/messages/catlib.py
branches/pywikipedia/messages/commons_link.py
branches/pywikipedia/messages/copyright_clean.py
branches/pywikipedia/messages/messages.py
Modified: branches/pywikipedia/messages/catlib.py
===================================================================
--- branches/pywikipedia/messages/catlib.py 2007-10-05 15:10:32 UTC (rev 4423)
+++ branches/pywikipedia/messages/catlib.py 2007-10-05 17:22:12 UTC (rev 4424)
@@ -22,19 +22,6 @@
# fallback solution for Python 2.3
from sets import Set as set
-msg_created_for_renaming = {
- 'de':u'Bot: Verschoben von %s. Autoren: %s',
- 'en':u'Robot: Moved from %s. Authors: %s',
- 'ia':u'Robot: Transferite de %s. Autores: %s',
- 'id':u'Bot: Memindahkan dari %s. Kontributor: %s',
- 'it':u'Bot: Voce spostata da %s. Autori: %s',
- 'fr':u'Robot : déplacé depuis %s. Auteurs: %s',
- 'he':u'רובוט: הועבר מהשם %s. מחברים: %s',
- 'nl':u'Bot: hernoemd van %s. Auteurs: %s',
- 'pl':u'Robot przenosi z %s. Autorzy: %s',
- 'pt':u'Bot: Movido de %s. Autor: %s',
- }
-
# some constants that are used internally
ARTICLE = 0
SUBCATEGORY = 1
@@ -371,7 +358,7 @@
else:
wikipedia.output('Moving text from %s to %s.' % (self.title(),
targetCat.title()))
authors = ', '.join(self.contributingUsers())
- creationSummary = wikipedia.translate(wikipedia.getSite(),
msg_created_for_renaming) % (self.title(), authors)
+ creationSummary = wikipedia.translate(wikipedia.getSite(), u'Robot: Moved
from %s. Authors: %s') % (self.title(), authors)
targetCat.put(self.get(), creationSummary)
return True
Modified: branches/pywikipedia/messages/commons_link.py
===================================================================
--- branches/pywikipedia/messages/commons_link.py 2007-10-05 15:10:32 UTC (rev 4423)
+++ branches/pywikipedia/messages/commons_link.py 2007-10-05 17:22:12 UTC (rev 4424)
@@ -36,13 +36,6 @@
import wikipedia, pagegenerators, catlib
import re
-comment1 = {
- 'en':'Robot: Include commons template'
- }
-comment2 = {
- 'en':'Robot: Include commonscat template'
- }
-
class CommonsLinkBot:
def __init__(self, generator, acceptall = False):
self.generator = generator
@@ -77,7 +70,7 @@
self.acceptall = True
if self.acceptall or choice in ['y',
'Y']:
try:
- msg = wikipedia.translate(wikipedia.getSite(),
comment1)
+ msg = wikipedia.translate(wikipedia.getSite(),
u'Robot: Include commons template')
page.put(text, msg)
except wikipedia.EditConflict:
wikipedia.output(u'Skipping %s because of
edit conflict' % (page.title()))
@@ -121,7 +114,7 @@
self.acceptall = True
if self.acceptall or choice in ['y',
'Y']:
try:
- msg = wikipedia.translate(wikipedia.getSite(),
comment2)
+ msg = wikipedia.translate(wikipedia.getSite(),
u'Robot: Include commonscat template')
page.put(text, msg)
except wikipedia.EditConflict:
wikipedia.output(u'Skipping %s because of
edit conflict' % (page.title()))
Modified: branches/pywikipedia/messages/copyright_clean.py
===================================================================
--- branches/pywikipedia/messages/copyright_clean.py 2007-10-05 15:10:32 UTC (rev 4423)
+++ branches/pywikipedia/messages/copyright_clean.py 2007-10-05 17:22:12 UTC (rev 4424)
@@ -16,11 +16,6 @@
import sys
-summary_msg = {
- 'en': u'Removing',
- 'it': u'Rimozione',
-}
-
headC = re.compile("(?m)^===
(?:<strike>)?(?:<s>)?(?:<del>)?\[\[(?::)?(.*?)\]\]")
separatorC = re.compile('(?m)^== +')
next_headC = re.compile("(?m)^=+.*?=+")
@@ -137,7 +132,7 @@
output += data[next_head.start():next_head.end()] + '\n'
add_separator = False
- add_comment = u'%s: %s' % (wikipedia.translate(wikipedia.getSite(),
summary_msg),", ".join(comment_entry))
+ add_comment = u'%s: %s' % (wikipedia.translate(wikipedia.getSite(),
u'Removing'),", ".join(comment_entry))
# remove useless newlines
output = re.sub("(?m)^\n", "", output)
Modified: branches/pywikipedia/messages/messages.py
===================================================================
--- branches/pywikipedia/messages/messages.py 2007-10-05 15:10:32 UTC (rev 4423)
+++ branches/pywikipedia/messages/messages.py 2007-10-05 17:22:12 UTC (rev 4424)
@@ -8,15 +8,15 @@
#basic.py
u'Adding "test" to the beginning of the page.':
{
- 'nl' : u'"Test" toegevoegd aan het begin van de
pagina.',
- 'fa' : u'افزودن «Test» به ابتدای صفحه',
+ 'nl':u'"Test" toegevoegd aan het begin van de
pagina.',
+ 'fa':u'افزودن «Test» به ابتدای صفحه',
},
#capitalize_redirects.py
u'Robot: Create redirect to [[%s]]':
{
- 'fr': u'robot: créez redirect à [[%s]]',
- 'pt': u'Bot: Criando redirect para [[%s]]',
- 'fa': u'ربات: ایجاد تغییرمسیر به [[%s]]',
+ 'fr':u'robot: créez redirect à [[%s]]',
+ 'pt':u'Bot: Criando redirect para [[%s]]',
+ 'fa':u'ربات: ایجاد تغییرمسیر به [[%s]]',
},
#catall.py
u'Bot: Changing categories':
@@ -140,28 +140,57 @@
},
u'(also in %s)':
{
- 'da': u'(også i %s)',
- 'de': u'(auch in %s)',
- 'fa': u'(همچنين در %s)',
- 'fr': u'(également dans %s)',
- 'he': u'(גם בקטגוריות %s)',
- 'ia': u'(equalmente in %s)',
- 'is': u'(einnig í %s)',
- 'kk': u'(тағы да %s дегенде)',
- 'nl': u'(ook in %s)',
- 'pt': u'(também em %s)',
- 'sv': u'(också i %s)',
- 'ср': u'(такође у %s)',
+ 'da':u'(også i %s)',
+ 'de':u'(auch in %s)',
+ 'fa':u'(همچنين در %s)',
+ 'fr':u'(également dans %s)',
+ 'he':u'(גם בקטגוריות %s)',
+ 'ia':u'(equalmente in %s)',
+ 'is':u'(einnig í %s)',
+ 'kk':u'(тағы да %s дегенде)',
+ 'nl':u'(ook in %s)',
+ 'pt':u'(também em %s)',
+ 'sv':u'(också i %s)',
+ 'ср':u'(такође у %s)',
},
+ #catlib.py
+ u'Robot: Moved from %s. Authors: %s':
+ {
+ 'de':u'Bot: Verschoben von %s. Autoren: %s',
+ 'fa':u'ربات:انتقال از %s. نوشتهٔ %s',
+ 'fr':u'Robot : déplacé depuis %s. Auteurs: %s',
+ 'he':u'רובוט: הועבר מהשם %s. מחברים: %s',
+ 'ia':u'Robot: Transferite de %s. Autores: %s',
+ 'id':u'Bot: Memindahkan dari %s. Kontributor: %s',
+ 'it':u'Bot: Voce spostata da %s. Autori: %s',
+ 'nl':u'Bot: hernoemd van %s. Auteurs: %s',
+ 'pl':u'Robot przenosi z %s. Autorzy: %s',
+ 'pt':u'Bot: Movido de %s. Autor: %s',
+ },
#clean_sandbox.py
u'Robot: This page will automatically be cleaned.':
{
- 'ar': u'روبوت: هذه الصفحة سيتم تفريغها تلقائياً',
- 'de': u'Bot: Setze Seite zurück.',
- 'fa': u'ربات: خالی کردن خودکار صفحه',
- 'nl': u'Robot: Automatisch voorzien van schoon zand.',
- 'no': u'bot: Rydder sandkassa.',
- 'pl': u'Robot czyści brudnopis',
- 'pt': u'Bot: Limpeza da página de testes',
- }
+ 'ar':u'روبوت: هذه الصفحة سيتم تفريغها تلقائياً',
+ 'de':u'Bot: Setze Seite zurück.',
+ 'fa':u'ربات: خالی کردن خودکار صفحه',
+ 'nl':u'Robot: Automatisch voorzien van schoon zand.',
+ 'no':u'bot: Rydder sandkassa.',
+ 'pl':u'Robot czyści brudnopis',
+ 'pt':u'Bot: Limpeza da página de testes',
+ },
+ #commons_link.py
+ u'Robot: Include commons template':
+ {
+ 'fa':u'ربات: افزودن الگوی ویکیانبار',
+ },
+ u'Robot: Include commonscat template':
+ {
+ 'fa':u'ربات: افزودن الگوی رده ویکیانبار',
+ },
+ #copyright_clean.py
+ u'Removing':
+ {
+ 'fa': u'برداشتن',
+ 'it': u'Rimozione',
+ },
}
\ No newline at end of file