Modul:Location map: Pabidaan ralatan

Konten dihapus Konten ditambahkan
Mnam23 (pandir | sumbangan)
Maubah jadi versi nang Bahasa Inggris
Mnam23 (pandir | sumbangan)
Babulik ka versi Indonesia
 
Baris 12:
function p.getMapParams(map, frame)
if not map then
error('TheNama namedefinisi ofpeta thelokasi locationyang mapakan definitiondigunakan toharus use must be specifiedditentukan', 2)
end
local moduletitle = mw.title.new('Module:Location map/data/' .. map)
if not moduletitle then
error(string.format('%q isbukan notnama ayang valid nameuntuk fordefinisi apeta location map definitionlokasi', map), 2)
elseif moduletitle.exists then
local mapData = mw.loadData('Module:Location map/data/' .. map)
Baris 28:
else
return mapData[name]
end
end
elseif mw.title.new('Templat:Location map ' .. map).exists then
local cache = {}
if type(frame) ~= 'table' or type(frame.expandTemplate) ~= 'function' then
error('Frame harus disediakan saat menggunakan peta lokasi lama')
end
return function(name, params)
if params then
return frame:expandTemplate{title = 'Location map ' .. map, args = { name, unpack(params) }}
else
if name == nil then
return 'Templat:Location map ' .. map
elseif cache[name] == nil then
cache[name] = frame:expandTemplate{title = 'Location map ' .. map, args = { name }}
end
return cache[name]
end
end
else
error('UnableTidak todapat findmenemukan thedefinisi specifiedpeta locationlokasi mapyang definition:ditentukan. Baik "ModuleModul:Location map/data/' .. map .. '" doesmaupun "Templat:Location map ' .. map .. '" nottidak existada', 2)
end
end
Baris 59 ⟶ 76:
if decimal then
if degrees then
error('DecimalDerajat anddesimal dan DMS degrees cannot bothtidak bedapat provideddiberikan foruntuk ' .. direction, 2)
elseif minutes then
error('MinutesMenit canhanya onlydapat bediberikan provideddengan withderajat DMS degrees foruntuk ' .. direction, 2)
elseif seconds then
error('SecondsDetik canhanya onlydapat bediberikan provideddengan withderajat DMS degrees foruntuk ' .. direction, 2)
elseif hemisphere then
error('AHemisfer hemispherehanya candapat onlydiberikan bedengan provided withderajat DMS degrees foruntuk ' .. direction, 2)
end
local retval = tonumber(decimal)
Baris 71 ⟶ 88:
return retval
end
error('The valueNilai "' .. decimal .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
elseif seconds and not minutes then
error('SecondsDetik weredisediakan provided foruntuk ' .. direction .. ' without minutes alsotanpa beingmenentukan providedmenit', 2)
elseif not degrees then
if minutes then
error('MinutesMenit weredisediakan provided foruntuk ' .. direction .. ' without degrees alsotanpa beingmenentukan providedderajat', 2)
elseif hemisphere then
error('AHemisfer hemispheredisediakan was provided foruntuk ' .. direction .. ' without degrees alsotanpa beingmenentukan providedderajat', 2)
end
return nil
Baris 84 ⟶ 101:
decimal = tonumber(degrees)
if not decimal then
error('TheNilai degree valuederajat "' .. degrees .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
elseif minutes and not tonumber(minutes) then
error('TheNilai minute valuemenit "' .. minutes .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
elseif seconds and not tonumber(seconds) then
error('TheNilai second valuedetik "' .. seconds .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
end
decimal = decimal + (minutes or 0)/60 + (seconds or 0)/3600
Baris 94 ⟶ 111:
local multiplier = hemisphereMultipliers[direction][hemisphere]
if not multiplier then
error('The hemisphereHemisfer "' .. hemisphere .. '" providedyang fordisediakan untuk ' .. direction .. ' is nottidak validsah', 2)
end
decimal = decimal * multiplier
Baris 113 ⟶ 130:
mw.logObject(para, 'para')
mw.logObject(coord, 'coord')
return error('MalformedKesalahan coordinatesformat valuenilai koordinat', 2)
end
return tonumber(result[1]) * hemisphereMultipliers[para][result[2]]
Baris 216 ⟶ 233:
if args.caption and args.caption ~= '' then
if (currentTitle.namespace == 0) and mw.ustring.find(args.caption, '##') then
retval = retval .. '[[CategoryKategori:PagesHalaman usingyang locationmenggunakan mappeta withlokasi adengan doubletanda numberangka signganda inpada the captionketerangannya]]'
end
end
Baris 252 ⟶ 269:
retval = retval .. '<span class="switcher-label" style="display:none">' .. args.switcherLabel .. '</span>'
elseif args.autoSwitcherLabel then
retval = retval .. '<span class="switcher-label" style="display:none">ShowTampilkan map ofpeta ' .. map('name') .. '</span>'
end
Baris 264 ⟶ 281:
mw.logObject(args, 'args')
if currentTitle.namespace == 0 then
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|caption_undefined]]'
end
end
Baris 274 ⟶ 291:
(map('crosses180') ~= '' and 'crosses180' or '') ..
(map('type') ~= '' and 'type' or '')
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|' .. key .. ' ]]'
end
end
Baris 280 ⟶ 297:
mw.log('Pipe used in name of map definition ' .. map())
if currentTitle.namespace == 0 then
retval = retval .. '[[CategoryKategori:LocationPeta mapslokasi withdengan anama nameyang containingmengandung a pipepipa]]'
end
end
Baris 416 ⟶ 433:
end
if args.link and (currentTitle.namespace == 0) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withmenggunakan linkedpenanda markerstertaut withdengan coordinateskoordinat fromdari Wikidata]]')
end
end
if not longitude then
error('NoTidak valueada wasnilai providedyang fordiberikan longitudeuntuk garis bujur')
elseif not latitude then
error('NoTidak valueada wasnilai providedyang fordiberikan latitudeuntuk garis lintang')
end
if currentTitle.namespace > 0 then
if (not args.lon_deg) ~= (not args.lat_deg) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|DegreesDerajat]]')
elseif (not args.lon_min) ~= (not args.lat_min) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|MinutesMenit]]')
elseif (not args.lon_sec) ~= (not args.lat_sec) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|SecondsDetik]]')
elseif (not args.lon_dir) ~= (not args.lat_dir) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|HemisphereHemisfer]]')
elseif (not args.long) ~= (not args.lat) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan differentpresisi longitudegaris andbujur latitudedan precisionsgaris lintang yang berbeda|DecimalDesimal]]')
end
end
if ((tonumber(args.lat_deg) or 0) < 0) and ((tonumber(args.lat_min) or 0) ~= 0 or (tonumber(args.lat_sec) or 0) ~= 0 or (args.lat_dir and args.lat_dir ~='')) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if ((tonumber(args.lon_deg) or 0) < 0) and ((tonumber(args.lon_min) or 0) ~= 0 or (tonumber(args.lon_sec) or 0) ~= 0 or (args.lon_dir and args.lon_dir ~= '')) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if (((tonumber(args.lat_min) or 0) < 0) or ((tonumber(args.lat_sec) or 0) < 0)) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if (((tonumber(args.lon_min) or 0) < 0) or ((tonumber(args.lon_sec) or 0) < 0)) then
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan negativederajat degreesdan andmenit minutesatau ordetik secondsnegatif]]')
end
if args.skew or args.lon_shift or args.markhigh then
Baris 460 ⟶ 477:
(args.lon_shift and 'lon_shift' or '') ..
(args.markhigh and 'markhigh' or '')
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan removedparameter parametersyang dihapus|' .. key ..' ]]')
end
end
Baris 482 ⟶ 499:
if currentTitle.namespace == 0 then
local key = currentTitle.prefixedText
builder:wikitext('[[CategoryKategori:LocationPeta mapslokasi withdengan markstanda outsidedi mapluar andpeta outsidedan parameter notluar settidak diatur|' .. key .. ' ]]')
end
end
Baris 541 ⟶ 558:
local altmaps = switcherSeparate(args.AlternativeMap)
if #altmaps > #map then
error(string.format('%d AlternativeMapsAlternatifMaps were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #altmaps, #map))
end
local overlays = switcherSeparate(args.overlay_image)
if #overlays > #map then
error(string.format('%d overlay_images were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #overlays, #map))
end
if #caption_list > #map then
error(string.format('%d captions were provideddisediakan, buttetapi onlyhanya peta %d maps wereyang provideddisediakan', #caption_list, #map))
end
local outputs = {}