Jump to content
Main menu
Main menu
move to sidebar
hide
Pamaglibut
Pun Bulung
Pitatabnuan ning balen
Bayung mengayalili
Andyang sanung bulung
Saup
Bulung a makabukud
Maintun
Maintun
Appearance
Donasiun
Maglalang akawnt
Log in
Sariling kasangkapan
Donasiun
Maglalang akawnt
Log in
Pages for logged out editors
learn more
Deng ambag
Pamakisabi para keng IPing ini
Manalili
Module:CountryData
Add languages
Module
Pamisabi-sabi
English
Basan
Alilan ya ing pikuwanan
Lawen ya ing amlat
Kasangkapan
Tools
move to sidebar
hide
Actions
Basan
Alilan ya ing pikuwanan
Lawen ya ing amlat
General
Deng pakasuglung keti
Miyalilan a makaugne
Maglulan simpan (file)
Page information
Get shortened URL
Download QR code
Appearance
move to sidebar
hide
Babala:
Eka makalog-in. Ing kekang IP address mitala ya kening bulung ning amlat pamanalili.
Anti-spam check. Do
not
fill this in!
local p = {} local mostUsed = mw.loadData('Module:CountryData/summary') local function getcontents(frame,country,params) return frame:expandTemplate({title="Country data "..country;args=params}) end function p.getcachedtable(frame, country, params) country = mostUsed.redirects[country] or country if params and next(params) then return p.gettable(frame, country, params) end -- Uses mw.loadData to cache data for the most-used templates if mostUsed.pages[country] then local cache = mw.loadData('Module:CountryData/cache' .. mostUsed.pages[country]) if cache.data[country] then return cache.data[country] end end -- if not in cache return p.gettable(frame, country, params) end function p.gettable(frame,country,params) --Returns the parameters of a country data template as a Lua table --If not a valid data template, return empty table local bool, s = pcall(getcontents,frame,country,params or {}) if bool and (string.find(s,"^%{%{ *%{%{%{1") or string.find(s,"^%{%{safesubst: *%{%{%{1")) then --Replace parameter delimiters with arbitrary control characters --to avoid clashes if param values contain equals/pipe signs s = string.gsub(s,"|([^|=]-)=","\1\1%1\2") s = string.gsub(s,"}}%s*$","\1") --Loop over string and add params to table local part = {} for par in string.gmatch(s,"\1[^\1\2]-\2[^\1\2]-\1") do local k = string.match(par,"\1%s*(.-)%s*\2") local v = string.match(par,"\2%s*(.-)%s*\1") if v and not (v=="" and string.find(k,"^flag alias")) then part[k] = v end end return part else return {} end end function p.getalias(frame) --Returns a single parameter value from a data template local part = p.gettable(frame,frame.args[1]) if frame.args.variant then return tostring(part[frame.args[2].."-"..frame.args.variant] or part[frame.args[2]] or frame.args.def) else return tostring(part[frame.args[2]] or frame.args.def) end end function p.gettemplate(frame) --For testing, recreates the country data from the created Lua table --Get data table local data = p.gettable(frame,frame.args[1]) --Concatenate fields into a template-like string local out = "{{ {{{1}}}" for k,v in pairs(data) do out = out.."\n| "..k.." = "..v end return out.."\n}}" end return p
Sampulung (Summary):
Nung mag-save ka, mamayun kang itabili me at e mu ne bawian ing kekang ambag king lalam ning
Creative Commons Attribution-ShareAlike License 4.0
ampo ning
GFDL
. Mamayun kang kilalanan da ka deng talagamit a gagamit pasibayu kaniti (
re-users
), king paralan a e kulang king pamangabit hyperlink o URL king bulung nung nu ka manambag. Lon me ing
Terms of Use
para kareng detalle.
E taglus
Saup pamanalili
(mibusni ya king bayung awang)
Preview page with this template
Wikidata entities used in this page
Module:CountryData
: Sitelink, Description: en
Template a magagamit king bulung a ini:
Module:CountryData/doc
(
alilan/i-edit
)
Maintun
Maintun
Manalili
Module:CountryData
Add languages
Dagdagan ing pisasabian