Modul:Failsafe: Unterschied zwischen den Versionen

K
15 Versionen von wikivoyage:Modul:Failsafe importiert
(correction)
K (15 Versionen von wikivoyage:Modul:Failsafe importiert)
 
(8 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 2: Zeile 2:
local Failsafe = {
local Failsafe = {
suite  = 'Failsafe',
suite  = 'Failsafe',
serial = '2021-04-08',
serial = '2022-04-25',
item  = 65306115
item  = 65306115
}
}
Zeile 9: Zeile 9:
docPage          = 'Doku',
docPage          = 'Doku',
ok                = '[[File:Artículo bueno.svg|16px|text-bottom|Ok!]]',
ok                = '[[File:Artículo bueno.svg|16px|text-bottom|Ok!]]',
notOk            = '[[File:Symbol oppose vote.svg|15px|text-bottom|Contra]]',
notOk            = '[[File:Symbol oppose vote.svg|15px|text-bottom|Contra]][[Category:Andere Modulversion in Wikidata]]',
otherVersion      = '[[Category:Andere Modulversion in Wikidata]]',
versionText      = 'Versionsbezeichnung auf Wikidata:',
versionText      = 'Versionsbezeichnung auf Wikidata:',
noVersion        = 'keine Version verfügbar',
noVersion        = 'keine Version verfügbar'
noWikidataVersion = '(keine Version auf Wikidata verfügbar)'
}
}


Zeile 67: Zeile 65:
v = s[ i ].mainsnak.datavalue.value
v = s[ i ].mainsnak.datavalue.value
if v ~= '' then
if v ~= '' then
return v
return v:gsub( '%.', '-' )
end
end
end
end
Zeile 92: Zeile 90:


local title = mw.ustring.gsub( mw.title.getCurrentTitle().text, '/' .. strings.docPage, '' )
local title = mw.ustring.gsub( mw.title.getCurrentTitle().text, '/' .. strings.docPage, '' )
if title == 'Failsafe' then
if title == 'Failsafe' then -- the module itself
success = true
success = true
m = fs
m = fs
Zeile 102: Zeile 100:
fromModule = m.moduleInterface.serial
fromModule = m.moduleInterface.serial
fromWikidata = fs._failsafe( 'wikidata', m.moduleInterface )
fromWikidata = fs._failsafe( 'wikidata', m.moduleInterface )
elseif m.failsafe then
fromModule = m.failsafe( '' )
fromWikidata = m.failsafe( 'wikidata' )
end
end
if fromWikidata or fromModule then
if fromWikidata or fromModule then
Zeile 110: Zeile 105:
.. ( fromWikidata or fromModule ) .. '</code>'
.. ( fromWikidata or fromModule ) .. '</code>'
if fromWikidata and fromModule then
if fromWikidata and fromModule then
if fromWikidata == fromModule then
result = result .. ' ' ..
result = result .. ' ' .. strings.ok
( fromWikidata == fromModule and strings.ok or strings.notOk )
else
result = result .. ' ' .. strings.notOk .. strings.otherVersion
end
elseif not fromWikidata then
result = result .. ' ' .. noWikidataVersion
end
end
end
end