"ഘടകം:Country extract" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.
Content deleted Content added
No edit summary
No edit summary
വരി 51: വരി 51:
-- ' for cote d'azur
-- ' for cote d'azur
-- 1-9 needed for Praha 10
-- 1-9 needed for Praha 10
match = mw.ustring.match(string, "(%u[%a' \.\,-]+([%a\.]|[]1-9]*))")
match = mw.ustring.match(string, "(%u[%a' \.\,-]+([%a\.]|[1-9]*))")
if (match) then
if (match) then
return match
return match

01:57, 9 ജനുവരി 2016-നു നിലവിലുണ്ടായിരുന്ന രൂപം


local p = {}
--
-- to enable us to replicate the current functioning of CountryAbbr and CountryAbbr2
-- We need to deal with 
-- 1 alternative names ISO 3166 should do that
-- 2 {{<name>}}
-- 3 [ [<name>] ]
-- 4 [ [<name>|<junk>] ]
-- 5 [ [image:flag of <country>.[svg|gif|png|jpg]|\d+px] ]
--

function p.extractCountry(frame)
   local string= mw.ustring.toNFC (frame.args[1])
   local match=nil;
   match = mw.ustring.match(string, "Flag of ([^\.]*)")
   if (match) then 
      return match
   end 
-- () for Cocos (Keeling) Islands
-- ' For  People's 
-- . for U.S. etc.
   match = mw.ustring.match(string, "(%u[%a\(\)\.' -]+)")
   if (match == "Image") then
       string = mw.ustring.gsub(string, match, "")
       match = mw.ustring.match(string, "[\|\[](%u[%a\(\)\.' -]+)")
   end
   if (match == "20px") then
       string = mw.ustring.gsub(string, match, "")
       match = mw.ustring.match(string, "\[(%u[%a\(\)\.' -]+)")
   end 
   if (match) then 
      return match
   end
   return  string
end

--[[ 


]]

function p.extractSubdivision(frame)
   local string= mw.ustring.toNFC (frame.args[1])
   local match=nil;
-- Needed for {{flag|Greenland}},
   match = mw.ustring.match(string, "Flag of ([^\.]*)")
   if (match) then 
      return match
   end 
-- . needed for Washington D.C. 
-- ' for cote d'azur
-- 1-9 needed for Praha 10
   match = mw.ustring.match(string, "(%u[%a' \.\,-]+([%a\.]|[1-9]*))")
   if (match) then 
      return match
   end
   return  string
end


return p
"https://ml.wikipedia.org/w/index.php?title=ഘടകം:Country_extract&oldid=2479414" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്