# -*- coding: utf-8 -*-
import family
__version__ = '$Id: wikibooks_family.py 8225 2010-05-28 06:16:24Z xqt $'
# The Wikimedia family that is known as Wikibooks
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wikibooks'
self.languages_by_size = [
'en', 'de', 'fr', 'ja', 'pt', 'hu', 'nl', 'es', 'pl', 'it', 'he',
'sq', 'fi', 'ru', 'vi', 'cs', 'hr', 'ca', 'sv', 'zh', 'da', 'tr',
'th', 'mk', 'ko', 'sr', 'fa', 'tl', 'ar', 'id', 'gl', 'is', 'no',
'ta', 'ka', 'lt', 'eo', 'bg', 'ro', 'sk', 'el', 'la', 'si', 'ia',
'ang', 'cv', 'sl', 'et', 'uk', 'mr', 'ur', 'az', 'oc', 'ml', 'ms',
'eu', 'hi', 'fy', 'ie', 'tg', 'bn', 'af', 'hy', 'pa', 'te', 'bs',
'sa', 'ky', 'be', 'ast', 'tt', 'zh-min-nan', 'cy', 'mg', 'ne', 'ku',
'co', 'sw', 'tk', 'su', 'als', 'vo', 'uz', 'na', 'mn', 'kk', 'nds',
'zu', 'my',
]
if family.config.SSL_connection:
self.langs = dict([(lang, None) for lang in self.languages_by_size])
else:
self.langs = dict([(lang, '%s.wikibooks.org' % lang) for lang in self.languages_by_size])
# Override defaults
self.namespaces[2]['pl'] = u'Wikipedysta'
self.namespaces[3]['pl'] = u'Dyskusja Wikipedysty'
# 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'Wikibooks', self.namespaces[4]['_default']],
'ar': u' ',
'bg': u'',
'bn': u'',
'bs': u'Wikiknjige',
'ca': u'Viquillibres',
'cs': u'Wikiknihy',
'cy': u'Wicillyfrau',
'el': u'',
'eo': u'Vikilibroj',
'es': u'Wikilibros',
'et': u'Vikipikud',
'fa': u'',
'fi': u'Wikikirjasto',
'fr': u'Wikilivres',
'ga': u'Vicleabhair',
'he': u'',
'hr': u'Wikiknjige',
'hu': u'Wikiknyvek',
'hy': u'',
'is': u'Wikibkur',
'ka': u'',
'kk': u'',
'ko': u'',
'la': u'Vicilibri',
'ml': u'',
'no': u'Wikibker',
'oc': u'Wikilibres',
'ps': u'',
'pt': u'Wikilivros',
'ro': u'Wikimanuale',
'ru': u'',
'sl': u'Wikiknjige',
'sr': u'',
'tr': u'Vikikitap',
'uk': u'',
'ur': u' ',
'uz': u'Vikikitob',
'vo': u'Vkibuks',
'zh': [u'Wikibooks', u''],
}
self.namespaces[5] = {
'_default': [u'Wikibooks talk', self.namespaces[5]['_default']],
'af': u'Wikibooksbespreking',
'als': u'Wikibooks Diskussion',
'ar': u' ',
'ast': u'Wikibooks alderique',
'ay': u'Wikibooks Discusin',
'az': u'Wikibooks mzakirsi',
'ba': u'Wikibooks - ',
'be': u'Wikibooks ',
'bg': u' ',
'bm': u'Discussion Wikibooks',
'bn': u' ',
'bs': u'Razgovor s Wikiknjigama',
'ca': u'Viquillibres Discussi',
'cs': u'Diskuse k Wikiknihm',
'cv': u'Wikibooks ',
'cy': u'Sgwrs Wicillyfrau',
'da': u'Wikibooks-diskussion',
'de': u'Wikibooks Diskussion',
'el': u' ',
'eo': u'Vikilibroj diskuto',
'es': u'Wikilibros Discusin',
'et': u'Vikipikute arutelu',
'eu': u'Wikibooks eztabaida',
'fa': u' ',
'fi': u'Keskustelu Wikikirjastosta',
'fr': u'Discussion Wikilivres',
'fy': u'Wikibooks oerlis',
'ga': u'Pl Vicleabhar',
'gl': u'Conversa Wikibooks',
'gn': u'Wikibooks myangeki',
'he': u' ',
'hi': u'Wikibooks ',
'hr': u'Razgovor Wikiknjige',
'hu': u'Wikiknyvek-vita',
'hy': u' ',
'ia': u'Discussion Wikibooks',
'id': u'Pembicaraan Wikibooks',
'is': u'Wikibkurspjall',
'it': u'Discussioni Wikibooks',
'ja': u'Wikibooks',
'ka': u' ',
'kk': u' ',
'km': u'Wikibooks',
'kn': u'Wikibooks ',
'ko': u'',
'ku': u'Wikibooks nqa',
'la': u'Disputatio Vicilibrorum',
'lb': u'Wikibooks Diskussioun',
'ln': u'Discussion Wikibooks',
'lt': u'Wikibooks aptarimas',
'lv': u'Wikibooks diskusija',
'mg': u'Dinika amin\'ny Wikibooks',
'mk': u' Wikibooks',
'ml': u' ',
'mn': u'Wikibooks- ',
'mr': u'Wikibooks ',
'ms': u'Perbincangan Wikibooks',
'nah': u'Wikibooks Discusin',
'nds': u'Wikibooks Diskuschoon',
'nl': u'Overleg Wikibooks',
'no': u'Wikibker-diskusjon',
'oc': u'Discussion Wikilibres',
'pa': u'Wikibooks ',
'pl': u'Dyskusja Wikibooks',
'ps': u' ',
'pt': u'Wikilivros Discusso',
'qu': u'Wikibooks rimanakuy',
'ro': u'Discuie Wikimanuale',
'ru': u' ',
'sa': u'Wikibooks',
'si': u'Wikibooks ',
'sk': u'Diskusia k Wikibooks',
'sl': u'Pogovor o Wikiknjigah',
'sq': u'Wikibooks diskutim',
'sr': u' ',
'su': u'Obrolan Wikibooks',
'sv': u'Wikibooksdiskussion',
'sw': u'Majadiliano ya Wikibooks',
'ta': u'Wikibooks ',
'te': u'Wikibooks ',
'tg': u' Wikibooks',
'th': u'Wikibooks',
'tk': u'Wikibooks ekime',
'tl': u'Usapang Wikibooks',
'tr': u'Vikikitap tartma',
'tt': [u'Wikibooks ', u'Wikibooks bxse'],
'uk': u' ',
'ur': u' ',
'uz': u'Vikikitob munozarasi',
'vi': u'Tho lun Wikibooks',
'vo': u'Bespik d Vkibuks',
'wa': u'Wikibooks copene',
'za': u'Wikibooks',
'zh': [u'Wikibooks talk', u''],
}
self.namespaces[100] = {
'fr': u'Transwiki',
'he': u'',
'id': u'Resep',
'it': u'Progetto',
'ja': u'Transwiki',
'ml': u'',
'ms': u'Resipi',
'ro': u'Raft',
'ru': u'',
'tr': u'Yemek',
'uk': u'',
}
self.namespaces[101] = {
'fr': u'Discussion Transwiki',
'he': u' ',
'id': u'Pembicaraan Resep',
'it': u'Discussioni progetto',
'ja': u'Transwiki',
'ml': u'',
'ms': u'Perbualan Resipi',
'ro': u'Discuie Raft',
'ru': u' ',
'tr': u'Yemek tartma',
'uk': u' ',
}
self.namespaces[102] = {
'ca': u'Viquiprojecte',
'cy': u'Silff lyfrau',
'de': u'Regal',
'en': u'Cookbook',
'es': u'Wikiversidad',
'id': u'Wisata',
'it': u'Ripiano',
'ml': u'',
'nl': u'Transwiki',
'ro': u'Wikijunior',
'ru': u'',
'sr': u'',
'uk': u'',
}
self.namespaces[103] = {
'ca': u'Viquiprojecte Discussi',
'cy': u'Sgwrs Silff lyfrau',
'de': u'Regal Diskussion',
'en': u'Cookbook talk',
'es': u'Wikiversidad Discusin',
'id': u'Pembicaraan Wisata',
'it': u'Discussioni ripiano',
'ml': u'',
'nl': u'Overleg transwiki',
'ro': u'Discuie Wikijunior',
'ru': u' ',
'sr': u' ',
'uk': u' ',
}
self.namespaces[104] = {
'he': u'',
'ka': u'',
'nl': u'Wikijunior',
'pl': u'Wikijunior',
'ro': u'Carte de bucate',
'ru': u'',
}
self.namespaces[105] = {
'he': u' ',
'ka': u' ',
'nl': u'Overleg Wikijunior',
'pl': u'Dyskusja Wikijuniora',
'ro': u'Discuie Carte de bucate',
'ru': u' ',
}
self.namespaces[106] = {
'ru': u'',
}
self.namespaces[107] = {
'ru': u' ',
}
self.namespaces[108] = {
'en': u'Transwiki',
}
self.namespaces[109] = {
'en': u'Transwiki talk',
}
self.namespaces[110] = {
'en': u'Wikijunior',
'tr': u'Vikiocuk',
}
self.namespaces[111] = {
'en': u'Wikijunior talk',
'tr': u'Vikiocuk tartma',
}
self.namespaces[112] = {
'en': u'Subject',
'tr': u'Kitaplk',
}
self.namespaces[113] = {
'en': u'Subject talk',
'tr': u'Kitaplk tartma',
}
# 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', 'ar', 'roa-rup', 'om', 'bg', 'be', 'bn', 'bs',
'ca', 'chr', 'co', 'cs', 'cy', 'da', 'de', 'als', 'et',
'el', 'en', 'es', 'eo', 'eu', 'fa', 'fr', 'fy', 'gv',
'gd', 'gl', 'ko', 'hi', 'hr', 'io', 'id', 'ia', 'is', 'it',
'he', 'jv', 'ka', 'csb', 'sw', 'la', 'lv', 'lt', 'hu',
'mk', 'mg', 'ml', 'mi', 'mr', 'ms', 'zh-cfr', 'mn', 'nah', 'na',
'nl', 'ja', 'no', 'nb', 'oc', 'nds', 'pl', 'pt', 'ro', 'ru',
'sa', 'st', 'sq', 'si', 'simple', 'sk', 'sl', 'sr', 'su',
'fi', 'sv', 'ta', 'tt', 'th', 'ur', 'vi',
'tpi', 'tr', 'uk', 'vo', 'yi', 'za', 'zh', 'zh-cn',
'zh-tw']
self.obsolete = {
'aa': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Afar_Wikibooks
'ak': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Akan_Wikibooks
'as': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Assamese_Wikibooks
'ay': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Aymar_Wikibooks
'ba': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bashkir_Wikibooks
'bi': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bislama_Wikibooks
'bm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bambara_Wikibooks
'bo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tibetan_Wikibooks
'ch': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Chamorro_Wikibooks
'dk': 'da',
'ga':None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gaeilge_Wikibooks
'got': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gothic_Wikibooks
'gn': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Guarani_Wikibooks
'gu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Gujarati_Wikibooks
'jp': 'ja',
'km': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Khmer_Wikibooks
'kn': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
'ks': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kashmiri_Wikibooks
'lb': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_L%C3%ABtzebuergesch_Wikibooks
'ln': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Lingala_Wikibooks
'lv': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Latvian_Wikibooks
'mi': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Maori_Wikibooks
'minnan':'zh-min-nan',
'nah': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nahuatl_Wikibooks
'nb': 'no',
'ps': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Pashto_Wikibooks
'qu': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Quechua_Wikibooks
'rm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Rumantsch_Wikibooks
'se': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Sami_Wikibooks
'simple' : 'en', # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
'tokipona': None,
'ug': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Uyghur_Wikibooks
'wa': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Walon_Wikibooks
'xh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Xhosa_Wikibooks
'yo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Yoruba_Wikibooks
'za': None, # https://bugzilla.wikimedia.org/show_bug.cgi?id=20325
'zh-tw': 'zh',
'zh-cn': 'zh'
}
self.interwiki_putfirst = {
'en': alphabetic,
'fi': alphabetic,
'fr': alphabetic,
'he': ['en'],
'hu': ['en'],
'pl': alphabetic,
'simple': alphabetic
}
# Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
self.cross_allowed = ['fa', 'fy', 'it', 'nl', 'ru', 'simple', 'zh']
# CentralAuth cross avaliable projects.
self.cross_projects = [
'wikipedia', 'wiktionary', 'wikiquote', 'wikiquote', 'wikinews', 'wikiversity',
'meta', 'mediawiki', 'test', 'incubator', 'commons', 'species'
]
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)
|