# -*- coding: utf-8 -*-
import family
__version__ = '$Id: wiktionary_family.py 8225 2010-05-28 06:16:24Z xqt $'
# The Wikimedia family that is known as Wiktionary
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'wiktionary'
self.languages_by_size = [
'fr', 'en', 'lt', 'tr', 'zh', 'ru', 'vi', 'io', 'pl', 'pt', 'fi',
'hu', 'el', 'no', 'ta', 'de', 'sv', 'it', 'ko', 'nl', 'kn', 'lo',
'ml', 'ja', 'ku', 'ar', 'es', 'ro', 'et', 'id', 'te', 'gl', 'bg',
'uk', 'ca', 'li', 'vo', 'fa', 'is', 'scn', 'sr', 'af', 'cs', 'th',
'simple', 'fy', 'sw', 'oc', 'br', 'he', 'hr', 'sl', 'hy', 'sq',
'tt', 'la', 'zh-min-nan', 'da', 'wa', 'ne', 'tk', 'ast', 'ur',
'hsb', 'mg', 'kk', 'ky', 'eo', 'lv', 'my', 'wo', 'ang', 'ka', 'co',
'hi', 'ga', 'gn', 'az', 'ia', 'eu', 'sk', 'csb', 'ms', 'st', 'tl',
'cy', 'mr', 'nds', 'kl', 'be', 'sd', 'ug', 'ps', 'ti', 'sh', 'mk',
'an', 'bn', 'gu', 'km', 'ss', 'ts', 'qu', 'bs', 'fo', 'am', 'rw',
'chr', 'su', 'om', 'mn', 'nah', 'ie', 'iu', 'yi', 'mt', 'gv', 'kw',
'gd', 'si', 'tg', 'nn', 'zu', 'dv', 'tpi', 'pa', 'roa-rup', 'jv',
'sg', 'uz', 'mi', 'ik', 'so', 'ha', 'ay', 'lb', 'sa', 'na', 'jbo',
'tn', 'sm', 'ks', 'fj', 'ln', 'za', 'dz', 'als',
]
if family.config.SSL_connection:
self.langs = dict([(lang, None) for lang in self.languages_by_size])
else:
self.langs = dict([(lang, '%s.wiktionary.org' % lang) for lang in self.languages_by_size])
# Override defaults
self.namespaces[2]['eo'] = u'Uzanto'
self.namespaces[3]['eo'] = u'Uzanta diskuto'
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'Wiktionary', self.namespaces[4]['_default']],
'ar': u'',
'ast': u'Uiccionariu',
'bg': u'',
'bn': u'',
'br': u'Wikeriadur',
'bs': u'Vikirjenik',
'ca': u'Viccionari',
'cs': u'Wikislovnk',
'cy': u'Wiciadur',
'el': u'',
'eo': u'Vikivortaro',
'es': u'Wikcionario',
'et': u'Vikisnastik',
'fa': u'',
'fi': u'Wikisanakirja',
'fo': u'Wiktionary',
'fr': u'Wiktionnaire',
'ga': u'Vicfhoclir',
'gu': u'',
'he': u'',
'hi': u'',
'hr': u'Wjenik',
'hu': u'Wikisztr',
'hy': u'',
'ia': u'Wiktionario',
'io': u'Wikivortaro',
'is': u'Wikiorabk',
'it': u'Wikizionario',
'ka': u'',
'kk': u'',
'ko': u'',
'la': u'Victionarium',
'lt': u'Vikiodynas',
'ml': u'',
'ms': u'Wiktionary',
'mt': u'Wikizzjunarju',
'nl': u'WikiWoordenboek',
'oc': u'Wikiccionari',
'pl': u'Wikisownik',
'ps': u'',
'pt': u'Wikcionrio',
'ro': u'Wikionar',
'ru': u'',
'scn': u'Wikizziunariu',
'sk': u'Wikislovnk',
'sl': u'Wikislovar',
'sr': u'',
'tk': u'Wikiszlk',
'tr': u'Vikiszlk',
'tt': u'Wiktionary',
'uk': u'',
'ur': u' ',
'uz': u'Vikilugat',
'vo': u'Vkivdabuk',
'yi': [u'', u''],
'zh': [u'Wiktionary', u''],
}
self.namespaces[5] = {
'_default': [u'Wiktionary talk', self.namespaces[5]['_default']],
'ab': u' Wiktionary',
'af': u'Wiktionarybespreking',
'als': u'Wiktionary Diskussion',
'am': u'Wiktionary ',
'an': u'Descusin Wiktionary',
'ar': u' ',
'ast': u'Uiccionariu alderique',
'av': u' Wiktionary',
'ay': u'Wiktionary Discusin',
'az': u'Wiktionary mzakirsi',
'ba': u'Wiktionary - ',
'be': u'Wiktionary ',
'bg': u' ',
'bm': u'Discussion Wiktionary',
'bn': u' ',
'br': u'Kaozeadenn Wikeriadur',
'bs': u'Razgovor s Vikirjenikom',
'ca': u'Viccionari Discussi',
'cs': u'Diskuse k Wikislovnku',
'csb': u'Disksj Wiktionary',
'cy': u'Sgwrs Wiciadur',
'da': u'Wiktionary-diskussion',
'de': u'Wiktionary Diskussion',
'el': u' ',
'eo': u'Vikivortaro diskuto',
'es': u'Wikcionario Discusin',
'et': u'Vikisnastiku arutelu',
'eu': u'Wiktionary eztabaida',
'fa': u' ',
'fi': u'Keskustelu Wikisanakirjasta',
'fo': u'Wiktionary-kjak',
'fr': u'Discussion Wiktionnaire',
'fy': u'Wiktionary oerlis',
'ga': u'Pl Vicfhoclra',
'gl': u'Conversa Wiktionary',
'gn': u'Wiktionary myangeki',
'gu': u' ',
'gv': u'Resooney Wiktionary',
'he': u' ',
'hi': u' ',
'hr': u'Razgovor Wjenik',
'hsb': u'Wiktionary diskusija',
'hu': u'Wikisztr-vita',
'hy': u' ',
'ia': u'Discussion Wiktionario',
'id': u'Pembicaraan Wiktionary',
'io': u'Wikivortaro Debato',
'is': [u'Wikiorabkarspjall', u'Wikiorabkspjall'],
'it': u'Discussioni Wikizionario',
'ja': u'Wiktionary',
'jv': u'Dhiskusi Wiktionary',
'ka': u' ',
'kk': u' ',
'kl': u'Wiktionary-p oqalliffia',
'km': u'Wiktionary',
'kn': u'Wiktionary ',
'ko': u'',
'ku': u'Wiktionary nqa',
'kw': u'Keskows Wiktionary',
'la': u'Disputatio Victionarii',
'lb': u'Wiktionary Diskussioun',
'li': u'Euverlk Wiktionary',
'ln': u'Discussion Wiktionary',
'lo': u'Wiktionary',
'lt': u'Vikiodyno aptarimas',
'lv': u'Wiktionary diskusija',
'mg': u'Dinika amin\'ny Wiktionary',
'mk': u' Wiktionary',
'ml': u' ',
'mn': u'Wiktionary- ',
'mr': u'Wiktionary ',
'ms': u'Perbincangan Wiktionary',
'mt': u'Diskussjoni Wikizzjunarju',
'nah': u'Wiktionary tixnmiquiliztli',
'nap': [u'Wiktionary chicchiera', u'Discussioni Wiktionary'],
'nds': u'Wiktionary Diskuschoon',
'nl': u'Overleg WikiWoordenboek',
'nn': u'Wiktionary-diskusjon',
'no': u'Wiktionary-diskusjon',
'oc': u'Discussion Wikiccionari',
'pa': u'Wiktionary ',
'pl': u'Wikidyskusja',
'ps': u' ',
'pt': u'Wikcionrio Discusso',
'qu': u'Wiktionary rimanakuy',
'ro': u'Discuie Wikionar',
'ru': u' ',
'sa': u'Wiktionary',
'sc': u'Wiktionary discussioni',
'scn': u'Discussioni Wikizziunariu',
'sd': u'Wiktionary ',
'sg': u'Discussion Wiktionary',
'si': u'Wiktionary ',
'sk': u'Diskusia k Wikislovnku',
'sl': u'Pogovor o Wikislovarju',
'sq': u'Wiktionary diskutim',
'sr': u' ',
'su': u'Obrolan Wiktionary',
'sv': u'Wiktionarydiskussion',
'sw': u'Majadiliano ya Wiktionary',
'ta': u'Wiktionary ',
'te': u'Wiktionary ',
'tg': u' Wiktionary',
'th': u'Wiktionary',
'tk': [u'Wikiszlk ekime', u'Wikiszlk talk'],
'tl': u'Usapang Wiktionary',
'tr': u'Vikiszlk tartma',
'tt': [u'Wiktionary ', u'Wiktionary bxse'],
'uk': u' ',
'ur': u' ',
'uz': u'Vikilugat munozarasi',
'vi': u'Tho lun Wiktionary',
'vo': u'Bespik d Vkivdabuk',
'wa': u'Wiktionary copene',
'wo': u'Wiktionary waxtaan',
'yi': [u' ', u' '],
'za': u'Wiktionary',
'zh': [u'Wiktionary 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] = {
'bg': u'',
'bn': u'',
'bs': u'Portal',
'cy': u'Atodiad',
'el': u'',
'en': u'Appendix',
'es': u'Apndice',
'fa': u'',
'fi': u'Liite',
'fr': u'Annexe',
'ga': u'Aguisn',
'he': u'',
'it': u'Appendice',
'ko': u'',
'lt': u'Sraas',
'no': u'Tillegg',
'oc': u'Annxa',
'pl': u'Aneks',
'pt': u'Apndice',
'ro': u'Portal',
'ru': [u'', u'Appendix'],
'sr': u'',
'tr': u'Portal',
'uk': u'',
}
self.namespaces[101] = {
'bg': u' ',
'bn': u' ',
'bs': u'Razgovor o Portalu',
'cy': u'Sgwrs Atodiad',
'el': u' ',
'en': u'Appendix talk',
'es': u'Apndice Discusin',
'fa': u' ',
'fi': u'Keskustelu liitteest',
'fr': u'Discussion Annexe',
'ga': u'Pl aguisn',
'he': u' ',
'it': u'Discussioni appendice',
'ko': u' ',
'lt': u'Srao aptarimas',
'no': u'Tilleggdiskusjon',
'oc': u'Discussion Annxa',
'pl': u'Dyskusja aneksu',
'pt': u'Apndice Discusso',
'ro': u'Discuie Portal',
'ru': [u' ', u'Appendix talk'],
'sr': u' ',
'tr': u'Portal tartma',
'uk': u' ',
}
self.namespaces[102] = {
'bs': u'Indeks',
'cy': u'Odliadur',
'de': u'Verzeichnis',
'en': u'Concordance',
'fr': u'Transwiki',
'ia': u'Appendice',
'pl': u'Indeks',
'pt': u'Vocabulrio',
'ro': u'Apendice',
'ru': [u'', u'Concordance'],
'sv': u'Appendix',
'uk': u'',
}
self.namespaces[103] = {
'bs': u'Razgovor o Indeksu',
'cy': u'Sgwrs Odliadur',
'de': u'Verzeichnis Diskussion',
'en': u'Concordance talk',
'fr': u'Discussion Transwiki',
'ia': u'Discussion Appendice',
'pl': u'Dyskusja indeksu',
'pt': u'Vocabulrio Discusso',
'ro': u'Discuie Apendice',
'ru': [u' ', u'Concordance talk'],
'sv': u'Appendixdiskussion',
'uk': u' ',
}
self.namespaces[104] = {
'bs': u'Dodatak',
'cy': u'WiciSawrws',
'de': u'Thesaurus',
'en': u'Index',
'fr': u'Portail',
'pl': u'Portal',
'pt': u'Rimas',
'ru': [u'', u'Index'],
'sv': u'Rimord',
}
self.namespaces[105] = {
'bs': u'Razgovor o Dodatku',
'cy': u'Sgwrs WiciSawrws',
'de': u'Thesaurus Diskussion',
'en': u'Index talk',
'fr': u'Discussion Portail',
'pl': u'Dyskusja portalu',
'pt': u'Rimas Discusso',
'ru': [u' ', u'Index talk'],
'sv': u'Rimordsdiskussion',
}
self.namespaces[106] = {
'en': u'Rhymes',
'fr': u'Thsaurus',
'is': u'Viauki',
'pt': u'Portal',
'ru': [u'', u'Rhymes'],
'sv': u'Transwiki',
}
self.namespaces[107] = {
'en': u'Rhymes talk',
'fr': u'Discussion Thsaurus',
'is': u'Viaukaspjall',
'pt': u'Portal Discusso',
'ru': [u' ', u'Rhymes talk'],
'sv': u'Transwikidiskussion',
}
self.namespaces[108] = {
'en': u'Transwiki',
'pt': u'Citaes',
}
self.namespaces[109] = {
'en': u'Transwiki talk',
'pt': u'Citaes Discusso',
}
self.namespaces[110] = {
'en': u'Wikisaurus',
'is': u'Samheitasafn',
'ko': u'',
}
self.namespaces[111] = {
'en': u'Wikisaurus talk',
'is': u'Samheitasafnsspjall',
'ko': u' ',
}
self.namespaces[112] = {
# 'en': u'WT',
}
self.namespaces[113] = {
# 'en': u'WT talk',
}
self.namespaces[114] = {
'en': u'Citations',
}
self.namespaces[115] = {
'en': u'Citations talk',
}
# Other than most Wikipedias, page names must not start with a capital
# letter on ALL Wiktionaries.
self.nocapitalize = self.langs.keys()
# Global bot allowed languages on http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
self.cross_allowed = [
'ang', 'ast', 'az', 'bg', 'bn', 'da', 'eo', 'es', 'fa', 'fy', 'ga', 'gd', 'hu',
'ia', 'ie', 'ik', 'jv', 'ka', 'li', 'lt', 'mk', 'nl', 'no', 'oc', 'pt', 'sk', 'tg', 'th', 'ti',
'ts', 'ug', 'uk', 'vo', 'za', 'zh-min-nan', 'zh', 'zu',
]
# CentralAuth cross avaliable projects.
self.cross_projects = [
'wikipedia', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', 'wikiversity',
'meta', 'mediawiki', 'test', 'incubator', 'commons', 'species'
]
self.obsolete = {
'aa': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Afar_Wiktionary
'ab': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Abkhaz_Wiktionary
'ak': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Akan_Wiktionary
'as': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Assamese_Wiktionary
'av': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Avar_Wiktionary
'ba': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bashkir_Wiktionary
'bh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bihari_Wiktionary
'bi': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bislama_Wiktionary
'bm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Bambara_Wiktionary
'bo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tibetan_Wiktionary
'ch': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Chamorro_Wiktionary
'cr': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Nehiyaw_Wiktionary
'dk': 'da',
'jp': 'ja',
'mh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Marshallese_Wiktionary
'mo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Moldovan_Wiktionary
'minnan':'zh-min-nan',
'nb': 'no',
'or': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Oriya_Wiktionary
'pi': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Pali_Bhasa_Wiktionary
'rm': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Rhaetian_Wiktionary
'rn': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Kirundi_Wiktionary
'sc': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Sardinian_Wiktionary
'sn': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Shona_Wiktionary
'to': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Tongan_Wiktionary
'tlh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Klingon_Wiktionary
'tw': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Twi_Wiktionary
'tokipona': None,
'xh': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Xhosa_Wiktionary
'yo': None, # http://meta.wikimedia.org/wiki/Proposals_for_closing_projects/Closure_of_Yoruba_Wiktionary
'zh-tw': 'zh',
'zh-cn': 'zh'
}
# Order for fy: alphabetical by code, but y counts as i
# TODO: This code is duplicated from wikipedia_family.py
def fycomp(x,y):
x = x.replace("y","i")+x.count("y")*"!"
y = y.replace("y","i")+y.count("y")*"!"
return cmp(x,y)
self.fyinterwiki = self.alphabetic[:]
self.fyinterwiki.sort(fycomp)
# 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,
'et': self.alphabetic,
'fi': self.alphabetic,
'fy': self.fyinterwiki,
'he': ['en'],
'hu': ['en'],
'pl': self.alphabetic,
'simple': self.alphabetic
}
self.interwiki_on_one_line = ['pl']
self.interwiki_attop = ['pl']
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)
|