# -*- coding: utf-8 -*-
import family
__version__ = '$Id: wikiquote_family.py 8225 2010-05-28 06:16:24Z xqt $'
# The Wikimedia family that is known as Wikiquote
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikiquote'
self.languages_by_size = [
'en', 'it', 'pl', 'de', 'pt', 'ru', 'sk', 'es', 'bg', 'bs', 'sl',
'tr', 'fr', 'he', 'cs', 'lt', 'zh', 'id', 'el', 'hu', 'fa', 'uk',
'eo', 'sv', 'nl', 'no', 'ja', 'fi', 'hy', 'nn', 'et', 'ca', 'ar',
'ka', 'ko', 'ku', 'hr', 'gl', 'sr', 'ro', 'cy', 'ml', 'li', 'is',
'th', 'te', 'af', 'da', 'az', 'eu', 'sq', 'vi', 'la', 'br', 'hi',
'be', 'ast', 'uz', 'ta', 'ang', 'mr', 'zh-min-nan', 'gu', 'lb',
'su', 'ur', 'wo', 'ky', 'kn', 'am', 'co',
]
if family.config.SSL_connection:
self.langs = dict([(lang, None) for lang in self.languages_by_size])
else:
self.langs = dict([(lang, '%s.wikiquote.org' % lang) for lang in self.languages_by_size])
# 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'Wikiquote', self.namespaces[4]['_default']],
'ar': u' ',
'bg': u'',
'br': u'Wikiarroud',
'bs': u'Wikicitati',
'ca': u'Viquidites',
'cs': u'Wikicitty',
'el': u'',
'eo': u'Vikicitaro',
'et': u'Vikitsitaadid',
'fa': u'',
'fi': u'Wikisitaatit',
'ga': u'Vicsliocht',
'he': u'',
'hr': u'Wikicitat',
'hu': u'Wikidzet',
'hy': u'',
'is': u'Wikivitnun',
'ka': [u'', u'Wikiquote'],
'kk': u'',
'ko': u'',
'la': u'Vicicitatio',
'ml': u' ',
'pl': u'Wikicytaty',
'ro': u'Wikicitat',
'ru': u'',
'sk': u'Wikicitty',
'sl': u'Wikinavedek',
'tr': u'Vikisz',
'uk': u'',
'ur': u' ',
'uz': u'Vikiiqtibos',
'zh': [u'Wikiquote', u''],
}
self.namespaces[5] = {
'_default': [u'Wikiquote talk', self.namespaces[5]['_default']],
'af': u'Wikiquotebespreking',
'als': u'Wikiquote Diskussion',
'am': u'Wikiquote ',
'ar': u' ',
'ast': u'Wikiquote alderique',
'az': u'Wikiquote mzakirsi',
'be': u'Wikiquote ',
'bg': u' ',
'bm': u'Discussion Wikiquote',
'br': u'Kaozeadenn Wikiarroud',
'bs': u'Razgovor s Wikicitatima',
'ca': u'Viquidites Discussi',
'cs': u'Diskuse k Wikicittm',
'cy': u'Sgwrs Wikiquote',
'da': u'Wikiquote-diskussion',
'de': u'Wikiquote Diskussion',
'el': u' ',
'eo': u'Vikicitaro diskuto',
'es': u'Wikiquote Discusin',
'et': u'Vikitsitaatide arutelu',
'eu': u'Wikiquote eztabaida',
'fa': u' ',
'fi': u'Keskustelu Wikisitaateista',
'fr': u'Discussion Wikiquote',
'ga': u'Pl Vicsliocht',
'gl': u'Conversa Wikiquote',
'gu': u'Wikiquote ',
'he': u' ',
'hi': u'Wikiquote ',
'hr': u'Razgovor Wikicitat',
'hu': u'Wikidzet-vita',
'hy': u' ',
'id': u'Pembicaraan Wikiquote',
'is': u'Wikivitnunspjall',
'it': u'Discussioni Wikiquote',
'ja': u'Wikiquote',
'ka': [u' ', u'Wikiquote '],
'kk': u' ',
'kn': u'Wikiquote ',
'ko': u'',
'ku': u'Wikiquote nqa',
'la': u'Disputatio Vicicitationis',
'lb': u'Wikiquote Diskussioun',
'li': u'Euverlk Wikiquote',
'lt': u'Wikiquote aptarimas',
'ml': u' ',
'mr': u'Wikiquote ',
'nds': u'Wikiquote Diskuschoon',
'nl': u'Overleg Wikiquote',
'nn': u'Wikiquote-diskusjon',
'no': u'Wikiquote-diskusjon',
'pl': u'Dyskusja Wikicytatw',
'pt': u'Wikiquote Discusso',
'qu': u'Wikiquote rimanakuy',
'ro': u'Discuie Wikicitat',
'ru': u' ',
'sk': u'Diskusia k Wikicittom',
'sl': u'Pogovor o Wikinavedku',
'sq': u'Wikiquote diskutim',
'sr': u' Wikiquote',
'su': u'Obrolan Wikiquote',
'sv': u'Wikiquotediskussion',
'ta': u'Wikiquote ',
'te': u'Wikiquote ',
'th': u'Wikiquote',
'tr': u'Vikisz tartma',
'tt': u'Wikiquote bxse',
'uk': u' ',
'ur': u' ',
'uz': u'Vikiiqtibos munozarasi',
'vi': u'Tho lun Wikiquote',
'vo': u'Bespik d Wikiquote',
'wo': u'Wikiquote waxtaan',
'zh': [u'Wikiquote talk', u''],
}
self.namespaces[100] = {
'de': u'Portal',
'fr': u'Portail',
'he': u'',
'li': u'Portaol',
}
self.namespaces[101] = {
'de': u'Portal Diskussion',
'fr': u'Discussion Portail',
'he': u' ',
'li': u'Euverlk portaol',
}
self.namespaces[102] = {
'fr': u'Projet',
}
self.namespaces[103] = {
'fr': u'Discussion Projet',
}
self.namespaces[104] = {
'fr': u'Rfrence',
}
self.namespaces[105] = {
'fr': u'Discussion Rfrence',
}
self.namespaces[108] = {
'fr': u'Transwiki',
}
self.namespaces[109] = {
'fr': u'Discussion Transwiki',
}
self.disambiguationTemplates = {
'_default': [],
'fr': ['Homonymie'],
'ka': [u'', u''],
'pt': [u'Desambiguao'],
}
# attop is a list of languages that prefer to have the interwiki
# links at the top of the page.
self.interwiki_attop = []
# on_one_line is a list of languages that want the interwiki links
# one-after-another on a single line
self.interwiki_on_one_line = []
# Similar for category
self.category_attop = []
# List of languages that want the category on_one_line.
self.category_on_one_line = []
# Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
self.cross_allowed = [
'af','am','ang','ar','ast','az','bg','bs','ca','cs','da','el','es','eu','fa','fr','fi','he','hu','hy','id','it',
'ka','ko','la','lt','nl','nn','no','pt','ro','simple','sv','vi','zh'
]
# CentralAuth cross avaliable projects.
self.cross_projects = [
'wikipedia', 'wiktionary', 'wikibooks', 'wikisource', 'wikinews', 'wikiversity',
'meta', 'mediawiki', 'test', 'incubator', 'commons', 'species'
]
# 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.
alphabetic = ['af','am','ang','ar','roa-rup','ast','az','bn',
'zh-min-nan','bg','be','bs','br','ca','chr','co','cs','cy',
'da','de','als','et','el','en','es','eo','eu','fa','fr',
'fy','ga','gv','gu','gd','gl','ko','hy','hi','hr','io',
'id','ia','is','it','he','jv','kn','ka','ks','csb','kk',
'ky','sw','ku','la','lb','lt','li','hu','mk','mg','ml',
'mi','mr','zh-cfr','mn','nah','na','nl','ja','no','nb',
'nn','oc','om','nds','uz','pl','pt','ro','ru','sa','st',
'sq','si','simple','sk','sl','sr','su','fi','sv','ta','tt',
'te','th','ur','vi','tpi','tr','uk','vo','yi','yo','wo',
'za','zh','zh-cn','zh-tw']
self.interwiki_putfirst = {
'en': alphabetic,
'fi': alphabetic,
'fr': alphabetic,
'he': ['en'],
'hu': ['en'],
'pl': alphabetic,
'simple': alphabetic,
'pt': alphabetic,
}
self.obsolete = {
'als': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Alemannic_Wikiquote
'bm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bambara_Wikiquote
'cr': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nehiyaw_Wikiquote
'dk': 'da',
'ga': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gaeilge_Wikiquote
'jp': 'ja',
'kk': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
'kr': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kanuri_Wikiquote
'ks': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kashmiri_Wikiquote
'kw': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kernewek_Wikiquote
'minnan':'zh-min-nan',
'na': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nauruan_Wikiquote
'nb': 'no',
'nds': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Low_Saxon_Wikiquote
'qu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Quechua_Wikiquote
'simple': 'en', #http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Simple_English_(3)_Wikiquote
'tk': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Turkmen_Wikiquote
'tokipona': None,
'tt': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tatar_Wikiquote
'ug': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Oyghurque_Wikiquote
'vo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Volapuk_Wikiquote
'za':None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Zhuang_Wikiquote
'zh-tw': 'zh',
'zh-cn': 'zh'
}
def version(self, code):
return '1.16wmf4'
def code2encodings(self, code):
"""
Return a list of historical encodings for a specific language wikipedia
"""
# Historic compatibility
if code == 'pl':
return 'utf-8', 'iso8859-2'
if code == 'ru':
return 'utf-8', 'iso8859-5'
return self.code2encoding(code),
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)
|