মডিউল:অবস্থান মানচিত্র/খেলাঘর: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
Johnuniq (আলোচনা | অবদান)
start fix requested at en:WT:Lua#Script error
Johnuniq (আলোচনা | অবদান)
translate args when they are fetched; it seems translating all of them is best
(একই ব্যবহারকারী দ্বারা সম্পাদিত ২টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না)
৩ নং লাইন:
local p = {}
 
local getArgs_getArgs = require('Module:Arguments').getArgs
 
local function getArgs(...)
-- Return args after translation.
local noTranslate = {
label = true,
link = true,
mark = true,
})
local args = _getArgs(...)
for k, v in pairs(args) do
if not noTranslate[k] then
coord v = mw.ustring.gsub(coordv, '%d', {
['০'] = '0',
['১'] = '1',
['২'] = '2',
['৩'] = '3',
['৪'] = '4',
['৫'] = '5',
['৬'] = '6',
['৭'] = '7',
['৮'] = '8',
['৯'] = '9',
})
args[k] = convertToEn("en", v)
:gsub(' *উত্তর', 'N')
:gsub(' *পূর্ব' , 'E')
:gsub(' *দক্ষিণ', 'S')
:gsub(' *পশ্চিম', 'W')
end
end
return args
end
 
local function round(n, decimals)
১২০ ⟶ ১৫২ নং লাইন:
-- Finds a parameter in a transclusion of {{Coord}}.
local function coord2text(para, coord)
coord = mw.ustring.gsub(coord, '%d', {
['০'] = '0',
['১'] = '1',
['২'] = '2',
['৩'] = '3',
['৪'] = '4',
['৫'] = '5',
['৬'] = '6',
['৭'] = '7',
['৮'] = '8',
['৯'] = '9',
})
coord = coord
:gsub(' *উত্তর', 'N')
:gsub(' *পূর্ব' , 'E')
:gsub(' *দক্ষিণ', 'S')
:gsub(' *পশ্চিম', 'W')
local value, direction, latitude, ew = coord:match('(%-?[.%d]+)°([NS]) (%-?[.%d]+)°([EW])')
if para == 'longitude' then value, direction = latitude, ew end
৩৬২ ⟶ ৩৭৭ নং লাইন:
map = p.getMapParams(args[1], frame)
end
 
---TODO: CHECK------------------------------------------------------------------
for k,v in pairs(args) do
if k ~= "label" and k ~= "mark" and k ~= "link" then
local convertToEn = require("মডিউল:Numeral converter/খেলাঘর").convert
args[k] = convertToEn("en", v)
end
end
for k,v in pairs(args) do
if k ~= "label" and k ~= "mark" and k ~= "link" then
local convert_cordinationEn = require("মডিউল:Numeral converter/খেলাঘর").convert_cordination
args[k] = convert_cordinationEn(v)
end
end
---END: CHECK------------------------------------------------------------------
 
local x, y, longitude, latitude
longitude = decdeg(args.lon_deg, args.lon_min, args.lon_sec, args.lon_dir, args.long, 'longitude')
৪৬৯ ⟶ ৪৬৮ নং লাইন:
args = getArgs(frame, {wrappers = 'টেমপ্লেট:অবস্থান মানচিত্র', valueFunc = p.valueFunc})
end
 
---TODO: CHECK------------------------------------------------------------------
for k,v in pairs(args) do
if k ~= "label" and k ~= "mark" and k ~= "link" then
local convertToEn = require("মডিউল:Numeral converter/খেলাঘর").convert
args[k] = convertToEn("en", v)
end
end
for k,v in pairs(args) do
if k ~= "label" and k ~= "mark" and k ~= "link" then
local convert_cordinationEn = require("মডিউল:Numeral converter/খেলাঘর").convert_cordination
args[k] = convert_cordinationEn(v)
end
end
---END: CHECK------------------------------------------------------------------
 
if args.useWikidata == nil then
args.useWikidata = true