# -*- coding: utf-8 -*-
import family
__version__ = '$Id: wikinews_family.py 8200 2010-05-22 16:14:13Z xqt $'
# The Wikimedia family that is known as Wikinews
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikinews'
self.languages_by_size = [
'sr', 'en', 'pl', 'de', 'fr', 'it', 'pt', 'es', 'zh', 'ja', 'sv',
'ru', 'fi', 'he', 'cs', 'bg', 'ar', 'ro', 'sd', 'ta', 'hu', 'no',
'uk', 'ca', 'tr', 'bs', 'th',
]
if family.config.SSL_connection:
self.langs = dict([(lang, None) for lang in self.languages_by_size])
else:
self.langs = dict([(lang, '%s.wikinews.org' % lang) for lang in self.languages_by_size])
# Override defaults
self.namespaces[2]['cs'] = u'Redaktor'
self.namespaces[2]['pl'] = u'Wikireporter'
self.namespaces[3]['cs'] = u'Diskuse s redaktorem'
self.namespaces[3]['pl'] = u'Dyskusja Wikireportera'
# Most namespaces are inherited from family.Family.
# Translation used on all wikis for the different namespaces.
# (Please sort languages alphabetically)
# You only need to enter translations that differ from _default.
self.namespaces[4] = {
'_default': [u'Wikinews', self.namespaces[4]['_default']],
'ar': u' ',
'bg': u'',
'bs': u'Wikivijesti',
'ca': u'Viquinotcies',
'cs': u'Wikizprvy',
'es': u'Wikinoticias',
'fi': u'Wikiuutiset',
'he': u'',
'hu': u'Wikihrek',
'it': u'Wikinotizie',
'ja': u'',
'no': u'Wikinytt',
'pt': u'Wikinotcias',
'ro': u'Wikitiri',
'ru': u'',
'sr': u'',
'th': u'',
'tr': u'Vikihaber',
'uk': u'',
'zh': [u'Wikinews', u''],
}
self.namespaces[5] = {
'_default': [u'Wikinews talk', self.namespaces[5]['_default']],
'ar': u' ',
'bg': u' ',
'bs': u'Razgovor s Wikivijestima',
'ca': u'Viquinotcies Discussi',
'cs': u'Diskuse k Wikizprvm',
'de': u'Wikinews Diskussion',
'es': u'Wikinoticias Discusin',
'fi': u'Keskustelu Wikiuutisista',
'fr': u'Discussion Wikinews',
'he': u' ',
'hu': u'Wikihrek-vita',
'it': u'Discussioni Wikinotizie',
'ja': u'',
'nl': u'Overleg Wikinews',
'no': u'Wikinytt-diskusjon',
'pl': u'Dyskusja Wikinews',
'pt': u'Wikinotcias Discusso',
'ro': u'Discuie Wikitiri',
'ru': u' ',
'sd': u'Wikinews ',
'sr': u' ',
'sv': u'Wikinewsdiskussion',
'ta': u'Wikinews ',
'th': u'',
'tr': u'Vikihaber tartma',
'uk': u' ',
'zh': [u'Wikinews talk', u''],
}
self.namespaces[90] = {
'en': u'Thread',
}
self.namespaces[91] = {
'en': u'Thread talk',
}
self.namespaces[92] = {
'en': u'Summary',
}
self.namespaces[93] = {
'en': u'Summary talk',
}
self.namespaces[100] = {
'ar': u'',
'cs': u'Portl',
'de': u'Portal',
'en': u'Portal',
'es': u'Comentarios',
'he': u'',
'it': u'Portale',
'ja': u'',
'no': u'Kommentarer',
'pl': u'Portal',
'pt': u'Portal',
'ru': u'',
'sv': u'Portal',
'tr': u'Portal',
'zh': u'',
}
self.namespaces[101] = {
'ar': u' ',
'cs': u'Diskuse k portlu',
'de': u'Portal Diskussion',
'en': u'Portal talk',
'es': u'Comentarios Discusin',
'he': u' ',
'it': u'Discussioni portale',
'ja': [u'', u''],
'no': u'Kommentarer-diskusjon',
'pl': u'Dyskusja portalu',
'pt': u'Portal Discusso',
'ru': u' ',
'sv': u'Portaldiskussion',
'tr': u'Portal tartma',
'zh': u' talk',
}
self.namespaces[102] = {
'ar': u'',
'bg': u'',
'de': u'Meinungen',
'en': u'Comments',
'fr': u'Transwiki',
'hu': u'Portl',
'pt': u'Efemride',
'ru': u'',
'sr': u'',
}
self.namespaces[103] = {
'ar': u' ',
'bg': u' ',
'de': u'Meinungen Diskussion',
'en': u'Comments talk',
'fr': u'Discussion Transwiki',
'hu': u'Portlvita',
'pt': u'Efemride Discusso',
'ru': u' ',
'sr': u' ',
}
self.namespaces[104] = {
'fr': u'Page',
}
self.namespaces[105] = {
'fr': u'Discussion Page',
}
self.namespaces[106] = {
'fr': u'Dossier',
'no': u'Portal',
}
self.namespaces[107] = {
'fr': u'Discussion Dossier',
'no': u'Portal-diskusjon',
}
self.namespaces[108] = {
'ja': u'',
}
self.namespaces[109] = {
'ja': u'',
}
self.obsolete = {
'jp': 'ja',
'nb': 'no',
'nl': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
'zh-tw': 'zh',
'zh-cn': 'zh'
}
# Which languages have a special order for putting interlanguage links,
# and what order is it? If a language is not in interwiki_putfirst,
# alphabetical order on language code is used. For languages that are in
# interwiki_putfirst, interwiki_putfirst is checked first, and
# languages are put in the order given there. All other languages are put
# after those, in code-alphabetical order.
self.interwiki_putfirst = {
'en': self.alphabetic,
'fi': self.alphabetic,
'fr': self.alphabetic,
'he': ['en'],
'pl': self.alphabetic,
}
# Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
self.cross_allowed = ['cs', 'hu',]
# CentralAuth cross avaliable projects.
self.cross_projects = [
'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikiversity',
'meta', 'mediawiki', 'test', 'incubator', 'commons', 'species'
]
def code2encoding(self, code):
return 'utf-8'
def version(self, code):
return '1.16wmf4'
def shared_image_repository(self, code):
return ('commons', 'commons')
if family.config.SSL_connection:
def hostname(self, code):
return 'secure.wikimedia.org'
def protocol(self, code):
return 'https'
def scriptpath(self, code):
return '/%s/%s/w' % (self.name, code)
def nicepath(self, code):
return '/%s/%s/wiki/' % (self.name, code)
|