মডিউল:অবস্থান মানচিত্র/খেলাঘর: সংশোধিত সংস্করণের মধ্যে পার্থক্য
বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
start fix requested at en:WT:Lua#Script error |
translate args when they are fetched; it seems translating all of them is best |
||
(একই ব্যবহারকারী দ্বারা সম্পাদিত ২টি মধ্যবর্তী সংশোধন দেখানো হচ্ছে না) | |||
৩ নং লাইন:
local p = {}
local
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
['০'] = '0',▼
['১'] = '1',▼
['২'] = '2',▼
['৩'] = '3',▼
['৪'] = '4',▼
['৫'] = '5',▼
['৬'] = '6',▼
['৭'] = '7',▼
['৮'] = '8',▼
['৯'] = '9',▼
})
:gsub(' *উত্তর', 'N')▼
:gsub(' *পূর্ব' , 'E')▼
:gsub(' *দক্ষিণ', 'S')▼
:gsub(' *পশ্চিম', 'W')▼
end▼
end▼
return args
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',
▲ })
▲ :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
▲ for k,v in pairs(args) do
▲ args[k] = convertToEn("en", v)
▲ end
▲ end
▲ end
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
if args.useWikidata == nil then
args.useWikidata = true
|