אונטערשייד צווישן ווערסיעס פון "יחידה:Coordinates"

456 בייטן צוגעלייגט ,  פֿאַר 1 יאָר
דערווייל צו רוי
ק (6 רעוויזיעס אימפארטירט פֿון wikipedia:yi:יחידה:Coordinates)
(דערווייל צו רוי)
 
(11 מיטלסטע ווערסיעס פון 3 באַניצער נישט געוויזן.)
שורה 32: שורה 32:
--[[ Helper function, replacement for {{coord/display/title}} ]]
--[[ Helper function, replacement for {{coord/display/title}} ]]
function displaytitle (s, notes)
function displaytitle (s, notes)
local l = "[[געאגראפישע קאארדינאטן|קאארדינאטן]]: " .. s
local l = "[[:yi:רוי:געאגראפישע קאארדינאטן|קאארדינאטן]]: " .. s
local co = '<span id="coordinates">' .. l .. notes .. '</span>';
local co = '<span id="coordinates" style="font-size: small;">' .. l .. notes .. '</span>';
return '<span style="font-size: small;">' .. co .. '</span>';
return globalFrame:extensionTag{
name = 'indicator',
content = co,
args = { name = '0-coord' }
};
end
end


שורה 170: שורה 175:
end
end
local geodmshtml = '<span class="geo-dms" title="מפות, צילומי אוויר ומידע נוסף על מיקום זה">'
local geodmshtml = '<span class="geo-dms" title="דערנעבנדיגע ארטיקלען אויף המכלול">'
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="latitude">' .. coordinateSpec["dms-lat"] .. '</span> '
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
.. '<span class="longitude">' ..coordinateSpec["dms-long"] .. '</span>'
שורה 190: שורה 195:
end
end
local geodechtml = '<span class="geo-dec" title="מפות, צילומי אוויר ומידע נוסף על מיקום זה>'
local geodechtml = '<span class="geo-dec" title="דערנעבנדיגע ארטיקלען אויף המכלול">'
.. geodeclat .. ' '
.. geodeclat .. ' '
.. geodeclong
.. geodeclong
שורה 215: שורה 220:
end
end


return '<span class="plainlinks nourlexpansion">' ..  
return '[[באַזונדער:בסביבה#/coord/' ..coordinateSpec["dec-lat"] .. ',' .. coordinateSpec["dec-long"] .. '|' .. inner .. ']]'..' [[טעקע:Black Globe icon.svg|15px|קישור=' .. coord_link .. uriComponents .. '|מאפעס, בילדער פון דער הייעך און נאך אינפארמאציע אויף דעם ארט]]'
'[' .. coord_link .. uriComponents .. ' ' .. inner .. ']' .. '</span>'
end
end


שורה 310: שורה 314:
return specPrinter( args, result )
return specPrinter( args, result )
else
else
return specPrinter( args, result ) .. " " .. errorPrinter(errors) .. '[[קאטעגאריע:בלעטער מיט פעלערדיקע קאארדינאטן טאגן]]';  
return specPrinter( args, result ) .. " " .. errorPrinter(errors) .. '[[קאטעגאריע:בלעטער מיט פעלערדיגע קאארדינאטן טעגס]]';  
end
end
end
end
שורה 601: שורה 605:
text = text .. displaytitle(contents, Notes)
text = text .. displaytitle(contents, Notes)
-- Add a Wikidata category for mainspace pages.
-- Add a Wikidata category for mainspace pages.
if mw.wikibase and current_page.namespace == 0 then
if mw.wikibase and current_page.namespace == 0 and mw.wikibase.getEntityIdForCurrentPage() then
local wikidata_cat
local wikidata_cat
local entity = mw.wikibase.getEntityObject()
local wd_coord = mw.wikibase.getBestStatements( mw.wikibase.getEntityIdForCurrentPage(), 'P625' )
if entity and entity.claims and entity.claims.P625 then
local snaktype
local snaktype = entity.claims.P625[1].mainsnak.snaktype
-- fallback to P159
if snaktype == 'value' then
if not (wd_coord and wd_coord[1]) then
wikidata_cat = '[[קאטעגאריע:קאארדינאטן אויף וויקידאטן]]' -- coordinates exist both here and on Wikidata, and can be compared
wd_coord = mw.wikibase.getBestStatements( mw.wikibase.getEntityIdForCurrentPage(), 'P159' )
--elseif snaktype == 'somevalue' then
if #wd_coord > 0 and wd_coord[1].qualifiers and wd_coord[1].qualifiers and wd_coord[1].qualifiers['P625'] then
-- wikidata_cat = '[[Category:Coordinates on Wikidata set to unknown value]]'
snaktype = wd_coord[1].qualifiers['P625'][1].snaktype
--elseif snaktype == 'novalue' then
-- wikidata_cat = '[[קאטעגאריע:דפים עם נקודות ציון חסרות ערך בוויקינתונים]]'
end
end
else
else
wikidata_cat = '[[קאטעגאריע:קאארדינאטן נישט אויף וויקידאטן]]' -- we have to either import the coordinates to Wikidata or remove them here
snaktype= wd_coord[1].mainsnak.snaktype
end
if snaktype == 'value' then
wikidata_cat = '[[קאטעגאריע:קאארדינאטן אויף וויקידאטא]]' -- coordinates exist both here and on Wikidata, and can be compared
else
wikidata_cat = '[[קאטעגאריע:קאארדינאטן נישט אויף וויקידאטא]]' -- we have to either import the coordinates to Wikidata or remove them here
end
end
if wikidata_cat then
if wikidata_cat then
שורה 635: שורה 642:
if frame.args[1] == "latitude" or frame.args[1] == "longitude" or frame.args[1] == "precision" or frame.args[1] == "dimension" or frame.args[1] == "globe" then
if frame.args[1] == "latitude" or frame.args[1] == "longitude" or frame.args[1] == "precision" or frame.args[1] == "dimension" or frame.args[1] == "globe" then
local claimName = args['claim'] or 'P625'
local claimName = args['claim'] or 'P625'
local entityId = mw.wikibase.getEntityIdForCurrentPage()
if entityId == nil then return nil end
local wd_coord = mw.wikibase.getBestStatements( entityId, claimName )
if wd_coord==nil or #wd_coord==0 then return nil end
myValue = wd_coord[1]
local qualifierId = args['qualifier']
if qualifierId then
myValue = myValue.qualifiers[qualifierId][1].datavalue.value[frame.args[1]]
else
myValue = myValue.mainsnak.datavalue.value[frame.args[1]]
end
if frame.args[1] == "globe" then
globeId = mw.ustring.match( myValue, "Q%d+" )
myValue = myGlobes[globeId]
end
return myValue
if mw.wikibase.getEntityObject().claims[claimName] == nil then
return nil
else myValue = mw.wikibase.getEntityObject().claims[claimName][1]
local qualifierId = args['qualifier']
if qualifierId then
myValue = myValue.qualifiers[qualifierId][1].datavalue.value[frame.args[1]]
else
myValue = myValue.mainsnak.datavalue.value[frame.args[1]]
end
if frame.args[1] == "globe" then
globeId = mw.ustring.match( myValue, "Q%d+" )
myValue = myGlobes[globeId]
end
return myValue
end
else
else
return nil
return nil