Модуль:Interwiki: различия между версиями

нет описания правки
Нет описания правки
Нет описания правки
 
Строка 92: Строка 92:
for i, j in pairs(entity2.sitelinks) do
for i, j in pairs(entity2.sitelinks) do
if j.site ~= 'ruwiki' and j.site ~= 'wikidatawiki' and j.site ~= 'commonswiki' and j.site ~= 'specieswiki' and j.site ~= 'metawiki' and j.site ~= 'mediawikiwiki' then -- excludes the own wiki and some wikiprojects that are not Wikipedia, even if their code ends with 'wiki'
if j.site ~= 'ruwiki' and j.site ~= 'wikidatawiki' and j.site ~= 'commonswiki' and j.site ~= 'specieswiki' and j.site ~= 'metawiki' and j.site ~= 'mediawikiwiki' then -- excludes the own wiki and some wikiprojects that are not Wikipedia, even if their code ends with 'wiki'
if mw.ustring.sub( j.site, mw.ustring.len(j.site) - 3 ) == 'wiki' then -- excludes Wikisource, Wikiquote, Wikivoyage etc
if mw.ustring.sub( j.site, mw.ustring.len(j.site) - 3 ) == 'w' then -- excludes Wikisource, Wikiquote, Wikivoyage etc
local lang = langcode[mw.ustring.sub( j.site, 1, mw.ustring.len(j.site) - 4 )] or mw.ustring.sub( j.site, 1, mw.ustring.len(j.site) - 4 )
local lang = langcode[mw.ustring.sub( j.site, 1, mw.ustring.len(j.site) - 4 )] or mw.ustring.sub( j.site, 1, mw.ustring.len(j.site) - 4 )
if (entity and not entity.sitelinks[j.site]) or not entity then -- excludes interwiki to projects that already have sitelinks in the present page
if (entity and not entity.sitelinks[j.site]) or not entity then -- excludes interwiki to projects that already have sitelinks in the present page