မေႃႇၵျူး:Coordinates: လွင်ႈပႅၵ်ႇပိူင်ႈ ၼႂ်းၵႄႈ လွင်ႈၶူၼ်ႉၶႆႈ

Content deleted Content added
m rm prefix
upd
 
ထႅဝ် 419:
if not result then
return errorPrinter(errors);
end
-- formatting for geohack: geohack expects D_N_D_E notation or D;D notation
result.param = table.concat({args[1], 'N', args[2] or '', 'E', args[3] or ''}, '_')
-- wikiminiatlas doesn't support D;D notation
-- #coordinates parserfunction doesn't support negative decimals with NSWE
result.param = table.concat({
math.abs(tonumber(args[1])),
((tonumber(args[1]) or 0) < 0) and 'S' or 'N',
math.abs(tonumber(args[2])),
((tonumber(args[2]) or 0) < 0) and 'W' or 'E',
args[3] or ''}, '_')
elseif dmsTest(args[4], args[8]) then
-- dms logic
Line 477 ⟶ 485:
Generate Wikidata tracking categories.
]]
local function makeWikidataCategories(qid)
local ret
if mw.wikibase and current_page.namespace == 0 then
local entity = qid and mw.wikibase.getEntityObject(qid) or mw.wikibase.getEntityObject()
if entity and entity.claims and entity.claims.P625 and entity.claims.P625[1] then
local snaktype = entity.claims.P625[1].mainsnak.snaktype
Line 601 ⟶ 609:
if (not args[1] or not tonumber(args[1])) and not args[2] and mw.wikibase.getEntityObject() then
args[3] = args[1]; args[1] = nil
local entity = args.qid and mw.wikibase.getEntityObject(args.qid) or mw.wikibase.getEntityObject()
if entity
and entity.claims
Line 643 ⟶ 651:
text = text
.. displaytitle(contents, Notes)
.. makeWikidataCategories(args.qid)
end
if not args.nosave then
Line 710 ⟶ 718:
for i, v in ipairs(frame.args) do
if i ~= 1 then
if not mw.ustring.find(frame.args[1], (mw.ustring.match(frame.args[i], '^(.-:)') or '')) then
frame.args[1] = mw.ustring.gsub(frame.args[1], '(params=.-)_? ', '%1_'..frame.args[i]..' ') end
end
end
end
if frame.args.name then
if not mw.ustring.find(frame.args[1], '<span class="vcard">') then
local namestr = frame.args.name
frame.args[1] = mw.ustring.gsub(frame.args[1],
'(<span class="geo%-default">)(<span[^<>]*>[^<>]*</span><span[^<>]*>[^<>]*<span[^<>]*>[^<>]*</span></span>)(</span>)',
'%1<span class="vcard">%2<span style="display:none">&#xfeff; (<span class="fn org">' .. namestr .. '</span>)</span></span>%3')
frame.args[1] = mw.ustring.gsub(frame.args[1], '(&params=[^&"<>%[%] ]*) ', '%1&title=' .. mw.uri.encode(namestr) .. ' ')
end
end
ဢဝ်ၶိုၼ်းမႃးတီႈ "https://shn.wikipedia.org/wiki/မေႃႇၵျူး:Coordinates"