Revision: 8787
Author: xqt
Date: 2010-12-22 22:09:36 +0000 (Wed, 22 Dec 2010)
Log Message:
-----------
Ukrainian translations for weblinkcheckers.py - patch bug #3141354 submitted by dixond. Thanks.
Modified Paths:
--------------
trunk/pywikipedia/weblinkchecker.py
Modified: trunk/pywikipedia/weblinkchecker.py
===================================================================
--- trunk/pywikipedia/weblinkchecker.py 2010-12-22 21:49:45 UTC (rev 8786)
+++ trunk/pywikipedia/weblinkchecker.py 2010-12-22 22:09:36 UTC (rev 8787)
@@ -126,6 +126,7 @@
'pl': u'Robot zgłasza niedostępny link zewnętrzny',
'pt': u'Bot: Link externo não funcionando',
'sr': u'Бот: Пријављивање непостојећих спољашњих повезница',
+ 'uk': u'Бот: Сповіщення про мертві зовнішні посилання',
'zh': u'BOT: 报告失效的外部链接',
}
@@ -150,6 +151,7 @@
'pl': u'{{Martwy link dyskusja|numer=%s|link=%s|IA=%s}}',
'pt': u'== %s ==\n\nFoi checado os links externos deste artigo por vários minutos. Alguém verifique por favor se a ligação estiver fora do ar e tente arrumá-lo ou removê-la!\n\n%s\n --~~~~ ',
'sr': u'== %s ==\n\nТоком неколико аутоматски провера, бот је пронашао покварене спољашње повезнице. Молимо вас проверите да ли је повезница добра, поправите је или је уклоните!\n\n%s\n%s--~~~~',
+ 'uk': u'== %s ==\n\nПротягом кількох автоматичних перевірок наступне зовнішнє посилання було недоступне. Будь ласка, перевірте чи посилання справді "мертве" і в такому випадку виправіть або видаліть його!\n\n%s\n%s--~~~~',
'zh': u'== %s ==\n\n一个自动运行的bot发现下列外部链接可能已经失效。请帮助修复错误的链接或者移除它!\n\n%s\n%s--~~~~',
}
@@ -170,6 +172,7 @@
'pl': u'',
'pt': u'Link quebrado',
'sr': u'Покварене спољашње повезнице',
+ 'uk': u'Недоступне зовнішнє посилання',
'zh': u'失效链接',
}
@@ -187,6 +190,7 @@
'no': u'\nDenne nettsiden er lagra i Internet Archive. Vurder om lenka kan endres til å peke til en av de arkiverte versjonene: [%s]. ',
'pl': u'%s',
'pt': u'Esta página web foi gravada na Internet Archive. Por favor considere o link para a versão arquivada: [%s]. ',
+ 'uk': u'\nВеб-сторінка була збережена у Internet Archive. Будь ласка, подумайте над заміною посилання на відповідну збережену версію: [%s]. ',
'zh': u'这个网页已经被保存在互联网档案馆(Internet Archive)。请为该网页提供一个合适的存档版本: [%s]。',
}
Revision: 8785
Author: valhallasw
Date: 2010-12-21 00:11:55 +0000 (Tue, 21 Dec 2010)
Log Message:
-----------
Follow-up to r8784: introducing iwkeys
The changes by purodha seem to have some more side effects due to tight
coupling inside the library code. This commit fixes some additional
interwiki mess [1], but I am *uncertain* of any new introduced side-
effects.
If any more issues arise, I suggest reverting purodha changes and
first applying the changes in a feature branch. Or, possibly, only
in the rewrite branch.
[1] http://commons.wikimedia.org/w/index.php?title=Category:Tre_kronor_af_Stock…
Modified Paths:
--------------
trunk/pywikipedia/family.py
trunk/pywikipedia/redirect.py
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/family.py
===================================================================
--- trunk/pywikipedia/family.py 2010-12-20 22:14:07 UTC (rev 8784)
+++ trunk/pywikipedia/family.py 2010-12-21 00:11:55 UTC (rev 8785)
@@ -3539,6 +3539,13 @@
# self.crossnamespace[102] = {
# 'pt': { '_default': [0]}
# }
+
+ @property
+ def iwkeys(self):
+ if self.interwiki_forward:
+ import wikipedia as pywikibot
+ return pywikibot.Family(self.interwiki_forward).langs.keys()
+ return self.langs.keys()
def _addlang(self, code, location, namespaces = {}):
"""Add a new language to the langs and namespaces of the family.
Modified: trunk/pywikipedia/redirect.py
===================================================================
--- trunk/pywikipedia/redirect.py 2010-12-20 22:14:07 UTC (rev 8784)
+++ trunk/pywikipedia/redirect.py 2010-12-21 00:11:55 UTC (rev 8785)
@@ -247,7 +247,7 @@
if m:
target = m.group(1)
# There might be redirects to another wiki. Ignore these.
- for code in self.site.family.langs.keys():
+ for code in self.site.family.iwkeys:
if target.startswith('%s:' % code) \
or target.startswith(':%s:' % code):
if code == self.site.language():
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2010-12-20 22:14:07 UTC (rev 8784)
+++ trunk/pywikipedia/wikipedia.py 2010-12-21 00:11:55 UTC (rev 8785)
@@ -7381,7 +7381,7 @@
def languages(self):
"""Return list of all valid language codes for this site's Family."""
- return self.family.langs.keys()
+ return self.family.iwkeys
def validLanguageLinks(self):
"""Return list of language codes that can be used in interwiki links."""
Revision: 8784
Author: valhallasw
Date: 2010-12-20 22:14:07 +0000 (Mon, 20 Dec 2010)
Log Message:
-----------
orrecting asLink() behaviour after r8756/r8758/r8759 changes.
r8756-r8759 introduced changes in the interwiki handling for families such
as commons: interwiki links on commons were not handled, because they link
to another family. These changes implement changes to allow this. However,
these changes did not take the necessary change to asLink into account,
causing edits such as
http://commons.wikimedia.org/w/index.php?title=Category:Triumphal_arches&ac…
This commits corrects the asLink behaviour by checking for the interwiki
forward information in the family files.
As a quick check, I think this might allow interwiki.py to work directly,
although this behaviour has been blocked explicitly in r8762.
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2010-12-20 05:25:30 UTC (rev 8783)
+++ trunk/pywikipedia/wikipedia.py 2010-12-20 22:14:07 UTC (rev 8784)
@@ -466,12 +466,18 @@
except TypeError:
print title, begin, anchor
raise
+
if asLink:
- if allowInterwiki and (forceInterwiki or self._site != getSite()):
+ iw_target_site = getSite()
+ iw_target_family = getSite().family
+ if iw_target_family.interwiki_forward:
+ iw_target_family = pywikibot.Family(iw_target_family.interwiki_forward)
+
+ if allowInterwiki and (forceInterwiki or self._site != iw_target_site):
colon = ""
if textlink:
colon = ":"
- if self._site.family != getSite().family \
+ if self._site.family != iw_target_family \
and self._site.family.name != self._site.lang:
title = u'[[%s%s:%s:%s]]' % (colon, self._site.family.name,
self._site.lang, title)
Revision: 8778
Author: valhallasw
Date: 2010-12-13 23:08:08 +0000 (Mon, 13 Dec 2010)
Log Message:
-----------
Partial revert of r6605
getLabel already returned a double-quoted (...) string, and was now returning
a double-double-quoted (...), string, which was incorrect behavior. The bug tracker
for the r6605 issue [1999787] shows the issue was related to URLs and not page titles,
so this revert should not introduce any regressions.
Modified Paths:
--------------
trunk/pywikipedia/interwiki_graph.py
Modified: trunk/pywikipedia/interwiki_graph.py
===================================================================
--- trunk/pywikipedia/interwiki_graph.py 2010-12-13 23:07:45 UTC (rev 8777)
+++ trunk/pywikipedia/interwiki_graph.py 2010-12-13 23:08:08 UTC (rev 8778)
@@ -49,7 +49,7 @@
self.subject = subject
def getLabel(self, page):
- return (u'"\"%s:%s\""' % (page.site().language(),
+ return (u'"%s:%s"' % (page.site().language(),
page.title())).encode('utf-8')
def addNode(self, page):