2007/12/28, Milos Rancic <millosh(a)lingvistika.org>rg>:
Anarchopedia is using ISO 639-2 (three letters) codes
from its
beginning. Two letters codes are generally Apache config hack for
compatibility with Wikipedia (interwiki links also have compatibility
with Wikipedia and they are usually used, even three letters codes
should be used). Long time ago I asked Andre Engels how to change
that, but I forgot how to do that. So, may someone fix it? Here is the
list of the pairs:
I would have liked to change this, but I currently have no SVN access
(I lost my private SSH password in a hard disk crash). There are a few
things that should be done. Below they are given in order of
importance.
1. In anarchopedia_family.py, the lines
for lang in self.knownlanguages:
self.langs[lang] = lang+'.anarchopedia.org'
should be changed. I would propose:
self.langs['ara'] = self.langs['ar'] =
'ara.anarchopedia.org'
self.langs['ind'] = self.langs['id'] =
'ind.anarchopedia.org'
# etcetera
This will cause the bot to know that anarchopedia uses ISO639-2 codes,
and where the bot should find its pages.
2. In anarchopedia_family, in the definition of __init__ (somewhere
among the lines "family.Family.__init__(self)" until "alphabetic =
['ar','id',...]" and with the same indentation, add lines:
self.obsolete = {
'ar' : 'ara',
'id' : 'ind',
'bs': 'bos',
# etcetera
}
This will make the bot change two-letter codes into three-letter codes
automatically. Incorrect 2-letter interwiki (to non-existing pages)
will however still be deleted silently.
3. In wikipedia.py, the definition of altlang should have elements added like
if code == 'ara':
return ['ar']
# etcetera, with adaptations
That way, the summaries in the local languages (where available) will
be used, rather than the English ones for all languages.
ar:ara
id:ind
bs:bos
zh:chi
da:dan
de:deu
el:ell
es:spa
eo:epo
fr:fra
hr:hrv
it:ita
ja:jpn
lt:lit
nl:dut
no:nor
nn:nno
pl:pol
pt:por
ro:rum
ru:rus
sr:srp
sh:nsh
sv:swe
(nsh is not an ISO 639-2 code)
_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
--
Andre Engels, andreengels(a)gmail.com
ICQ: 6260644 -- Skype: a_engels