ဝီႇၶီႇၽီးတီးယႃး shnwiki https://shn.wikipedia.org/wiki/%E1%81%BC%E1%82%83%E1%82%88%E1%82%81%E1%80%B0%E1%80%9D%E1%80%BA%E1%82%81%E1%82%85%E1%81%B5%E1%80%BA%E1%82%88 MediaWiki 1.45.0-wmf.7 first-letter သိုဝ်ႇၶၢဝ်ႇ ၶိုၵ်ႉတွၼ်း ဢုပ်ႇၵုမ် ၽူႈၸႂ်ႉတိုဝ်း ဢုပ်ႇၵုမ် ၽူႈၸႂ်ႉတိုဝ်း ဝီႇၶီႇၽီးတီးယႃး ဢုပ်ႇၵုမ် ဝီႇၶီႇၽီးတီးယႃး ၾၢႆႇ ဢုပ်ႇၵုမ် ၾၢႆႇ မီႇတီႇယႃႇဝီႇၶီႇ ဢုပ်ႇၵုမ် မီႇတီႇယႃႇဝီႇၶီႇ ထႅမ်းပလဵတ်ႉ ဢုပ်ႇၵုမ် ထႅမ်းပလဵတ်ႉ လွင်ႈၸွႆႈထႅမ် ဢုပ်ႇၵုမ် လွင်ႈၸွႆႈထႅမ် ပိူင်ထၢၼ်ႈ ဢုပ်ႇၵုမ် ပိူင်ထၢၼ်ႈ ၵိူၼ်ႇတူ တွၼ်ႈဢုပ်ႇ ၵိူၼ်ႇတူ TimedText TimedText talk မေႃႇၵျူး ဢုပ်ႇၵုမ် မေႃႇၵျူး မေႃႇၵျူး:Side box 828 1068 112362 8341 2025-06-26T08:02:26Z Saimawnkham 5 112362 Scribunto text/plain local yesno = require('Module:Yesno') local p = {} local function makeData(args) local data = {} -- Main table classes data.classes = {} if yesno(args.metadata) ~= false then table.insert(data.classes, 'metadata') end if args.position and args.position:lower() == 'left' then table.insert(data.classes, 'side-box-left') else table.insert(data.classes, 'side-box-right') end if args.collapsible then table.insert(data.classes, 'mw-collapsible') if args.collapsible == "collapsed" then table.insert(data.classes, 'mw-collapsed') end data.collapsible = true end table.insert(data.classes, args.class) -- Image if args.image and args.image ~= 'none' then data.image = args.image end -- we have to check to see if a downstream use has plainlist like -- Template:Sister_project. also it's the default. wikitext is :( if args.textclass == 'plainlist' or not args.textclass then data.textclass = 'plainlist' data.plainlist_templatestyles = 'Plainlist/styles.css' else data.textclass = args.textclass end -- Copy over data that does not need adjusting local argsToCopy = { -- aria qualities 'role', 'labelledby', -- Styles 'style', 'textstyle', 'templatestyles', -- Above row 'above', 'abovestyle', -- Body row 'text', 'imageright', -- Below row 'below', } for i, key in ipairs(argsToCopy) do data[key] = args[key] end return data end local function renderSidebox(data) -- Renders the sidebox HTML. -- Table root local root = mw.html.create('div') root:attr('role', data.role) :attr('aria-labelledby', data.labelledby) :addClass('side-box') for i, class in ipairs(data.classes or {}) do root:addClass(class) end if data.style then root:cssText(data.style) end local frame = mw.getCurrentFrame() if data.plainlist_templatestyles then root:wikitext(frame:extensionTag{ name = 'templatestyles', args = { src = data.plainlist_templatestyles } }) end -- The "above" row if data.above then local above = root:newline():tag('div') above:addClass('side-box-abovebelow') :newline() :wikitext(data.above) if data.textstyle then above:cssText(data.textstyle) end if data.abovestyle then above:cssText(data.abovestyle) end end -- The body row local body = root:newline():tag('div') body:addClass('side-box-flex') :addClass(data.collapsible and 'mw-collapsible-content') :newline() if data.image then body:tag('div') :addClass('side-box-image') :wikitext(data.image) end local text = body:newline():tag('div') text:addClass('side-box-text') :addClass(data.textclass) if data.textstyle then text:cssText(data.textstyle) end text:wikitext(data.text) if data.imageright then body:newline():tag('div') :addClass('side-box-imageright') :wikitext(data.imageright) end -- The below row if data.below then local below = root:newline():tag('div') below :addClass('side-box-abovebelow') :wikitext(data.below) if data.textstyle then below:cssText(data.textstyle) end end root:newline() local templatestyles = '' if data.templatestyles then templatestyles = frame:extensionTag{ name = 'templatestyles', args = { src = data.templatestyles } } end return frame:extensionTag{ name = 'templatestyles', args = { src = 'Module:Side box/styles.css' } } .. templatestyles .. tostring(root) end function p._main(args) local data = makeData(args) return renderSidebox(data) end function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end return p 13mb9x4khy3x9kci53p03u6xw7fwg3p မေႃႇၵျူး:Catalog lookup link 828 17778 112379 38906 2025-06-26T08:13:35Z Saimawnkham 5 112379 Scribunto text/plain --[[ |1=, |2=, |3=, |4=, |5=, |6=, |7=, |8=, |9=: Optional unnamed parameters for 0 to 9 items to be listed. Whitespace is trimmed off both ends and the strings are urlencoded as if they were query strings. |article-link=: Optional Wikipedia article name to link to. |article-name=: Optional alternative text to be displayed for |article-link= link in front of catalog link. If not specified, |article-link= is used for display as well. If both parameters are not specified, the prefix is omitted completely. |article-suffix=: Optional symbol to be displayed after article name or link (f.e. ":"; omitted, if not defined). |link-prefix=: Optional prefix portion of url to external catalog item(s). |link-suffix=: Optional suffix portion of url to external catalog item(s). |item-prefix=: Optional text displayed in front of each external link (omitted, if not defined) |item-suffix=: Optional text displayed immediately after each external link (omitted, if not defined) |list-separator=: Optional alternative separator displayed between list items (default: ", ", if not specified). Whitespace must be encoded. |list-leadout=: Optional alternative leadout text displayed between the last two list items (f.e. "and", "or", "as well as", etc., default is the |list-separator= or ", ".) |leadout-suffix=: Optional alternative suffix text of the leadout (see |list-leadout=) displayed between the last two list items. This gets added in front of the last list item instead of the default whitespace which is added without this parameter. This may be necessary if |list-separator= is used not only to define the list separator but also parts of the item prefix (except for the first one). (At present, this is used only to cope with format oddities of the {{MR}} template.) new parameters that support access icons: |allowed_icons= – comma-separated list of keywords: free, limited, registration, subscription, none, all (default; 'all' implied when this parameter empty or omitted) the icons specified in the following parameters are checked agains the list in |allowed-icons=; not in the list? not displayed |url-access-all= – applies specified icon to all items in the list; accepted keywords: free, limited, registration, subscription; |url-accessn= – applies specified icon to item n of the list (the nth positional parameter); accepted keywords: free, limited, registration, subscription; ]] require('strict'); local getArgs = require ('Module:Arguments').getArgs; local lock_icons = { --icon classes are defined in Module:Citation/CS1/styles.css ['free'] = {'id-lock-free', 'Freely accessible'}, ['registration'] = {'id-lock-registration', 'Free registration required'}, ['limited'] = {'id-lock-limited', 'Free access subject to limited trial, subscription normally required'}, ['subscription'] = {'id-lock-subscription', 'Paid subscription required'}, } --[[--------------------------< I S _ S E T >------------------------------------------------------------------ Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string. ]] local function is_set( var ) return not (var == nil or var == ''); end --[=[-------------------------< M A K E _ L A B E L >---------------------------------------------------------- Makes a wikilinked or plain text label from arguments; when both link and display text is provided, makes a wikilink in the form [[L|D]]; if only link is provided, makes a wikilinked label in the form [[L]]; if only display is provided, makes a plain-text label; if neither are provided makes a label from suffix, returns an empty string else. ]=] local function make_label (link, display, suffix) local label = ''; if is_set (link) then if is_set (display) then label = table.concat ({'[[', link, '|', display, ']]'}); -- make [[L|D]] wikilinked label else label = table.concat ({'[[', link, ']]'}); -- make [[L]] wikilinked label end elseif is_set (display) then label = display; -- plain-text label end if is_set (label) then return table.concat ({label, suffix, '&nbsp;'}); -- assemble the complete label else return suffix; -- no space after suffix if no label end end --[[--------------------------< I C O N _ I N D E X _ G E T >-------------------------------------------------- returns index into lock_icons[] if value assigned to |url-access= or |url-access-all= is a valid icon selector (free, limited, registration, subscription) icon selection may be limited to a subset of the icons with: |allow_icons=<comma-separated list of allowed icons> <comma-separated list of allowed icons> may be any of the keywords: free, limited, registration, subscription, none, all keyword 'all' is default condition; 'all' is implied when |allowed=icons= is empty or omitted keyword 'none' for use with identifiers where icons are inappropriate (isbn, issn, oclc) Templates using this module should set: |allow_icons=free for most identifiers; |allow_icons=none for isbn, issn, oclc, etc |url-access= is alias of |url-access1= ]] local function icon_index_get (args, k) local icon; local param_name = (1 == k and is_set (args['url-access']) and 'url-access') or table.concat ({'url-access', k}); -- make an enumerated parameter name if is_set (args['url-access-all']) and lock_icons[args['url-access-all']] then -- if set and valid icon = args['url-access-all']; -- tentatively elseif is_set (args[param_name]) and lock_icons[args[param_name]] then -- if set and valid icon = args[param_name]; -- tentatively else return nil; -- neither |url-access-all= nor |url-accessn= set so return nil end if args['allow_icons'] and args['allow_icons']:find ('none') then -- if 'none' keyword is present return nil; -- icons display not allowed end if not is_set (args['allow_icons']) or args['allow_icons']:find ('all') or args['allow_icons']:find (icon) then --if all allowed or specified icon is allowed return icon; -- return selected icon as index into icon table end end --[[--------------------------< M A I N >---------------------------------------------------------------------- Template entrypoint to this module; arguments come primarily from the parent frame though in templates that use this module, |allowed-icons= is typically set, if needed, in the {{#invoke:}}. ]] local function main (frame) local args = getArgs (frame); local out_text = ''; if is_set(args[1]) then local result = {}; local label; local article_suffix = args['article-suffix'] or args['article-postfix'] or ''; local link_prefix = args['link-prefix'] or ''; local link_suffix = args['link-suffix'] or args['link-postfix'] or ''; local item_prefix = args['item-prefix'] or ''; local item_suffix = args['item-suffix'] or args['item-postfix'] or ''; local list_separator = args['list-separator'] or ', '; local leadout_suffix = args['leadout-suffix'] or args['leadout-postfix'] or ' '; local list_leadout; local icon_index; if is_set (args['list-leadout']) then list_leadout = table.concat ({ mw.ustring.gsub (args['list-leadout'], '^(%a)', ' %1'), -- insert leading space if first character is a letter leadout_suffix, }); else list_leadout = ''; end label = make_label (args['article-link'], args['article-name'], article_suffix); for k, item in ipairs (args) do -- for each of the positional parameters item = mw.text.trim (item); -- remove extraneous whitespace if is_set (link_prefix) then -- if there is link prefix... item = table.concat ({ -- create an external link item '[', -- open ext link markup link_prefix, -- url prefix mw.uri.encode (item), -- item is part of url link_suffix, -- url suffix ' ', -- required space between url and label item_prefix, -- label prefix item, -- item as label item_suffix, -- item suffix ']' -- close ext link markup }); icon_index = icon_index_get (args, k); -- set if icon specified and allowed for this item; nil else if icon_index then item = table.concat ({ -- add access icon markup to this item '<span class="', -- open the opening span tag; icon classes are defined in Module:Citation/CS1/styles.css lock_icons[icon_index][1], -- add the appropriate lock icon class '" title="', -- and the title attribute lock_icons[icon_index][2], -- for an appropriate tool tip '">', -- close the opening span tag item, '</span>', -- and close the span }); end else item = table.concat ({ -- create an unlinked item item_prefix, -- label prefix item, -- item as label item_suffix, -- item suffix }); end table.insert (result, item); -- add the item to the result list end out_text = frame:callParserFunction('#tag', {'templatestyles', '', src=table.concat({ 'Module:Citation/CS1', mw.ustring.match(frame:getTitle(), '/sandbox$') or '', '/styles.css', })}); if is_set (args['list-leadout']) then out_text = table.concat ({out_text, label, mw.text.listToText (result, list_separator, list_leadout)}); else out_text = table.concat ({out_text, label, table.concat (result, list_separator)}); end end --is_set (args[1]) return out_text end return {main = main}; 3wi2z194vfo9qi53gxesxdd6p3j8qt3 ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ 0 18022 112351 64453 2025-06-26T07:55:58Z Saimawnkham 5 Saimawnkham ၶၢႆႉယဝ်ႉ ၼႃႈလိၵ်ႈ [[ၼႄႇတႃႇလႅၼ်ႇ တီႈ ၶႃႇရိပ်ႈပီႇယၼ်ႇ]] တေႃႇ [[ၶႃႇရိပ်ႈပီႇယၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]]: ဢၢပ်ႉတဵတ်ႉၸိုဝ်ႈ 64453 wikitext text/x-wiki {{Infobox dependency | name = ၼႄႇတႃႇလႅၼ်ႇ တီႈ ၶႃႇရိပ်ႈပီႇယၼ်ႇ | native_name = {{native name|nl|Caribisch Nederland}} | settlement_type = {{nowrap|Overseas region of the [[Netherlands]]}} | image_flag = Flag of the Netherlands.svg | flag_link = Flag of the Netherlands | image_seal = | seal_link = | anthem = {{native name|nl|{{noitalic|"}}[[Wilhelmus van Nassouwe]]{{noitalic|"}}|link=on}} <br />({{lang-en|"William of Nassau"}})<br /><div style="display:inline-block;margin-top:0.4em;">[[File:United States Navy Band - Het Wilhelmus (tempo corrected).ogg|Het Wilhelmus]]</div> | image_map = BES islands location map.svg | map_caption = Location of the Caribbean Netherlands (green and circled). From left to right: [[Bonaire]], [[Saba (island)|Saba]], and [[Sint Eustatius]] | elevation_max_m = 887 | elevation_max_footnotes = <br />([[Mount Scenery]]) | demographics_type1 = | demographics1_title1 = | demographics1_info1 = | demographics1_title2 = | demographics1_info2 = | subdivision_type = Country | subdivision_name = [[Netherlands]] | subdivision_type1 = Special municipalities | subdivision_name1 = {{plainlist| * [[Bonaire]] * [[Sint Eustatius]] * [[Saba (island)|Saba]] }} | established_title = Incorporated into the&nbsp;Netherlands | established_date = 10 October 2010 ([[Dissolution of the Netherlands Antilles|dissolution of the {{nowrap|Netherlands Antilles}}]]) | government_footnotes = | leader_title1 = [[Monarchy of the Netherlands|Monarch]] | leader_name1 = [[Willem-Alexander of the Netherlands|Willem-Alexander]] | leader_title2 = [[Lieutenant governor|Lt.&nbsp;Governors]]&nbsp;(see [[Politics of the Netherlands]]) | leader_name2 = {{plainlist| * [[Edison Rijna]] (Bonaire) * [[Alida Francis]] {{nowrap|(Sint Eustatius)}}<ref>{{Cite web|url=https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius|title=Benoeming regeringscommissaris en plaatsvervanger Sint Eustatius|access-date=19 December 2021|website=Government of the Netherlands|date=18 June 2021|language=nl|archive-date=28 May 2023|archive-url=https://web.archive.org/web/20230528224336/https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius}}</ref> * [[Jonathan G. A. Johnson|Jonathan Johnson]] (Saba) }} | leader_title3=National Rep. | leader_name3=Jan Helmond | area_total_km2 = | area_footnotes = | population_total = | population_as_of = | population_footnotes = | population_density_km2 = 77 | timezone = [[Atlantic Standard Time|AST]] | utc_offset = −4 | coordinates = {{Coord|12|11|N|68|14|W|display=inline}} | area_code_type = | area_code = | blank_name_sec1 = Currency | blank_info_sec1 = {{nowrap|[[United States dollar]]}} ($) ([[ISO 4217|USD]])<ref>{{cite web |url=http://wetten.overheid.nl/BWBR0028551 |title=Wet geldstelsel BES |publisher=Dutch government |date=30 September 2010 |access-date=11 January 2014}}</ref> | blank_name_sec2 = [[Country code top-level domain|Internet TLD]] | blank_info_sec2 = {{ubl|[[.nl]]|[[.bq]]{{efn|.bq is designated, but not in use, for the Caribbean Netherlands.<ref>{{cite web |url=https://www.iso.org/obp/ui/#iso:code:3166:BQ |title=BQ – Bonaire, Sint Eustatius and Saba |publisher=[[International Organization for Standardization|ISO]] |access-date=29 August 2014 |url-status=live |archive-url=https://web.archive.org/web/20160617031837/https://www.iso.org/obp/ui/#iso:code:3166:BQ |archive-date=17 June 2016 }}</ref><ref>{{cite web |url=https://www.iana.org/domains/root/db/bq.html |title=Delegation Record for .BQ |publisher=[[Internet Assigned Numbers Authority|IANA]] |date=20 December 2010 |access-date=30 December 2010 |url-status=live |archive-url=https://www.webcitation.org/69X9PGdch?url=https://www.iana.org/domains/root/db/bq.html |archive-date=30 July 2012 }}</ref> Like the rest of the Netherlands, .nl is primarily in use.}}}} | iso_code = [[ISO 3166-2:BQ|BQ]], [[ISO 3166-2:NL|NL-BQ1, NL-BQ2, NL-BQ3]] | population_estimate_year = 2022 | population_estimate = 27,726<ref>{{Cite web |title=The Caribbean Netherlands in Numbers 2022: How has the population evolved over the past decade? |url=https://longreads.cbs.nl/the-caribbean-netherlands-in-numbers-2022/how-has-the-population-evolved-over-the-past-decade |archive-url=https://web.archive.org/web/20230206121607/https://longreads.cbs.nl/the-caribbean-netherlands-in-numbers-2022/how-has-the-population-evolved-over-the-past-decade/ |archive-date=2023-02-06 |website=cbs.nl |publisher=Centraal Bureau voor de Statistiek}}</ref>|area_km2=322<ref name="auto">{{Cite web|url=https://www.rijksoverheid.nl/onderwerpen/caribische-deel-van-het-koninkrijk/vraag-en-antwoord/waaruit-bestaat-het-koninkrijk-der-nederlanden|title=Waaruit bestaat het Koninkrijk der Nederlanden?|first=Ministerie van Algemene|last=Zaken|date=19 May 2015|website=Rijksoverheid.nl}}</ref> | official_languages = [[Dutch language|Dutch]] | recognised_regional_languages={{plainlist| * [[English language|English]] (Saba, {{nowrap|St. Eustatius}}) * [[Papiamentu]] (Bonaire)<ref name=languages>{{cite web |url=http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal%2Bin%2Bhet%2Bbestuurlijk%2Bverkeer/geldigheidsdatum_14-10-2012 |title=Invoeringswet openbare lichamen Bonaire, Sint Eustatius en Saba |language=nl |publisher=wetten.nl |access-date=2012-10-14 |url-status=live |archive-url=https://web.archive.org/web/20150117173755/http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal+in+het+bestuurlijk+verkeer/geldigheidsdatum_14-10-2012 |archive-date=17 January 2015 }}</ref> | calling_code = [[+599]] ([[Telephone numbers in the Caribbean Netherlands]]) | GDP_nominal = US$583,000,000<ref>{{Cite web|last=Netherlands|first=Statistics|title=Caribbean Netherlands; gross domestic product (GDP) 2012-2017|url=http://www.cbs.nl/en-gb/figures/detail/83776ENG|access-date=2021-08-09|website=Statistics Netherlands|language=en-GB}}</ref> | largest_settlement = [[Kralendijk]] }} }} ==မၢႆတွင်း== {{notelist}} ==ၽိုၼ်ဢိင်== {{Reflist|group=lower-alpha}} 4s33q9aezvpn97x4y4etk59j3hzxjm8 112353 112351 2025-06-26T07:56:49Z Saimawnkham 5 ဢမ်ႇဢွၵ်ႇယၢၼ် လွင်ႈပိၼ်ႇၽၢႆႇသေ Saimawnkham ၶၢႆႉဝႆႉ ၼႃႈလိၵ်ႈ [[ၶႃႇရိပ်ႈပီႇယၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]] တေႃႇ [[ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 64453 wikitext text/x-wiki {{Infobox dependency | name = ၼႄႇတႃႇလႅၼ်ႇ တီႈ ၶႃႇရိပ်ႈပီႇယၼ်ႇ | native_name = {{native name|nl|Caribisch Nederland}} | settlement_type = {{nowrap|Overseas region of the [[Netherlands]]}} | image_flag = Flag of the Netherlands.svg | flag_link = Flag of the Netherlands | image_seal = | seal_link = | anthem = {{native name|nl|{{noitalic|"}}[[Wilhelmus van Nassouwe]]{{noitalic|"}}|link=on}} <br />({{lang-en|"William of Nassau"}})<br /><div style="display:inline-block;margin-top:0.4em;">[[File:United States Navy Band - Het Wilhelmus (tempo corrected).ogg|Het Wilhelmus]]</div> | image_map = BES islands location map.svg | map_caption = Location of the Caribbean Netherlands (green and circled). From left to right: [[Bonaire]], [[Saba (island)|Saba]], and [[Sint Eustatius]] | elevation_max_m = 887 | elevation_max_footnotes = <br />([[Mount Scenery]]) | demographics_type1 = | demographics1_title1 = | demographics1_info1 = | demographics1_title2 = | demographics1_info2 = | subdivision_type = Country | subdivision_name = [[Netherlands]] | subdivision_type1 = Special municipalities | subdivision_name1 = {{plainlist| * [[Bonaire]] * [[Sint Eustatius]] * [[Saba (island)|Saba]] }} | established_title = Incorporated into the&nbsp;Netherlands | established_date = 10 October 2010 ([[Dissolution of the Netherlands Antilles|dissolution of the {{nowrap|Netherlands Antilles}}]]) | government_footnotes = | leader_title1 = [[Monarchy of the Netherlands|Monarch]] | leader_name1 = [[Willem-Alexander of the Netherlands|Willem-Alexander]] | leader_title2 = [[Lieutenant governor|Lt.&nbsp;Governors]]&nbsp;(see [[Politics of the Netherlands]]) | leader_name2 = {{plainlist| * [[Edison Rijna]] (Bonaire) * [[Alida Francis]] {{nowrap|(Sint Eustatius)}}<ref>{{Cite web|url=https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius|title=Benoeming regeringscommissaris en plaatsvervanger Sint Eustatius|access-date=19 December 2021|website=Government of the Netherlands|date=18 June 2021|language=nl|archive-date=28 May 2023|archive-url=https://web.archive.org/web/20230528224336/https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius}}</ref> * [[Jonathan G. A. Johnson|Jonathan Johnson]] (Saba) }} | leader_title3=National Rep. | leader_name3=Jan Helmond | area_total_km2 = | area_footnotes = | population_total = | population_as_of = | population_footnotes = | population_density_km2 = 77 | timezone = [[Atlantic Standard Time|AST]] | utc_offset = −4 | coordinates = {{Coord|12|11|N|68|14|W|display=inline}} | area_code_type = | area_code = | blank_name_sec1 = Currency | blank_info_sec1 = {{nowrap|[[United States dollar]]}} ($) ([[ISO 4217|USD]])<ref>{{cite web |url=http://wetten.overheid.nl/BWBR0028551 |title=Wet geldstelsel BES |publisher=Dutch government |date=30 September 2010 |access-date=11 January 2014}}</ref> | blank_name_sec2 = [[Country code top-level domain|Internet TLD]] | blank_info_sec2 = {{ubl|[[.nl]]|[[.bq]]{{efn|.bq is designated, but not in use, for the Caribbean Netherlands.<ref>{{cite web |url=https://www.iso.org/obp/ui/#iso:code:3166:BQ |title=BQ – Bonaire, Sint Eustatius and Saba |publisher=[[International Organization for Standardization|ISO]] |access-date=29 August 2014 |url-status=live |archive-url=https://web.archive.org/web/20160617031837/https://www.iso.org/obp/ui/#iso:code:3166:BQ |archive-date=17 June 2016 }}</ref><ref>{{cite web |url=https://www.iana.org/domains/root/db/bq.html |title=Delegation Record for .BQ |publisher=[[Internet Assigned Numbers Authority|IANA]] |date=20 December 2010 |access-date=30 December 2010 |url-status=live |archive-url=https://www.webcitation.org/69X9PGdch?url=https://www.iana.org/domains/root/db/bq.html |archive-date=30 July 2012 }}</ref> Like the rest of the Netherlands, .nl is primarily in use.}}}} | iso_code = [[ISO 3166-2:BQ|BQ]], [[ISO 3166-2:NL|NL-BQ1, NL-BQ2, NL-BQ3]] | population_estimate_year = 2022 | population_estimate = 27,726<ref>{{Cite web |title=The Caribbean Netherlands in Numbers 2022: How has the population evolved over the past decade? |url=https://longreads.cbs.nl/the-caribbean-netherlands-in-numbers-2022/how-has-the-population-evolved-over-the-past-decade |archive-url=https://web.archive.org/web/20230206121607/https://longreads.cbs.nl/the-caribbean-netherlands-in-numbers-2022/how-has-the-population-evolved-over-the-past-decade/ |archive-date=2023-02-06 |website=cbs.nl |publisher=Centraal Bureau voor de Statistiek}}</ref>|area_km2=322<ref name="auto">{{Cite web|url=https://www.rijksoverheid.nl/onderwerpen/caribische-deel-van-het-koninkrijk/vraag-en-antwoord/waaruit-bestaat-het-koninkrijk-der-nederlanden|title=Waaruit bestaat het Koninkrijk der Nederlanden?|first=Ministerie van Algemene|last=Zaken|date=19 May 2015|website=Rijksoverheid.nl}}</ref> | official_languages = [[Dutch language|Dutch]] | recognised_regional_languages={{plainlist| * [[English language|English]] (Saba, {{nowrap|St. Eustatius}}) * [[Papiamentu]] (Bonaire)<ref name=languages>{{cite web |url=http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal%2Bin%2Bhet%2Bbestuurlijk%2Bverkeer/geldigheidsdatum_14-10-2012 |title=Invoeringswet openbare lichamen Bonaire, Sint Eustatius en Saba |language=nl |publisher=wetten.nl |access-date=2012-10-14 |url-status=live |archive-url=https://web.archive.org/web/20150117173755/http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal+in+het+bestuurlijk+verkeer/geldigheidsdatum_14-10-2012 |archive-date=17 January 2015 }}</ref> | calling_code = [[+599]] ([[Telephone numbers in the Caribbean Netherlands]]) | GDP_nominal = US$583,000,000<ref>{{Cite web|last=Netherlands|first=Statistics|title=Caribbean Netherlands; gross domestic product (GDP) 2012-2017|url=http://www.cbs.nl/en-gb/figures/detail/83776ENG|access-date=2021-08-09|website=Statistics Netherlands|language=en-GB}}</ref> | largest_settlement = [[Kralendijk]] }} }} ==မၢႆတွင်း== {{notelist}} ==ၽိုၼ်ဢိင်== {{Reflist|group=lower-alpha}} 4s33q9aezvpn97x4y4etk59j3hzxjm8 112354 112353 2025-06-26T07:57:49Z Saimawnkham 5 ဢၢပ်ႉတဵတ်ႉ ထႅမ်းပလဵတ်ႉ 112354 wikitext text/x-wiki {{Infobox dependency | name = ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ | native_name = {{native name|nl|Caribisch Nederland}} | settlement_type = {{nowrap|Overseas region of the [[Netherlands]]}} | image_flag = Flag of the Netherlands.svg | flag_link = Flag of the Netherlands | image_seal = [[File:State coat of arms of the Netherlands.svg|110px]] | seal_link =Coat of arms of the Netherlands | anthem = {{native name|nl|{{noitalic|"}}[[Wilhelmus van Nassouwe]]{{noitalic|"}}|link=on}} <br />({{langx|en|"William of Nassau"}})<br /><div style="display:inline-block;margin-top:0.4em;">[[File:United States Navy Band - Het Wilhelmus (tempo corrected).ogg|Het Wilhelmus]]</div> | image_map = BES islands location map.svg | map_caption = Location of the Caribbean Netherlands (green and circled). From left to right: [[Bonaire]], [[Saba (island)|Saba]], and [[Sint Eustatius]] | elevation_max_m = 887 | elevation_max_footnotes = <br />([[Mount Scenery]]) | demographics_type1 = | demographics1_title1 = | demographics1_info1 = | demographics1_title2 = | demographics1_info2 = | subdivision_type = Country | subdivision_name = [[Netherlands]] | subdivision_type1 = Special municipalities | subdivision_name1 = {{plainlist| * [[Bonaire]] * [[Sint Eustatius]] * [[Saba (island)|Saba]] }} | established_title = Incorporated into the&nbsp;Netherlands | established_date = 10 October 2010 ([[Dissolution of the Netherlands Antilles|dissolution of the {{nowrap|Netherlands Antilles}}]]) | government_footnotes = | leader_title1 = [[Monarchy of the Netherlands|Monarch]] | leader_name1 = [[Willem-Alexander of the Netherlands|Willem-Alexander]] | leader_title2 = [[Lieutenant governor|Lt.&nbsp;Governors]]&nbsp;(see [[Politics of the Netherlands]]) | leader_name2 = {{plainlist| * [[John Soliano]] (Bonaire) * [[Alida Francis]] {{nowrap|(Sint Eustatius)}}<ref>{{Cite web|url=https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius|title=Benoeming regeringscommissaris en plaatsvervanger Sint Eustatius|access-date=19 December 2021|website=Government of the Netherlands|date=18 June 2021|language=nl|archive-date=28 May 2023|archive-url=https://web.archive.org/web/20230528224336/https://www.rijksoverheid.nl/actueel/nieuws/2021/06/18/benoeming-regeringscommissaris-en-plaatsvervanger-sint-eustatius|url-status=dead}}</ref> * [[Jonathan G. A. Johnson|Jonathan Johnson]] (Saba) }} | leader_title3=National Rep. | leader_name3=Jan Helmond | area_total_km2 = | area_footnotes = | population_total = | population_as_of = | population_footnotes = | population_density_km2 = 77 | timezone = [[Atlantic Standard Time|AST]] | utc_offset = −4 | coordinates = {{Coord|12|11|N|68|14|W|display=inline}} | area_code_type = | area_code = | blank_name_sec1 = Currency | blank_info_sec1 = {{nowrap|[[United States dollar]]}} ($) ([[ISO 4217|USD]])<ref>{{cite web |url=http://wetten.overheid.nl/BWBR0028551 |title=Wet geldstelsel BES |publisher=Dutch government |date=30 September 2010 |access-date=11 January 2014}}</ref> | blank_name_sec2 = [[Country code top-level domain|Internet TLD]] | blank_info_sec2 = {{ubl|[[.nl]]|[[.bq]]{{efn|.bq is designated, but not in use, for the Caribbean Netherlands.<ref>{{cite web |url=https://www.iso.org/obp/ui/#iso:code:3166:BQ |title=BQ – Bonaire, Sint Eustatius and Saba |publisher=[[International Organization for Standardization|ISO]] |access-date=29 August 2014 |url-status=live |archive-url=https://web.archive.org/web/20160617031837/https://www.iso.org/obp/ui/#iso:code:3166:BQ |archive-date=17 June 2016}}</ref><ref>{{cite web |url=https://www.iana.org/domains/root/db/bq.html |title=Delegation Record for .BQ |publisher=[[Internet Assigned Numbers Authority|IANA]] |date=20 December 2010 |access-date=30 December 2010 |url-status=live |archive-url=https://web.archive.org/web/20110113142408/https://www.iana.org/domains/root/db/bq.html |archive-date=13 January 2011 }}</ref> Like the rest of the Netherlands, .nl is primarily in use.}} }} | iso_code = [[ISO 3166-2:BQ|BQ]], [[ISO 3166-2:NL|NL-BQ1, NL-BQ2, NL-BQ3]] | population_estimate_year = 2025 | population_estimate = 31,980<ref>{{Cite web |title=Population of The Caribbean Netherlands up by nearly 1.6 thousand in 2024|url=https://www.cbs.nl/en-gb/news/2025/21/population-of-the-caribbean-netherlands-up-by-nearly-1-6-thousand-in-2024#:~:text=Population%20of%20the%20Caribbean%20Netherlands%20up%20by%20nearly%201.6%20thousand%20in%202024,-19/05/2025&text=On%201%20January%202025%2C%20the%20population%20of%20Bonaire%20stood%20at,percent)%20than%20one%20year%20previously.}}</ref> | GDP_nominal = US$725,000,000<ref><!--Caribbean Netherlands; gross domestic product (GDP)-->{{cite Q|Q131100722}}</ref> | GDP_nominal_year = 2022 |area_km2=322<ref name="auto">{{Cite web|url=https://www.rijksoverheid.nl/onderwerpen/caribische-deel-van-het-koninkrijk/vraag-en-antwoord/waaruit-bestaat-het-koninkrijk-der-nederlanden|title=Waaruit bestaat het Koninkrijk der Nederlanden?|first=Ministerie van Algemene|last=Zaken|date=19 May 2015|website=Rijksoverheid.nl}}</ref> | official_languages = [[Dutch language|Dutch]] | recognised_regional_languages={{plainlist| * [[English language|English]] (Saba, {{nowrap|St. Eustatius}}) * [[Papiamentu]] (Bonaire)<ref name=languages>{{cite web |url=http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal%2Bin%2Bhet%2Bbestuurlijk%2Bverkeer/geldigheidsdatum_14-10-2012 |title=Invoeringswet openbare lichamen Bonaire, Sint Eustatius en Saba |language=nl |publisher=wetten.nl |access-date=2012-10-14 |url-status=live |archive-url=https://web.archive.org/web/20150117173755/http://wetten.overheid.nl/BWBR0028063/tekst_bevat_taal+in+het+bestuurlijk+verkeer/geldigheidsdatum_14-10-2012 |archive-date=17 January 2015 }}</ref> | calling_code = [[+599]] ([[Telephone numbers in the Caribbean Netherlands]]) | largest_settlement = [[Kralendijk]] }} |seal_type=Coat of arms}} ==မၢႆတွင်း== {{notelist}} ==ၽိုၼ်ဢိင်== {{Reflist|group=lower-alpha}} enjf5i2mrrlv3c17asv8dens6ks19dx ၵုၼ်ႁိူတ်ႉ လႄႈ မူႇၵုၼ်မႅၵ်ႇတေႃႇၼႄႇ 0 18502 112386 40089 2025-06-26T09:14:13Z Saimawnkham 5 ဢမ်ႇဢွၵ်ႇယၢၼ် လွင်ႈပိၼ်ႇၽၢႆႇသေ Saimawnkham ၶၢႆႉဝႆႉ ၼႃႈလိၵ်ႈ [[မူႇၵုၼ် ႁိူတ်ႉ လႄႈ မူႇၵုၼ် မႅၵ်ႇတေႃႇၼႄႇ]] တေႃႇ [[ၵုၼ် ႁိူတ်ႉ လႄႈ မူႇၵုၼ် မႅၵ်ႇတေႃႇၼႄႇ]]: ဢၢပ်ႉတဵတ်ႉၸိုဝ်ႈ 40089 wikitext text/x-wiki {{Infobox islands |name = ၼႃႈလိၼ် {{nowr|မူႇၵုၼ် ႁိူတ်ႉ လႄႈ မႅၵ်ႇတေႃႇၼႄႇ}} |image_name = ISS018-E-038182 lrg.jpg |image_caption = Satellite image of the southern tip of Heard Island. [[Cape Arkona (Heard Island)|Cape Arkona]] is seen on the left side of the image, with [[Lied Glacier]] just above and [[Gotley Glacier]] just below. [[Big Ben (Heard Island)|Big Ben Volcano]] and [[Mawson Peak]] are seen at the lower right side of the image. |map_image = Australia in its region (Heard Island and McDonald Islands special).svg |map_caption = |location = [[Indian Ocean]] |total_islands = |major_islands = 2 |area_km2 = 368 |highest_mount = [[Mawson Peak]] |elevation_m = 2745 |population = Uninhabited |population_as_of = 2011 |country = {{flag|Australia}} |module = {{Infobox UNESCO World Heritage Site|child=yes |ID = 577 |Criteria = Natural: viii, ix |Year = 1997 |Area = 658,903 ha}} }} ==ၽိုၼ်ဢိင်== {{Reflist}} 9y4d2opjove2qqlvt9o1mr67t0dijet 112387 112386 2025-06-26T09:14:54Z Saimawnkham 5 ဢမ်ႇဢွၵ်ႇယၢၼ် လွင်ႈပိၼ်ႇၽၢႆႇသေ Saimawnkham ၶၢႆႉဝႆႉ ၼႃႈလိၵ်ႈ [[ၵုၼ် ႁိူတ်ႉ လႄႈ မူႇၵုၼ် မႅၵ်ႇတေႃႇၼႄႇ]] တေႃႇ [[ၵုၼ်ႁိူတ်ႉ လႄႈ မူႇၵုၼ်မႅၵ်ႇတေႃႇၼႄႇ]]: ဢၢပ်ႉတဵတ်ႉၸိုဝ်ႈ 40089 wikitext text/x-wiki {{Infobox islands |name = ၼႃႈလိၼ် {{nowr|မူႇၵုၼ် ႁိူတ်ႉ လႄႈ မႅၵ်ႇတေႃႇၼႄႇ}} |image_name = ISS018-E-038182 lrg.jpg |image_caption = Satellite image of the southern tip of Heard Island. [[Cape Arkona (Heard Island)|Cape Arkona]] is seen on the left side of the image, with [[Lied Glacier]] just above and [[Gotley Glacier]] just below. [[Big Ben (Heard Island)|Big Ben Volcano]] and [[Mawson Peak]] are seen at the lower right side of the image. |map_image = Australia in its region (Heard Island and McDonald Islands special).svg |map_caption = |location = [[Indian Ocean]] |total_islands = |major_islands = 2 |area_km2 = 368 |highest_mount = [[Mawson Peak]] |elevation_m = 2745 |population = Uninhabited |population_as_of = 2011 |country = {{flag|Australia}} |module = {{Infobox UNESCO World Heritage Site|child=yes |ID = 577 |Criteria = Natural: viii, ix |Year = 1997 |Area = 658,903 ha}} }} ==ၽိုၼ်ဢိင်== {{Reflist}} 9y4d2opjove2qqlvt9o1mr67t0dijet 112388 112387 2025-06-26T09:15:14Z Saimawnkham 5 112388 wikitext text/x-wiki {{Infobox islands |name = ၼႃႈလိၼ် {{nowr|ၵုၼ်ႁိူတ်ႉ လႄႈ မူႇၵုၼ်မႅၵ်ႇတေႃႇၼႄႇ}} |image_name = ISS018-E-038182 lrg.jpg |image_caption = Satellite image of the southern tip of Heard Island. [[Cape Arkona (Heard Island)|Cape Arkona]] is seen on the left side of the image, with [[Lied Glacier]] just above and [[Gotley Glacier]] just below. [[Big Ben (Heard Island)|Big Ben Volcano]] and [[Mawson Peak]] are seen at the lower right side of the image. |map_image = Australia in its region (Heard Island and McDonald Islands special).svg |map_caption = |location = [[Indian Ocean]] |total_islands = |major_islands = 2 |area_km2 = 368 |highest_mount = [[Mawson Peak]] |elevation_m = 2745 |population = Uninhabited |population_as_of = 2011 |country = {{flag|Australia}} |module = {{Infobox UNESCO World Heritage Site|child=yes |ID = 577 |Criteria = Natural: viii, ix |Year = 1997 |Area = 658,903 ha}} }} ==ၽိုၼ်ဢိင်== {{Reflist}} ocegk5nlwiwdhk1vcxim8noydxzbuf9 မေႃႇၵျူး:WikidataIB 828 19131 112365 41114 2025-06-26T08:04:45Z Saimawnkham 5 112365 Scribunto text/plain -- Version: 2023-07-10 -- Module to implement use of a blacklist and whitelist for infobox fields -- Can take a named parameter |qid which is the Wikidata ID for the article -- if not supplied, it will use the Wikidata ID associated with the current page. -- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances -- Fields in whitelist return local value if it exists or the Wikidata value otherwise -- The name of the field that this function is called from is passed in named parameter |name -- The name is compulsory when blacklist or whitelist is used, -- so the module returns nil if it is not supplied. -- blacklist is passed in named parameter |suppressfields (or |spf) -- whitelist is passed in named parameter |fetchwikidata (or |fwd) require("strict") local p = {} local cdate -- initialise as nil and only load _complex_date function if needed -- Module:Complex date is loaded lazily and has the following dependencies: -- Module:Calendar -- Module:ISOdate -- Module:DateI18n -- Module:I18n/complex date -- Module:Ordinal -- Module:I18n/ordinal -- Module:Yesno -- Module:Formatnum -- Module:Linguistic -- -- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times, -- is needed to use Module:Complex date which seemingly requires date precision as a string. -- It would work better if only the authors of the mediawiki page could spell 'millennium'. local dp = { [6] = "millennium", [7] = "century", [8] = "decade", [9] = "year", [10] = "month", [11] = "day", } local i18n = { ["errors"] = { ["property-not-found"] = "Property not found.", ["No property supplied"] = "No property supplied", ["entity-not-found"] = "Wikidata entity not found.", ["unknown-claim-type"] = "Unknown claim type.", ["unknown-entity-type"] = "Unknown entity type.", ["qualifier-not-found"] = "Qualifier not found.", ["site-not-found"] = "Wikimedia project not found.", ["labels-not-found"] = "No labels found.", ["descriptions-not-found"] = "No descriptions found.", ["aliases-not-found"] = "No aliases found.", ["unknown-datetime-format"] = "Unknown datetime format.", ["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia", ["dab-page"] = " (dab)", }, ["months"] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }, ["century"] = "century", ["BC"] = "BC", ["BCE"] = "BCE", ["ordinal"] = { [1] = "st", [2] = "nd", [3] = "rd", ["default"] = "th" }, ["filespace"] = "File", ["Unknown"] = "Unknown", ["NaN"] = "Not a number", -- set the following to the name of a tracking category, -- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable: ["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]", ["editonwikidata"] = "Edit this on Wikidata", ["latestdatequalifier"] = function (date) return "before " .. date end, -- some languages, e.g. Bosnian use a period as a suffix after each number in a date ["datenumbersuffix"] = "", ["list separator"] = ", ", ["multipliers"] = { [0] = "", [3] = " thousand", [6] = " million", [9] = " billion", [12] = " trillion", } } -- This allows an internationisation module to override the above table if 'en' ~= mw.getContentLanguage():getCode() then require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n) end -- This piece of html implements a collapsible container. Check the classes exist on your wiki. local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">' -- Some items should not be linked. -- Each wiki can create a list of those in Module:WikidataIB/nolinks -- It should return a table called itemsindex, containing true for each item not to be linked local donotlink = {} local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks") if nolinks_exists then donotlink = nolinks.itemsindex end -- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted. -- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31), -- which allows this module to identify the values that should be formatted. -- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or '' local formats = {} local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats") if titleformats_exists then formats = titleformats.formats end ------------------------------------------------------------------------------- -- Private functions ------------------------------------------------------------------------------- -- ------------------------------------------------------------------------------- -- makeOrdinal needs to be internationalised along with the above: -- takes cardinal number as a numeric and returns the ordinal as a string -- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local makeOrdinal = function(cardinal) local ordsuffix = i18n.ordinal.default if cardinal % 10 == 1 then ordsuffix = i18n.ordinal[1] elseif cardinal % 10 == 2 then ordsuffix = i18n.ordinal[2] elseif cardinal % 10 == 3 then ordsuffix = i18n.ordinal[3] end -- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th' -- similarly for 12 and 13, etc. if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then ordsuffix = i18n.ordinal.default end return tostring(cardinal) .. ordsuffix end ------------------------------------------------------------------------------- -- findLang takes a "langcode" parameter if supplied and valid -- otherwise it tries to create it from the user's set language ({{int:lang}}) -- failing that it uses the wiki's content language. -- It returns a language object ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local findLang = function(langcode) local langobj langcode = mw.text.trim(langcode or "") if mw.language.isKnownLanguageTag(langcode) then langobj = mw.language.new( langcode ) else langcode = mw.getCurrentFrame():callParserFunction('int', {'lang'}) if mw.language.isKnownLanguageTag(langcode) then langobj = mw.language.new( langcode ) else langobj = mw.language.getContentLanguage() end end return langobj end ------------------------------------------------------------------------------- -- _getItemLangCode takes a qid parameter (using the current page's qid if blank) -- If the item for that qid has property country (P17) it looks at the first preferred value -- If the country has an official language (P37), it looks at the first preferred value -- If that official language has a language code (P424), it returns the first preferred value -- Otherwise it returns nothing. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local _getItemLangCode = function(qid) qid = mw.text.trim(qid or ""):upper() if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return end local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1] if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end local qid17 = prop17.mainsnak.datavalue.value.id local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1] if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end local qid37 = prop37.mainsnak.datavalue.value.id local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1] if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end return prop424.mainsnak.datavalue.value end ------------------------------------------------------------------------------- -- roundto takes a number (x) -- and returns it rounded to (sf) significant figures ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local roundto = function(x, sf) if x == 0 then return 0 end local s = 1 if x < 0 then x = -x s = -1 end if sf < 1 then sf = 1 end local p = 10 ^ (math.floor(math.log10(x)) - sf + 1) x = math.floor(x / p + 0.5) * p * s -- if it's integral, cast to an integer: if x == math.floor(x) then x = math.floor(x) end return x end ------------------------------------------------------------------------------- -- decimalToDMS takes a decimal degrees (x) with precision (p) -- and returns degrees/minutes/seconds according to the precision ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local decimalToDMS = function(x, p) -- if p is not supplied, use a precision around 0.1 seconds if not tonumber(p) then p = 1e-4 end local d = math.floor(x) local ms = (x - d) * 60 if p > 0.5 then -- precision is > 1/2 a degree if ms > 30 then d = d + 1 end ms = 0 end local m = math.floor(ms) local s = (ms - m) * 60 if p > 0.008 then -- precision is > 1/2 a minute if s > 30 then m = m +1 end s = 0 elseif p > 0.00014 then -- precision is > 1/2 a second s = math.floor(s + 0.5) elseif p > 0.000014 then -- precision is > 1/20 second s = math.floor(10 * s + 0.5) / 10 elseif p > 0.0000014 then -- precision is > 1/200 second s = math.floor(100 * s + 0.5) / 100 else -- cap it at 3 dec places for now s = math.floor(1000 * s + 0.5) / 1000 end return d, m, s end ------------------------------------------------------------------------------- -- decimalPrecision takes a decimal (x) with precision (p) -- and returns x rounded approximately to the given precision -- precision should be between 1 and 1e-6, preferably a power of 10. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local decimalPrecision = function(x, p) local s = 1 if x < 0 then x = -x s = -1 end -- if p is not supplied, pick an arbitrary precision if not tonumber(p) then p = 1e-4 elseif p > 1 then p = 1 elseif p < 1e-6 then p = 1e-6 else p = 10 ^ math.floor(math.log10(p)) end x = math.floor(x / p + 0.5) * p * s -- if it's integral, cast to an integer: if x == math.floor(x) then x = math.floor(x) end -- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp -- 9e-5 becomes 0.000090 if math.abs(x) < 1e-4 then x = string.format("%f", x) end return x end ------------------------------------------------------------------------------- -- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues -- like "1 August 30 BCE" as parameter 1 -- and formats it according to the df (date format) and bc parameters -- df = ["dmy" / "mdy" / "y"] default will be "dmy" -- bc = ["BC" / "BCE"] default will be "BCE" ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local format_Date = function(datetime, dateformat, bc) local datetime = datetime or "1 August 30 BCE" -- in case of nil value -- chop off multiple vales and/or any hours, mins, etc. -- keep anything before punctuation - we just want a single date: local dateval = string.match( datetime, "[%w ]+") local dateformat = string.lower(dateformat or "dmy") -- default to dmy local bc = string.upper(bc or "") -- can't use nil for bc -- we only want to accept two possibilities: BC or default to BCE if bc == "BC" then bc = "&nbsp;" .. i18n["BC"] -- prepend a non-breaking space. else bc = "&nbsp;" .. i18n["BCE"] end local postchrist = true -- start by assuming no BCE local dateparts = {} for word in string.gmatch(dateval, "%w+") do if word == "BCE" or word == "BC" then -- *** internationalise later *** postchrist = false else -- we'll keep the parts that are not 'BCE' in a table dateparts[#dateparts + 1] = word end end if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later *** local sep = "&nbsp;" -- separator is nbsp local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input -- if we have day month year, check dateformat if #dateparts == 3 then if dateformat == "y" then fdate = dateparts[3] elseif dateformat == "mdy" then fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3] end elseif #dateparts == 2 and dateformat == "y" then fdate = dateparts[2] end return fdate .. bc end ------------------------------------------------------------------------------- -- dateFormat is the handler for properties that are of type "time" -- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE), -- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form, -- any qualifiers for the property, the language, and any adjective to use like 'before'. -- It passes the date through the "complex date" function -- and returns a string with the internatonalised date formatted according to preferences. ------------------------------------------------------------------------------- -- Dependencies: findLang(); cdate(); dp[] ------------------------------------------------------------------------------- local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model) -- output formatting according to preferences (y/dmy/mdy/ymd) df = (df or ""):lower() -- if ymd is required, return the part of the timestamp in YYYY-MM-DD form -- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc. if df == "ymd" then if timestamp:sub(1,1) == "+" then return timestamp:sub(2,11) else local yr = tonumber(timestamp:sub(2,5)) - 1 yr = ("000" .. yr):sub(-4) if yr ~= "0000" then yr = "-" .. yr end return yr .. timestamp:sub(6,11) end end -- A year can be stored like this: "+1872-00-00T00:00:00Z", -- which is processed here as if it were the day before "+1872-01-01T00:00:00Z", -- and that's the last day of 1871, so the year is wrong. -- So fix the month 0, day 0 timestamp to become 1 January instead: timestamp = timestamp:gsub("%-00%-00T", "-01-01T") -- just in case date precision is missing dprec = dprec or 11 -- override more precise dates if required dateformat is year alone: if df == "y" and dprec > 9 then dprec = 9 end -- complex date only deals with precisions from 6 to 11, so clip range dprec = dprec>11 and 11 or dprec dprec = dprec<6 and 6 or dprec -- BC format is "BC" or "BCE" bcf = (bcf or ""):upper() -- plaindate only needs the first letter (y/n/a) pd = (pd or ""):sub(1,1):lower() if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end -- in case language isn't passed lang = lang or findLang().code -- set adj as empty if nil adj = adj or "" -- extract the day, month, year from the timestamp local bc = timestamp:sub(1, 1)=="-" and "BC" or "" local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T") local iso = tonumber(year) -- if year is missing, let it throw an error -- this will adjust the date format to be compatible with cdate -- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end if dprec == 10 then iso = year .. "-" .. month end if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end -- add "circa" (Q5727902) from "sourcing circumstances" (P1480) local sc = not pd and qualifiers and qualifiers.P1480 if sc then for k1, v1 in pairs(sc) do if v1.datavalue and v1.datavalue.value.id == "Q5727902" then adj = "circa" break end end end -- deal with Julian dates: -- no point in saying that dates before 1582 are Julian - they are by default -- doesn't make sense for dates less precise than year -- we can suppress it by setting |plaindate, e.g. for use in constructing categories. local calendarmodel = "" if tonumber(year) > 1582 and dprec > 8 and not pd and model == "http://www.wikidata.org/entity/Q1985786" then calendarmodel = "julian" end if not cdate then cdate = require("Module:Complex date")._complex_date end local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1) -- this may have QuickStatements info appended to it in a div, so remove that fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '') -- it may also be returned wrapped in a microformat, so remove that fdate = fdate:gsub("<[^>]*>", "") -- there may be leading zeros that we should remove fdate = fdate:gsub("^0*", "") -- if a plain date is required, then remove any links (like BC linked) if pd then fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "") end -- if 'circa', use the abbreviated form *** internationalise later *** fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr>&nbsp;') -- deal with BC/BCE if bcf == "BCE" then fdate = fdate:gsub('BC', 'BCE') end -- deal with mdy format if df == "mdy" then fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3") end -- deal with adjectival form *** internationalise later *** if pd == "a" then fdate = fdate:gsub(' century', '-century') end return fdate end ------------------------------------------------------------------------------- -- parseParam takes a (string) parameter, e.g. from the list of frame arguments, -- and makes "false", "no", and "0" into the (boolean) false -- it makes the empty string and nil into the (boolean) value passed as default -- allowing the parameter to be true or false by default. -- It returns a boolean. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local parseParam = function(param, default) if type(param) == "boolean" then param = tostring(param) end if param and param ~= "" then param = param:lower() if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then return false else return true end else return default end end ------------------------------------------------------------------------------- -- _getSitelink takes the qid of a Wikidata entity passed as |qid= -- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink -- If the parameter is blank, then it uses the local wiki. -- If there is a sitelink to an article available, it returns the plain text link to the article -- If there is no sitelink, it returns nil. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local _getSitelink = function(qid, wiki) qid = (qid or ""):upper() if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return nil end wiki = wiki or "" local sitelink if wiki == "" then sitelink = mw.wikibase.getSitelink(qid) else sitelink = mw.wikibase.getSitelink(qid, wiki) end return sitelink end ------------------------------------------------------------------------------- -- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid= -- It returns one of the following in order of preference: -- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category; -- the Commons sitelink of the topic's main category of the Wikidata entity; -- the Commons category of the Wikidata entity - unless fallback=false. ------------------------------------------------------------------------------- -- Dependencies: _getSitelink(); parseParam() ------------------------------------------------------------------------------- local _getCommonslink = function(qid, onlycat, fallback) qid = (qid or ""):upper() if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return nil end onlycat = parseParam(onlycat, false) if fallback == "" then fallback = nil end local sitelink = _getSitelink(qid, "commonswiki") if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end if not sitelink then -- check for topic's main category local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1] if prop910 then local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id sitelink = _getSitelink(tmcid, "commonswiki") end if not sitelink then -- check for list's main category local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1] if prop1754 then local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id sitelink = _getSitelink(tmcid, "commonswiki") end end end if not sitelink and fallback then -- check for Commons category (string value) local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1] if prop373 then sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value if sitelink then sitelink = "Category:" .. sitelink end end end return sitelink end ------------------------------------------------------------------------------- -- The label in a Wikidata item is subject to vulnerabilities -- that an attacker might try to exploit. -- It needs to be 'sanitised' by removing any wikitext before use. -- If it doesn't exist, return the id for the item -- a second (boolean) value is also returned, value is true when the label exists ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local labelOrId = function(id, lang) if lang == "default" then lang = findLang().code end local label if lang then label = mw.wikibase.getLabelByLang(id, lang) else label = mw.wikibase.getLabel(id) end if label then return mw.text.nowiki(label), true else return id, false end end ------------------------------------------------------------------------------- -- linkedItem takes an entity-id and returns a string, linked if possible. -- This is the handler for "wikibase-item". Preferences: -- 1. Display linked disambiguated sitelink if it exists -- 2. Display linked label if it is a redirect -- 3. TBA: Display an inter-language link for the label if it exists other than in default language -- 4. Display unlinked label if it exists -- 5. Display entity-id for now to indicate a label could be provided -- dtxt is text to be used instead of label, or nil. -- shortname is boolean switch to use P1813 (short name) instead of label if true. -- lang is the current language code. -- uselbl is boolean switch to force display of the label instead of the sitelink (default: false) -- linkredir is boolean switch to allow linking to a redirect (default: false) -- formatvalue is boolean switch to allow formatting as italics or quoted (default: false) ------------------------------------------------------------------------------- -- Dependencies: labelOrId(); donotlink[] ------------------------------------------------------------------------------- local linkedItem = function(id, args) local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed local lpostfix = (args.lpostfix or ""):gsub('"', '') local prefix = (args.prefix or ""):gsub('"', '') local postfix = (args.postfix or ""):gsub('"', '') local dtxt = args.dtxt local shortname = args.shortname or args.sn local lang = args.lang or "en" -- fallback to default if missing local uselbl = args.uselabel or args.uselbl uselbl = parseParam(uselbl, false) local linkredir = args.linkredir linkredir = parseParam(linkredir, false) local formatvalue = args.formatvalue or args.fv formatvalue = parseParam(formatvalue, false) -- see if item might need italics or quotes local fmt = "" if next(formats) and formatvalue then for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then fmt = formats[v.mainsnak.datavalue.value.id] break -- pick the first match end end end local disp local sitelink = mw.wikibase.getSitelink(id) local label, islabel if dtxt then label, islabel = dtxt, true elseif shortname then -- see if there is a shortname in our language, and set label to it for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do if v.mainsnak.datavalue.value.language == lang then label, islabel = v.mainsnak.datavalue.value.text, true break end -- test for language match end -- loop through values of short name -- if we have no label set, then there was no shortname available if not islabel then label, islabel = labelOrId(id) shortname = false end else label, islabel = labelOrId(id) end if mw.site.siteName ~= "Wikimedia Commons" then if sitelink then if not (dtxt or shortname) then -- if sitelink and label are the same except for case, no need to process further if sitelink:lower() ~= label:lower() then -- strip any namespace or dab from the sitelink local pos = sitelink:find(":") or 0 local slink = sitelink if pos > 0 then local pfx = sitelink:sub(1,pos-1) if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it slink = sitelink:sub(pos+1) end end -- remove stuff after commas or inside parentheses - ie. dabs slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "") -- if uselbl is false, use sitelink instead of label if not uselbl then -- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase if label:find("^%u") then label = slink:gsub("^(%l)", string.upper) else label = slink:gsub("^(%u)", string.lower) end end end end if donotlink[label] then disp = prefix .. fmt .. label .. fmt .. postfix else disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]" end elseif islabel then -- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true -- display plain label by default disp = prefix .. fmt .. label .. fmt .. postfix if linkredir then local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars if not donotlink[label] and artitle and artitle.redirectTarget then -- there's a redirect with the same title as the label, so let's link to that disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]" end end -- test if article title exists as redirect on current Wiki else -- no sitelink and no label, so return whatever was returned from labelOrId for now -- add tracking category [[Category:Articles with missing Wikidata information]] -- for enwiki, just return the tracking category if mw.wikibase.getGlobalSiteId() == "enwiki" then disp = i18n.missinginfocat else disp = prefix .. label .. postfix .. i18n.missinginfocat end end else local ccat = mw.wikibase.getBestStatements(id, "P373")[1] if ccat and ccat.mainsnak.datavalue then ccat = ccat.mainsnak.datavalue.value disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]" elseif sitelink then -- this asumes that if a sitelink exists, then a label also exists disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]" else -- no sitelink and no Commons cat, so return label from labelOrId for now disp = prefix .. label .. postfix end end return disp end ------------------------------------------------------------------------------- -- sourced takes a table representing a statement that may or may not have references -- it looks for a reference sourced to something not containing the word "wikipedia" -- it returns a boolean = true if it finds a sourced reference. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local sourced = function(claim) if claim.references then for kr, vr in pairs(claim.references) do local ref = mw.wikibase.renderSnaks(vr.snaks) if not ref:find("Wiki") then return true end end end end ------------------------------------------------------------------------------- -- setRanks takes a flag (parameter passed) that requests the values to return -- "b[est]" returns preferred if available, otherwise normal -- "p[referred]" returns preferred -- "n[ormal]" returns normal -- "d[eprecated]" returns deprecated -- multiple values are allowed, e.g. "preferred normal" (which is the default) -- "best" will override the other flags, and set p and n ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local setRanks = function(rank) rank = (rank or ""):lower() -- if nothing passed, return preferred and normal -- if rank == "" then rank = "p n" end local ranks = {} for w in string.gmatch(rank, "%a+") do w = w:sub(1,1) if w == "b" or w == "p" or w == "n" or w == "d" then ranks[w] = true end end -- check if "best" is requested or no ranks requested; and if so, set preferred and normal if ranks.b or not next(ranks) then ranks.p = true ranks.n = true end return ranks end ------------------------------------------------------------------------------- -- parseInput processes the Q-id , the blacklist and the whitelist -- if an input parameter is supplied, it returns that and ends the call. -- it returns (1) either the qid or nil indicating whether or not the call should continue -- and (2) a table containing all of the statements for the propertyID and relevant Qid -- if "best" ranks are requested, it returns those instead of all non-deprecated ranks ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- local parseInput = function(frame, input_parm, property_id) -- There may be a local parameter supplied, if it's blank, set it to nil input_parm = mw.text.trim(input_parm or "") if input_parm == "" then input_parm = nil end -- return nil if Wikidata is not available if not mw.wikibase then return false, input_parm end local args = frame.args -- can take a named parameter |qid which is the Wikidata ID for the article. -- if it's not supplied, use the id for the current page local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end -- if there's no Wikidata item for the current page return nil if not qid then return false, input_parm end -- The blacklist is passed in named parameter |suppressfields local blacklist = args.suppressfields or args.spf or "" -- The whitelist is passed in named parameter |fetchwikidata local whitelist = args.fetchwikidata or args.fwd or "" if whitelist == "" then whitelist = "NONE" end -- The name of the field that this function is called from is passed in named parameter |name local fieldname = args.name or "" if blacklist ~= "" then -- The name is compulsory when blacklist is used, so return nil if it is not supplied if fieldname == "" then return false, nil end -- If this field is on the blacklist, then return nil if blacklist:find(fieldname) then return false, nil end end -- If we got this far then we're not on the blacklist -- The blacklist overrides any locally supplied parameter as well -- If a non-blank input parameter was supplied return it if input_parm then return false, input_parm end -- We can filter out non-valid properties if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end -- Otherwise see if this field is on the whitelist: -- needs a bit more logic because find will return its second value = 0 if fieldname is "" -- but nil if fieldname not found on whitelist local _, found = whitelist:find(fieldname) found = ((found or 0) > 0) if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then return false, nil end -- See what's on Wikidata (the call always returns a table, but it may be empty): local props = {} if args.reqranks.b then props = mw.wikibase.getBestStatements(qid, property_id) else props = mw.wikibase.getAllStatements(qid, property_id) end if props[1] then return qid, props end -- no property on Wikidata return false, nil end ------------------------------------------------------------------------------- -- createicon assembles the "Edit at Wikidata" pen icon. -- It returns a wikitext string inside a span class="penicon" -- if entityID is nil or empty, the ID associated with current page is used -- langcode and propertyID may be nil or empty ------------------------------------------------------------------------------- -- Dependencies: i18n[]; ------------------------------------------------------------------------------- local createicon = function(langcode, entityID, propertyID) langcode = langcode or "" if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end propertyID = propertyID or "" local icon = "&nbsp;<span class='penicon autoconfirmed-show'>[[" -- "&nbsp;<span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge .. i18n["filespace"] .. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt=" .. i18n["editonwikidata"] .. "|link=https://www.wikidata.org/wiki/" .. entityID if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end if propertyID ~= "" then icon = icon .. "#" .. propertyID end icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>" return icon end ------------------------------------------------------------------------------- -- assembleoutput takes the sequence table containing the property values -- and formats it according to switches given. It returns a string or nil. -- It uses the entityID (and optionally propertyID) to create a link in the pen icon. ------------------------------------------------------------------------------- -- Dependencies: parseParam(); ------------------------------------------------------------------------------- local assembleoutput = function(out, args, entityID, propertyID) -- sorted is a boolean passed to enable sorting of the values returned -- if nothing or an empty string is passed set it false -- if "false" or "no" or "0" is passed set it false local sorted = parseParam(args.sorted, false) -- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon -- for use when the value is processed further by the infobox -- if nothing or an empty string is passed set it false -- if "false" or "no" or "0" is passed set it false local noic = parseParam(args.noicon, false) -- list is the name of a template that a list of multiple values is passed through -- examples include "hlist" and "ubl" -- setting it to "prose" produces something like "1, 2, 3, and 4" local list = args.list or "" -- sep is a string that is used to separate multiple returned values -- if nothing or an empty string is passed set it to the default -- any double-quotes " are stripped out, so that spaces may be passed -- e.g. |sep=" - " local sepdefault = i18n["list separator"] local separator = args.sep or "" separator = string.gsub(separator, '"', '') if separator == "" then separator = sepdefault end -- collapse is a number that determines the maximum number of returned values -- before the output is collapsed. -- Zero or not a number result in no collapsing (default becomes 0). local collapse = tonumber(args.collapse) or 0 -- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value -- this is useful for tracking and debugging local replacetext = mw.text.trim(args.rt or args.replacetext or "") -- if there's anything to return, then return a list -- comma-separated by default, but may be specified by the sep parameter -- optionally specify a hlist or ubl or a prose list, etc. local strout if #out > 0 then if sorted then table.sort(out) end -- if there's something to display and a pen icon is wanted, add it the end of the last value local hasdisplay = false for i, v in ipairs(out) do if v ~= i18n.missinginfocat then hasdisplay = true break end end if not noic and hasdisplay then out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID) end if list == "" then strout = table.concat(out, separator) elseif list:lower() == "prose" then strout = mw.text.listToText( out ) else strout = mw.getCurrentFrame():expandTemplate{title = list, args = out} end if collapse >0 and #out > collapse then strout = collapsediv .. strout .. "</div>" end else strout = nil -- no items had valid reference end if replacetext ~= "" and strout then strout = replacetext end return strout end ------------------------------------------------------------------------------- -- rendersnak takes a table (propval) containing the information stored on one property value -- and returns the value as a string and its language if monolingual text. -- It handles data of type: -- wikibase-item -- time -- string, url, commonsMedia, external-id -- quantity -- globe-coordinate -- monolingualtext -- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame. -- The optional filter parameter allows quantities to be be filtered by unit Qid. ------------------------------------------------------------------------------- -- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat(); -- roundto(); decimalPrecision(); decimalToDMS(); linkedItem(); ------------------------------------------------------------------------------- local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter) lpre = lpre or "" lpost = lpost or "" pre = pre or "" post = post or "" args.lang = args.lang or findLang().code -- allow values to display a fixed text instead of label local dtxt = args.displaytext or args.dt if dtxt == "" then dtxt = nil end -- switch to use display of short name (P1813) instead of label local shortname = args.shortname or args.sn shortname = parseParam(shortname, false) local snak = propval.mainsnak or propval local dtype = snak.datatype local dv = snak.datavalue dv = dv and dv.value -- value and monolingual text language code returned local val, mlt if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then -- val is nil: value has a rank that isn't requested ------------------------------------ elseif snak.snaktype == "somevalue" then -- value is unknown val = i18n["Unknown"] ------------------------------------ elseif snak.snaktype == "novalue" then -- value is none -- val = "No value" -- don't return anything ------------------------------------ elseif dtype == "wikibase-item" then -- data type is a wikibase item: -- it's wiki-linked value, so output as link if enabled and possible local qnumber = dv.id if linked then val = linkedItem(qnumber, args) else -- no link wanted so check for display-text, otherwise test for lang code local label, islabel if dtxt then label = dtxt else label, islabel = labelOrId(qnumber) local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang) if langlabel then label = mw.text.nowiki( langlabel ) end end val = pre .. label .. post end -- test for link required ------------------------------------ elseif dtype == "time" then -- data type is time: -- time is in timestamp format -- date precision is integer per mediawiki -- output formatting according to preferences (y/dmy/mdy) -- BC format as BC or BCE -- plaindate is passed to disable looking for "sourcing cirumstances" -- or to set the adjectival form -- qualifiers (if any) is a nested table or nil -- lang is given, or user language, or site language -- -- Here we can check whether args.df has a value -- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}} val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel) ------------------------------------ -- data types which are strings: elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then -- commonsMedia or external-id or string or url -- all have mainsnak.datavalue.value as string if (lpre == "" or lpre == ":") and lpost == "" then -- don't link if no linkpre/postfix or linkprefix is just ":" val = pre .. dv .. post elseif dtype == "external-id" then val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]" else val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]" end -- check for link requested (i.e. either linkprefix or linkpostfix exists) ------------------------------------ -- data types which are quantities: elseif dtype == "quantity" then -- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit -- the unit is of the form http://www.wikidata.org/entity/Q829073 -- -- implement a switch to turn on/off numerical formatting later local fnum = true -- -- a switch to turn on/off conversions - only for en-wiki local conv = parseParam(args.conv or args.convert, false) -- if we have conversions, we won't have formatted numbers or scales if conv then uabbr = true fnum = false args.scale = "0" end -- -- a switch to turn on/off showing units, default is true local showunits = parseParam(args.su or args.showunits, true) -- -- convert amount to a number local amount = tonumber(dv.amount) or i18n["NaN"] -- -- scale factor for millions, billions, etc. local sc = tostring(args.scale or ""):sub(1,1):lower() local scale if sc == "a" then -- automatic scaling if amount > 1e15 then scale = 12 elseif amount > 1e12 then scale = 9 elseif amount > 1e9 then scale = 6 elseif amount > 1e6 then scale = 3 else scale = 0 end else scale = tonumber(args.scale) or 0 if scale < 0 or scale > 12 then scale = 0 end scale = math.floor(scale/3) * 3 end local factor = 10^scale amount = amount / factor -- ranges: local range = "" -- check if upper and/or lower bounds are given and significant local upb = tonumber(dv.upperBound) local lowb = tonumber(dv.lowerBound) if upb and lowb then -- differences rounded to 2 sig fig: local posdif = roundto(upb - amount, 2) / factor local negdif = roundto(amount - lowb, 2) / factor upb, lowb = amount + posdif, amount - negdif -- round scaled numbers to integers or 4 sig fig if (scale > 0 or sc == "a") then if amount < 1e4 then amount = roundto(amount, 4) else amount = math.floor(amount + 0.5) end end if fnum then amount = args.langobj:formatNum( amount ) end if posdif ~= negdif then -- non-symmetrical range = " +" .. posdif .. " -" .. negdif elseif posdif ~= 0 then -- symmetrical and non-zero range = " ±" .. posdif else -- otherwise range is zero, so leave it as "" end else -- round scaled numbers to integers or 4 sig fig if (scale > 0 or sc == "a") then if amount < 1e4 then amount = roundto(amount, 4) else amount = math.floor(amount + 0.5) end end if fnum then amount = args.langobj:formatNum( amount ) end end -- unit names and symbols: -- extract the qid in the form 'Qnnn' from the value.unit url -- and then fetch the label from that - or symbol if unitabbr is true local unit = "" local usep = "" local usym = "" local unitqid = string.match( dv.unit, "(Q%d+)" ) if filter and unitqid ~= filter then return nil end if unitqid and showunits then local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or "" if uname ~= "" then usep, unit = " ", uname end if uabbr then -- see if there's a unit symbol (P5061) local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061") -- construct fallback table, add local lang and multiple languages local fbtbl = mw.language.getFallbacksFor( args.lang ) table.insert( fbtbl, 1, args.lang ) table.insert( fbtbl, 1, "mul" ) local found = false for idx1, us in ipairs(unitsymbols) do for idx2, fblang in ipairs(fbtbl) do if us.mainsnak.datavalue.value.language == fblang then usym = us.mainsnak.datavalue.value.text found = true break end if found then break end end -- loop through fallback table end -- loop through values of P5061 if found then usep, unit = "&nbsp;", usym end end end -- format display: if conv then if range == "" then val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}} else val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}} end elseif unit == "$" or unit == "£" then val = unit .. amount .. range .. i18n.multipliers[scale] else val = amount .. range .. i18n.multipliers[scale] .. usep .. unit end ------------------------------------ -- datatypes which are global coordinates: elseif dtype == "globe-coordinate" then -- 'display' parameter defaults to "inline, title" *** unused for now *** -- local disp = args.display or "" -- if disp == "" then disp = "inline, title" end -- -- format parameter switches from deg/min/sec to decimal degrees -- default is deg/min/sec -- decimal degrees needs |format = dec local form = (args.format or ""):lower():sub(1,3) if form ~= "dec" then form = "dms" end -- not needed for now -- -- show parameter allows just the latitude, or just the longitude, or both -- to be returned as a signed decimal, ignoring the format parameter. local show = (args.show or ""):lower() if show ~= "longlat" then show = show:sub(1,3) end -- local lat, long, prec = dv.latitude, dv.longitude, dv.precision if show == "lat" then val = decimalPrecision(lat, prec) elseif show == "lon" then val = decimalPrecision(long, prec) elseif show == "longlat" then val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec) else local ns = "N" local ew = "E" if lat < 0 then ns = "S" lat = - lat end if long < 0 then ew = "W" long = - long end if form == "dec" then lat = decimalPrecision(lat, prec) long = decimalPrecision(long, prec) val = lat .. "°" .. ns .. " " .. long .. "°" .. ew else local latdeg, latmin, latsec = decimalToDMS(lat, prec) local longdeg, longmin, longsec = decimalToDMS(long, prec) if latsec == 0 and longsec == 0 then if latmin == 0 and longmin == 0 then val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew else val = latdeg .. "°" .. latmin .. "′" .. ns .. " " val = val .. longdeg .. "°".. longmin .. "′" .. ew end else val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " " val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew end end end ------------------------------------ elseif dtype == "monolingualtext" then -- data type is Monolingual text: -- has mainsnak.datavalue.value as a table containing language/text pairs -- collect all the values in 'out' and languages in 'mlt' and process them later val = pre .. dv.text .. post mlt = dv.language ------------------------------------ else -- some other data type so write a specific handler val = "unknown data type: " .. dtype end -- of datatype/unknown value/sourced check return val, mlt end ------------------------------------------------------------------------------- -- propertyvalueandquals takes a property object, the arguments passed from frame, -- and a qualifier propertyID. -- It returns a sequence (table) of values representing the values of that property -- and qualifiers that match the qualifierID if supplied. ------------------------------------------------------------------------------- -- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date(); -- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput(); ------------------------------------------------------------------------------- local function propertyvalueandquals(objproperty, args, qualID) -- needs this style of declaration because it's re-entrant -- onlysourced is a boolean passed to return only values sourced to other than Wikipedia -- if nothing or an empty string is passed set it true local onlysrc = parseParam(args.onlysourced or args.osd, true) -- linked is a a boolean that enables the link to a local page via sitelink -- if nothing or an empty string is passed set it true local linked = parseParam(args.linked, true) -- prefix is a string that may be nil, empty (""), or a string of characters -- this is prefixed to each value -- useful when when multiple values are returned -- any double-quotes " are stripped out, so that spaces may be passed local prefix = (args.prefix or ""):gsub('"', '') -- postfix is a string that may be nil, empty (""), or a string of characters -- this is postfixed to each value -- useful when when multiple values are returned -- any double-quotes " are stripped out, so that spaces may be passed local postfix = (args.postfix or ""):gsub('"', '') -- linkprefix is a string that may be nil, empty (""), or a string of characters -- this creates a link and is then prefixed to each value -- useful when when multiple values are returned and indirect links are needed -- any double-quotes " are stripped out, so that spaces may be passed local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '') -- linkpostfix is a string that may be nil, empty (""), or a string of characters -- this is postfixed to each value when linking is enabled with lprefix -- useful when when multiple values are returned -- any double-quotes " are stripped out, so that spaces may be passed local lpostfix = (args.linkpostfix or ""):gsub('"', '') -- wdlinks is a boolean passed to enable links to Wikidata when no article exists -- if nothing or an empty string is passed set it false local wdl = parseParam(args.wdlinks or args.wdl, false) -- unitabbr is a boolean passed to enable unit abbreviations for common units -- if nothing or an empty string is passed set it false local uabbr = parseParam(args.unitabbr or args.uabbr, false) -- qualsonly is a boolean passed to return just the qualifiers -- if nothing or an empty string is passed set it false local qualsonly = parseParam(args.qualsonly or args.qo, false) -- maxvals is a string that may be nil, empty (""), or a number -- this determines how many items may be returned when multiple values are available -- setting it = 1 is useful where the returned string is used within another call, e.g. image local maxvals = tonumber(args.maxvals) or 0 -- pd (plain date) is a string: yes/true/1 | no/false/0 | adj -- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date local pd = args.plaindate or args.pd or "no" args.pd = pd -- allow qualifiers to have a different date format; default to year unless qualsonly is set args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y") local lang = args.lang or findLang().code -- qualID is a string list of wanted qualifiers or "ALL" qualID = qualID or "" -- capitalise list of wanted qualifiers and substitute "DATES" qualID = qualID:upper():gsub("DATES", "P580, P582") local allflag = (qualID == "ALL") -- create table of wanted qualifiers as key local qwanted = {} -- create sequence of wanted qualifiers local qorder = {} for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate local qtrim = mw.text.trim(q) if qtrim ~= "" then qwanted[mw.text.trim(q)] = true qorder[#qorder+1] = qtrim end end -- qsep is the output separator for rendering qualifier list local qsep = (args.qsep or ""):gsub('"', '') -- qargs are the arguments to supply to assembleoutput() local qargs = { ["osd"] = "false", ["linked"] = tostring(linked), ["prefix"] = args.qprefix, ["postfix"] = args.qpostfix, ["linkprefix"] = args.qlinkprefix or args.qlp, ["linkpostfix"] = args.qlinkpostfix, ["wdl"] = "false", ["unitabbr"] = tostring(uabbr), ["maxvals"] = 0, ["sorted"] = tostring(args.qsorted), ["noicon"] = "true", ["list"] = args.qlist, ["sep"] = qsep, ["langobj"] = args.langobj, ["lang"] = args.langobj.code, ["df"] = args.qdf, ["sn"] = parseParam(args.qsn or args.qshortname, false), } -- all proper values of a Wikidata property will be the same type as the first -- qualifiers don't have a mainsnak, properties do local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype -- out[] holds the a list of returned values for this property -- mlt[] holds the language code if the datatype is monolingual text local out = {} local mlt = {} for k, v in ipairs(objproperty) do local hasvalue = true if (onlysrc and not sourced(v)) then -- no value: it isn't sourced when onlysourced=true hasvalue = false else local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr) if not val then hasvalue = false -- rank doesn't match elseif qualsonly and qualID then -- suppress value returned: only qualifiers are requested else out[#out+1], mlt[#out+1] = val, lcode end end -- See if qualifiers are to be returned: local snak = v.mainsnak or v if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then -- collect all wanted qualifier values returned in qlist, indexed by propertyID local qlist = {} local timestart, timeend = "", "" -- loop through qualifiers for k1, v1 in pairs(v.qualifiers) do if allflag or qwanted[k1] then if k1 == "P1326" then local ts = v1[1].datavalue.value.time local dp = v1[1].datavalue.value.precision qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before") elseif k1 == "P1319" then local ts = v1[1].datavalue.value.time local dp = v1[1].datavalue.value.precision qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after") elseif k1 == "P580" then timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid elseif k1 == "P582" then timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid else local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs) -- we already deal with circa via 'sourcing circumstances' if the datatype was time -- circa may be either linked or unlinked *** internationalise later *** if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then qlist[k1] = q end end end -- of test for wanted end -- of loop through qualifiers -- set date separator local t = timestart .. timeend -- *** internationalise date separators later *** local dsep = "&ndash;" if t:find("%s") or t:find("&nbsp;") then dsep = " &ndash; " end -- set the order for the list of qualifiers returned; start time and end time go last if next(qlist) then local qlistout = {} if allflag then for k2, v2 in pairs(qlist) do qlistout[#qlistout+1] = v2 end else for i2, v2 in ipairs(qorder) do qlistout[#qlistout+1] = qlist[v2] end end if t ~= "" then qlistout[#qlistout+1] = timestart .. dsep .. timeend end local qstr = assembleoutput(qlistout, qargs) if qualsonly then out[#out+1] = qstr else out[#out] = out[#out] .. " (" .. qstr .. ")" end elseif t ~= "" then if qualsonly then if timestart == "" then out[#out+1] = timeend elseif timeend == "" then out[#out+1] = timestart else out[#out+1] = timestart .. dsep .. timeend end else out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")" end end end -- of test for qualifiers wanted if maxvals > 0 and #out >= maxvals then break end end -- of for each value loop -- we need to pick one value to return if the datatype was "monolingualtext" -- if there's only one value, use that -- otherwise look through the fallback languages for a match if datatype == "monolingualtext" and #out >1 then lang = mw.text.split( lang, '-', true )[1] local fbtbl = mw.language.getFallbacksFor( lang ) table.insert( fbtbl, 1, lang ) local bestval = "" local found = false for idx1, lang1 in ipairs(fbtbl) do for idx2, lang2 in ipairs(mlt) do if (lang1 == lang2) and not found then bestval = out[idx2] found = true break end end -- loop through values of property end -- loop through fallback languages if found then -- replace output table with a table containing the best value out = { bestval } else -- more than one value and none of them on the list of fallback languages -- sod it, just give them the first one out = { out[1] } end end return out end ------------------------------------------------------------------------------- -- Common code for p.getValueByQual and p.getValueByLang ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput; ------------------------------------------------------------------------------- local _getvaluebyqual = function(frame, qualID, checkvalue) -- The property ID that will have a qualifier is the first unnamed parameter local propertyID = mw.text.trim(frame.args[1] or "") if propertyID == "" then return "no property supplied" end if qualID == "" then return "no qualifier supplied" end -- onlysourced is a boolean passed to return property values -- only when property values are sourced to something other than Wikipedia -- if nothing or an empty string is passed set it true -- if "false" or "no" or 0 is passed set it false local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true) -- set the requested ranks flags frame.args.reqranks = setRanks(frame.args.rank) -- set a language object and code in the frame.args table frame.args.langobj = findLang(frame.args.lang) frame.args.lang = frame.args.langobj.code local args = frame.args -- check for locally supplied parameter in second unnamed parameter -- success means no local parameter and the property exists local qid, props = parseInput(frame, args[2], propertyID) local linked = parseParam(args.linked, true) local lpre = (args.linkprefix or args.lp or ""):gsub('"', '') local lpost = (args.linkpostfix or ""):gsub('"', '') local pre = (args.prefix or ""):gsub('"', '') local post = (args.postfix or ""):gsub('"', '') local uabbr = parseParam(args.unitabbr or args.uabbr, false) local filter = (args.unit or ""):upper() local maxvals = tonumber(args.maxvals) or 0 if filter == "" then filter = nil end if qid then local out = {} -- Scan through the values of the property -- we want something like property is "pronunciation audio (P443)" in propertyID -- with a qualifier like "language of work or name (P407)" in qualID -- whose value has the required ID, like "British English (Q7979)", in qval for k1, v1 in ipairs(props) do if v1.mainsnak.snaktype == "value" then -- check if it has the right qualifier local v1q = v1.qualifiers if v1q and v1q[qualID] then if onlysrc == false or sourced(v1) then -- if we've got this far, we have a (sourced) claim with qualifiers -- so see if matches the required value -- We'll only deal with wikibase-items and strings for now if v1q[qualID][1].datatype == "wikibase-item" then if checkvalue(v1q[qualID][1].datavalue.value.id) then out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter) end elseif v1q[qualID][1].datatype == "string" then if checkvalue(v1q[qualID][1].datavalue.value) then out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter) end end end -- of check for sourced end -- of check for matching required value and has qualifiers else return nil end -- of check for string if maxvals > 0 and #out >= maxvals then break end end -- of loop through values of propertyID return assembleoutput(out, frame.args, qid, propertyID) else return props -- either local parameter or nothing end -- of test for success return nil end ------------------------------------------------------------------------------- -- _location takes Q-id and follows P276 (location) -- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature) -- from the initial item to higher level territories/locations until it reaches the highest. -- An optional boolean, 'first', determines whether the first item is returned (default: false). -- An optional boolean 'skip' toggles the display to skip to the last item (default: false). -- It returns a table containing the locations - linked where possible, except for the highest. ------------------------------------------------------------------------------- -- Dependencies: findLang(); labelOrId(); linkedItem ------------------------------------------------------------------------------- local _location = function(qid, first, skip) first = parseParam(first, false) skip = parseParam(skip, false) local locs = {"P276", "P131", "P706"} local out = {} local langcode = findLang():getCode() local finished = false local count = 0 local prevqid = "Q0" repeat local prop for i1, v1 in ipairs(locs) do local proptbl = mw.wikibase.getBestStatements(qid, v1) if #proptbl > 1 then -- there is more than one higher location local prevP131, prevP131id if prevqid ~= "Q0" then prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1] prevP131id = prevP131 and prevP131.mainsnak.datavalue and prevP131.mainsnak.datavalue.value.id end for i2, v2 in ipairs(proptbl) do local parttbl = v2.qualifiers and v2.qualifiers.P518 if parttbl then -- this higher location has qualifier 'applies to part' (P518) for i3, v3 in ipairs(parttbl) do if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then -- it has a value equal to the previous location prop = proptbl[i2] break end -- of test for matching last location end -- of loop through values of 'applies to part' else -- there's no qualifier 'applies to part' (P518) -- so check if the previous location had a P131 that matches this alternate if qid == prevP131id then prop = proptbl[i2] break end -- of test for matching previous P131 end end -- of loop through parent locations -- fallback to second value if match not found prop = prop or proptbl[2] elseif #proptbl > 0 then prop = proptbl[1] end if prop then break end end -- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078) -- and terminate the chain if it is local inst = mw.wikibase.getAllStatements(qid, "P31") if #inst > 0 then for k, v in ipairs(inst) do local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id -- stop if it's a country (or a country within the United Kingdom if skip is true) if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then prop = nil -- this will ensure this is treated as top-level location break end end end -- get the name of this location and update qid to point to the parent location if prop and prop.mainsnak.datavalue then if not skip or count == 0 then local args = { lprefix = ":" } out[#out+1] = linkedItem(qid, args) -- get a linked value if we can end qid, prevqid = prop.mainsnak.datavalue.value.id, qid else -- This is top-level location, so get short name except when this is the first item -- Use full label if there's no short name or this is the first item local prop1813 = mw.wikibase.getAllStatements(qid, "P1813") -- if there's a short name and this isn't the only item if prop1813[1] and (#out > 0)then local shortname -- short name is monolingual text, so look for match to the local language -- choose the shortest 'short name' in that language for k, v in pairs(prop1813) do if v.mainsnak.datavalue.value.language == langcode then local name = v.mainsnak.datavalue.value.text if (not shortname) or (#name < #shortname) then shortname = name end end end -- add the shortname if one is found, fallback to the label -- but skip it if it's "USA" if shortname ~= "USA" then out[#out+1] = shortname or labelOrId(qid) else if skip then out[#out+1] = "US" end end else -- no shortname, so just add the label local loc = labelOrId(qid) -- exceptions go here: if loc == "United States of America" then out[#out+1] = "United States" else out[#out+1] = loc end end finished = true end count = count + 1 until finished or count >= 10 -- limit to 10 levels to avoid infinite loops -- remove the first location if not required if not first then table.remove(out, 1) end -- we might have duplicate text for consecutive locations, so remove them if #out > 2 then local plain = {} for i, v in ipairs(out) do -- strip any links plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "") end local idx = 2 repeat if plain[idx] == plain[idx-1] then -- duplicate found local removeidx = 0 if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then -- only second one is linked, so drop the first removeidx = idx - 1 elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then -- only first one is linked, so drop the second removeidx = idx else -- pick one removeidx = idx - (os.time()%2) end table.remove(out, removeidx) table.remove(plain, removeidx) else idx = idx +1 end until idx >= #out end return out end ------------------------------------------------------------------------------- -- _getsumofparts scans the property 'has part' (P527) for values matching a list. -- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation. -- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed. -- The sum is returned as a number (i.e. 0 if none) -- a table of arguments is supplied implementing the usual parameters. ------------------------------------------------------------------------------- -- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput; ------------------------------------------------------------------------------- local _getsumofparts = function(args) local vallist = (args.vlist or ""):upper() if vallist == "" then return end args.reqranks = setRanks(args.rank) local f = {} f.args = args local qid, props = parseInput(f, "", "P527") if not qid then return 0 end local onlysrc = parseParam(args.onlysourced or args.osd, true) local sum = 0 for k1, v1 in ipairs(props) do if (onlysrc == false or sourced(v1)) and v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" and vallist:match( v1.mainsnak.datavalue.value.id ) and v1.qualifiers then local quals = v1.qualifiers["P1114"] if quals then for k2, v2 in ipairs(quals) do sum = sum + v2.datavalue.value.amount end end end end return sum end ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Public functions ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- _getValue makes the functionality of getValue available to other modules ------------------------------------------------------------------------------- -- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced; -- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS; ------------------------------------------------------------------------------- p._getValue = function(args) -- parameter sets for commonly used groups of parameters local paraset = tonumber(args.ps or args.parameterset or 0) if paraset == 1 then -- a common setting args.rank = "best" args.fetchwikidata = "ALL" args.onlysourced = "no" args.noicon = "true" elseif paraset == 2 then -- equivalent to raw args.rank = "best" args.fetchwikidata = "ALL" args.onlysourced = "no" args.noicon = "true" args.linked = "no" args.pd = "true" elseif paraset == 3 then -- third set goes here end -- implement eid parameter local eid = args.eid if eid == "" then return nil elseif eid then args.qid = eid end local propertyID = mw.text.trim(args[1] or "") args.reqranks = setRanks(args.rank) -- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value -- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist local replacetext = mw.text.trim(args.rt or args.replacetext or "") if replacetext ~= "" then args.fetchwikidata = "ALL" end local f = {} f.args = args local entityid, props = parseInput(f, f.args[2], propertyID) if not entityid then return props -- either the input parameter or nothing end -- qual is a string containing the property ID of the qualifier(s) to be returned -- if qual == "ALL" then all qualifiers returned -- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned -- if nothing or an empty string is passed set it nil -> no qualifiers returned local qualID = mw.text.trim(args.qual or ""):upper() if qualID == "" then qualID = nil end -- set a language object and code in the args table args.langobj = findLang(args.lang) args.lang = args.langobj.code -- table 'out' stores the return value(s): local out = propertyvalueandquals(props, args, qualID) -- format the table of values and return it as a string: return assembleoutput(out, args, entityid, propertyID) end ------------------------------------------------------------------------------- -- getValue is used to get the value(s) of a property -- The property ID is passed as the first unnamed parameter and is required. -- A locally supplied parameter may optionaly be supplied as the second unnamed parameter. -- The function will now also return qualifiers if parameter qual is supplied ------------------------------------------------------------------------------- -- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced; -- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS; ------------------------------------------------------------------------------- p.getValue = function(frame) local args= frame.args if not args[1] then args = frame:getParent().args if not args[1] then return i18n.errors["No property supplied"] end end return p._getValue(args) end ------------------------------------------------------------------------------- -- getPreferredValue is used to get a value, -- (or a comma separated list of them if multiple values exist). -- If preferred ranks are set, it will return those values, otherwise values with normal ranks -- now redundant to getValue with |rank=best ------------------------------------------------------------------------------- -- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; -- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date; -- makeOrdinal; roundto; decimalPrecision; decimalToDMS; ------------------------------------------------------------------------------- p.getPreferredValue = function(frame) frame.args.rank = "best" return p.getValue(frame) end ------------------------------------------------------------------------------- -- getCoords is used to get coordinates for display in an infobox -- whitelist and blacklist are implemented -- optional 'display' parameter is allowed, defaults to nil - was "inline, title" ------------------------------------------------------------------------------- -- Dependencies: setRanks(); parseInput(); decimalPrecision(); ------------------------------------------------------------------------------- p.getCoords = function(frame) local propertyID = "P625" -- if there is a 'display' parameter supplied, use it -- otherwise default to nothing local disp = frame.args.display or "" if disp == "" then disp = nil -- default to not supplying display parameter, was "inline, title" end -- there may be a format parameter to switch from deg/min/sec to decimal degrees -- default is deg/min/sec -- decimal degrees needs |format = dec local form = (frame.args.format or ""):lower():sub(1,3) if form ~= "dec" then form = "dms" end -- just deal with best values frame.args.reqranks = setRanks("best") local qid, props = parseInput(frame, frame.args[1], propertyID) if not qid then return props -- either local parameter or nothing else local dv = props[1].mainsnak.datavalue.value local lat, long, prec = dv.latitude, dv.longitude, dv.precision lat = decimalPrecision(lat, prec) long = decimalPrecision(long, prec) local lat_long = { lat, long } lat_long["display"] = disp lat_long["format"] = form -- invoke template Coord with the values stored in the table return frame:expandTemplate{title = 'coord', args = lat_long} end end ------------------------------------------------------------------------------- -- getQualifierValue is used to get a formatted value of a qualifier -- -- The call needs: a property (the unnamed parameter or 1=) -- a target value for that property (pval=) -- a qualifier for that target value (qual=) -- The usual whitelisting and blacklisting of the property is implemented -- The boolean onlysourced= parameter can be set to return nothing -- when the property is unsourced (or only sourced to Wikipedia) ------------------------------------------------------------------------------- -- Dependencies: parseParam(); setRanks(); parseInput(); sourced(); -- propertyvalueandquals(); assembleoutput(); -- labelOrId(); i18n.latestdatequalifier(); format_Date(); -- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); ------------------------------------------------------------------------------- p.getQualifierValue = function(frame) -- The property ID that will have a qualifier is the first unnamed parameter local propertyID = mw.text.trim(frame.args[1] or "") -- The value of the property we want to match whose qualifier value is to be returned -- is passed in named parameter |pval= local propvalue = frame.args.pval -- The property ID of the qualifier -- whose value is to be returned is passed in named parameter |qual= local qualifierID = frame.args.qual -- A filter can be set like this: filter=P642==Q22674854 local filter, fprop, fval local ftable = mw.text.split(frame.args.filter or "", "==") if ftable[2] then fprop = mw.text.trim(ftable[1]) fval = mw.text.trim(ftable[2]) filter = true end -- onlysourced is a boolean passed to return qualifiers -- only when property values are sourced to something other than Wikipedia -- if nothing or an empty string is passed set it true -- if "false" or "no" or 0 is passed set it false local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true) -- set a language object and language code in the frame.args table frame.args.langobj = findLang(frame.args.lang) frame.args.lang = frame.args.langobj.code -- set the requested ranks flags frame.args.reqranks = setRanks(frame.args.rank) -- check for locally supplied parameter in second unnamed parameter -- success means no local parameter and the property exists local qid, props = parseInput(frame, frame.args[2], propertyID) if qid then local out = {} -- Scan through the values of the property -- we want something like property is P793, significant event (in propertyID) -- whose value is something like Q385378, construction (in propvalue) -- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID) for k1, v1 in pairs(props) do if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then -- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then if onlysrc == false or sourced(v1) then -- if we've got this far, we have a (sourced) claim with qualifiers -- which matches the target, so apply the filter and find the value(s) of the qualifier we want if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then local quals = v1.qualifiers[qualifierID] if quals then -- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean) local qargs = frame.args qargs.onlysourced = "no" local vals = propertyvalueandquals(quals, qargs, qid) for k, v in ipairs(vals) do out[#out + 1] = v end end end end -- of check for sourced end -- of check for matching required value and has qualifiers end -- of check for wikibase entity end -- of loop through values of propertyID return assembleoutput(out, frame.args, qid, propertyID) else return props -- either local parameter or nothing end -- of test for success return nil end ------------------------------------------------------------------------------- -- getSumOfParts scans the property 'has part' (P527) for values matching a list. -- The list is passed in parameter vlist. -- It consists of a string of Qids separated by spaces or any usual punctuation. -- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed. -- The sum is returned as a number or nothing if zero. ------------------------------------------------------------------------------- -- Dependencies: _getsumofparts; ------------------------------------------------------------------------------- p.getSumOfParts = function(frame) local sum = _getsumofparts(frame.args) if sum == 0 then return end return sum end ------------------------------------------------------------------------------- -- getValueByQual gets the value of a property which has a qualifier with a given entity value -- The call needs: -- a property ID (the unnamed parameter or 1=Pxxx) -- the ID of a qualifier for that property (qualID=Pyyy) -- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz) -- or a string value for that qualifier (qvalue=abc123) -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented ------------------------------------------------------------------------------- -- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; -- assembleoutput; ------------------------------------------------------------------------------- p.getValueByQual = function(frame) local qualID = frame.args.qualID -- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue= local qval = frame.args.qvalue or "" if qval == "" then return "no qualifier value supplied" end local function checkQID(id) return id == qval end return _getvaluebyqual(frame, qualID, checkQID) end ------------------------------------------------------------------------------- -- getValueByLang gets the value of a property which has a qualifier P407 -- ("language of work or name") whose value has the given language code -- The call needs: -- a property ID (the unnamed parameter or 1=Pxxx) -- the MediaWiki language code to match the language (lang=xx[-yy]) -- (if no code is supplied, it uses the default language) -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented ------------------------------------------------------------------------------- -- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput; ------------------------------------------------------------------------------- p.getValueByLang = function(frame) -- The language code for the qualifier we want to match is in named parameter |lang= local langcode = findLang(frame.args.lang).code local function checkLanguage(id) -- id should represent a language like "British English (Q7979)" -- it should have string property "Wikimedia language code (P424)" -- qlcode will be a table: local qlcode = mw.wikibase.getBestStatements(id, "P424") if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then return true end end return _getvaluebyqual(frame, "P407", checkLanguage) end ------------------------------------------------------------------------------- -- getValueByRefSource gets the value of a property which has a reference "stated in" (P248) -- whose value has the given entity-ID. -- The call needs: -- a property ID (the unnamed parameter or 1=Pxxx) -- the entity ID of a value to match where the reference is stated in (match=Qzzz) -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p.getValueByRefSource = function(frame) -- The property ID that we want to check is the first unnamed parameter local propertyID = mw.text.trim(frame.args[1] or ""):upper() if propertyID == "" then return "no property supplied" end -- The Q-id of the value we want to match is in named parameter |qvalue= local qval = (frame.args.match or ""):upper() if qval == "" then qval = "Q21540096" end local unit = (frame.args.unit or ""):upper() if unit == "" then unit = "Q4917" end local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true) -- set the requested ranks flags frame.args.reqranks = setRanks(frame.args.rank) -- set a language object and code in the frame.args table frame.args.langobj = findLang(frame.args.lang) frame.args.lang = frame.args.langobj.code local linked = parseParam(frame.args.linked, true) local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false) -- qid not nil means no local parameter and the property exists local qid, props = parseInput(frame, frame.args[2], propertyID) if qid then local out = {} local mlt= {} for k1, v1 in ipairs(props) do if onlysrc == false or sourced(v1) then if v1.references then for k2, v2 in ipairs(v1.references) do if v2.snaks.P248 then for k3, v3 in ipairs(v2.snaks.P248) do if v3.datavalue.value.id == qval then out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit) if not mlt[#out] then -- we only need one match per property value -- unless datatype was monolingual text break end end -- of test for match end -- of loop through values "stated in" end -- of test that "stated in" exists end -- of loop through references end -- of test that references exist end -- of test for sourced end -- of loop through values of propertyID if #mlt > 0 then local langcode = frame.args.lang langcode = mw.text.split( langcode, '-', true )[1] local fbtbl = mw.language.getFallbacksFor( langcode ) table.insert( fbtbl, 1, langcode ) local bestval = "" local found = false for idx1, lang1 in ipairs(fbtbl) do for idx2, lang2 in ipairs(mlt) do if (lang1 == lang2) and not found then bestval = out[idx2] found = true break end end -- loop through values of property end -- loop through fallback languages if found then -- replace output table with a table containing the best value out = { bestval } else -- more than one value and none of them on the list of fallback languages -- sod it, just give them the first one out = { out[1] } end end return assembleoutput(out, frame.args, qid, propertyID) else return props -- no property or local parameter supplied end -- of test for success end ------------------------------------------------------------------------------- -- getPropertyIDs takes most of the usual parameters. -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented. -- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity. -- Otherwise it returns nothing. ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p._getPropertyIDs = function(args) args.reqranks = setRanks(args.rank) args.langobj = findLang(args.lang) args.lang = args.langobj.code -- change default for noicon to true args.noicon = tostring(parseParam(args.noicon or "", true)) local f = {} f.args = args local pid = mw.text.trim(args[1] or ""):upper() -- get the qid and table of claims for the property, or nothing and the local value passed local qid, props = parseInput(f, args[2], pid) if not qid then return props end if not props[1] then return nil end local onlysrc = parseParam(args.onlysourced or args.osd, true) local maxvals = tonumber(args.maxvals) or 0 local out = {} for i, v in ipairs(props) do local snak = v.mainsnak if ( snak.datatype == "wikibase-item" ) and ( v.rank and args.reqranks[v.rank:sub(1, 1)] ) and ( snak.snaktype == "value" ) and ( sourced(v) or not onlysrc ) then out[#out+1] = snak.datavalue.value.id end if maxvals > 0 and #out >= maxvals then break end end return assembleoutput(out, args, qid, pid) end p.getPropertyIDs = function(frame) local args = frame.args return p._getPropertyIDs(args) end ------------------------------------------------------------------------------- -- getQualifierIDs takes most of the usual parameters. -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented. -- It takes a property-id as the first unnamed parameter, and an optional parameter qlist -- which is a list of qualifier property-ids to search for (default is "ALL") -- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity. -- Otherwise it returns nothing. ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p.getQualifierIDs = function(frame) local args = frame.args args.reqranks = setRanks(args.rank) args.langobj = findLang(args.lang) args.lang = args.langobj.code -- change default for noicon to true args.noicon = tostring(parseParam(args.noicon or "", true)) local f = {} f.args = args local pid = mw.text.trim(args[1] or ""):upper() -- get the qid and table of claims for the property, or nothing and the local value passed local qid, props = parseInput(f, args[2], pid) if not qid then return props end if not props[1] then return nil end -- get the other parameters local onlysrc = parseParam(args.onlysourced or args.osd, true) local maxvals = tonumber(args.maxvals) or 0 local qlist = args.qlist or "" if qlist == "" then qlist = "ALL" end qlist = qlist:gsub("[%p%s]+", " ") .. " " local out = {} for i, v in ipairs(props) do local snak = v.mainsnak if ( v.rank and args.reqranks[v.rank:sub(1, 1)] ) and ( snak.snaktype == "value" ) and ( sourced(v) or not onlysrc ) then if v.qualifiers then for k1, v1 in pairs(v.qualifiers) do if qlist == "ALL " or qlist:match(k1 .. " ") then for i2, v2 in ipairs(v1) do if v2.datatype == "wikibase-item" and v2.snaktype == "value" then out[#out+1] = v2.datavalue.value.id end -- of test that id exists end -- of loop through qualifier values end -- of test for kq in qlist end -- of loop through qualifiers end -- of test for qualifiers end -- of test for rank value, sourced, and value exists if maxvals > 0 and #out >= maxvals then break end end -- of loop through property values return assembleoutput(out, args, qid, pid) end ------------------------------------------------------------------------------- -- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters) -- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2 -- of each of those wikibase-items. -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p._getPropOfProp = function(args) -- parameter sets for commonly used groups of parameters local paraset = tonumber(args.ps or args.parameterset or 0) if paraset == 1 then -- a common setting args.rank = "best" args.fetchwikidata = "ALL" args.onlysourced = "no" args.noicon = "true" elseif paraset == 2 then -- equivalent to raw args.rank = "best" args.fetchwikidata = "ALL" args.onlysourced = "no" args.noicon = "true" args.linked = "no" args.pd = "true" elseif paraset == 3 then -- third set goes here end args.reqranks = setRanks(args.rank) args.langobj = findLang(args.lang) args.lang = args.langobj.code local pid1 = args.prop1 or args.pid1 or "" local pid2 = args.prop2 or args.pid2 or "" if pid1 == "" or pid2 == "" then return nil end local f = {} f.args = args local qid1, statements1 = parseInput(f, args[1], pid1) -- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata if not qid1 then return statements1 end -- otherwise it returns the qid and a table for the statement local onlysrc = parseParam(args.onlysourced or args.osd, true) local maxvals = tonumber(args.maxvals) or 0 local qualID = mw.text.trim(args.qual or ""):upper() if qualID == "" then qualID = nil end local out = {} for k, v in ipairs(statements1) do if not onlysrc or sourced(v) then local snak = v.mainsnak if snak.datatype == "wikibase-item" and snak.snaktype == "value" then local qid2 = snak.datavalue.value.id local statements2 = {} if args.reqranks.b then statements2 = mw.wikibase.getBestStatements(qid2, pid2) else statements2 = mw.wikibase.getAllStatements(qid2, pid2) end if statements2[1] then local out2 = propertyvalueandquals(statements2, args, qualID) out[#out+1] = assembleoutput(out2, args, qid2, pid2) end end -- of test for valid property1 value end -- of test for sourced if maxvals > 0 and #out >= maxvals then break end end -- of loop through values of property1 return assembleoutput(out, args, qid1, pid1) end p.getPropOfProp = function(frame) local args= frame.args if not args.prop1 and not args.pid1 then args = frame:getParent().args if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end end return p._getPropOfProp(args) end ------------------------------------------------------------------------------- -- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received), -- then it examines each of those awards for P2517 (category for recipients of this award). -- If it exists, it returns the corresponding category, -- with the item's P734 (family name) as sort key, or no sort key if there is no family name. -- The sort key may be overridden by the parameter |sortkey (alias |sk). -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p.getAwardCat = function(frame) frame.args.reqranks = setRanks(frame.args.rank) frame.args.langobj = findLang(frame.args.lang) frame.args.lang = frame.args.langobj.code local args = frame.args args.sep = " " local pid1 = args.prop1 or "P166" local pid2 = args.prop2 or "P2517" if pid1 == "" or pid2 == "" then return nil end -- locally supplied value: local localval = mw.text.trim(args[1] or "") local qid1, statements1 = parseInput(frame, localval, pid1) if not qid1 then return localval end -- linkprefix (strip quotes) local lp = (args.linkprefix or args.lp or ""):gsub('"', '') -- sort key (strip quotes, hyphens and periods): local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '') -- family name: local famname = "" if sk == "" then local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1] local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or "" famname = mw.wikibase.getSitelink(p734id) or "" -- strip namespace and disambigation local pos = famname:find(":") or 0 famname = famname:sub(pos+1):gsub("%s%(.+%)$", "") if famname == "" then local lbl = mw.wikibase.getLabel(p734id) famname = lbl and mw.text.nowiki(lbl) or "" end end local onlysrc = parseParam(args.onlysourced or args.osd, true) local maxvals = tonumber(args.maxvals) or 0 local qualID = mw.text.trim(args.qual or ""):upper() if qualID == "" then qualID = nil end local out = {} for k, v in ipairs(statements1) do if not onlysrc or sourced(v) then local snak = v.mainsnak if snak.datatype == "wikibase-item" and snak.snaktype == "value" then local qid2 = snak.datavalue.value.id local statements2 = {} if args.reqranks.b then statements2 = mw.wikibase.getBestStatements(qid2, pid2) else statements2 = mw.wikibase.getAllStatements(qid2, pid2) end if statements2[1] and statements2[1].mainsnak.snaktype == "value" then local qid3 = statements2[1].mainsnak.datavalue.value.id local sitelink = mw.wikibase.getSitelink(qid3) -- if there's no local sitelink, create the sitelink from English label if not sitelink then local lbl = mw.wikibase.getLabelByLang(qid3, "en") if lbl then if lbl:sub(1,9) == "Category:" then sitelink = mw.text.nowiki(lbl) else sitelink = "Category:" .. mw.text.nowiki(lbl) end end end if sitelink then if sk ~= "" then out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]" elseif famname ~= "" then out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]" else out[#out+1] = "[[" .. lp .. sitelink .. "]]" end -- of check for sort keys end -- of test for sitelink end -- of test for category end -- of test for wikibase item has a value end -- of test for sourced if maxvals > 0 and #out >= maxvals then break end end -- of loop through values of property1 return assembleoutput(out, args, qid1, pid1) end ------------------------------------------------------------------------------- -- getIntersectCat takes most of the usual parameters. -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented -- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship) -- Each property's value is a wiki-base entity -- For each value of the first parameter (ranks implemented) it fetches the value's main category -- and then each value of the second parameter (possibly substituting a simpler description) -- then it returns all of the categories representing the intersection of those properties, -- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from). -- The item's P734 (family name) is the sort key, or no sort key if there is no family name. -- The sort key may be overridden by the parameter |sortkey (alias |sk). ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput; ------------------------------------------------------------------------------- p.getIntersectCat = function(frame) frame.args.reqranks = setRanks(frame.args.rank) frame.args.langobj = findLang(frame.args.lang) frame.args.lang = frame.args.langobj.code local args = frame.args args.sep = " " args.linked = "no" local pid1 = args.prop1 or "P106" local pid2 = args.prop2 or "P27" if pid1 == "" or pid2 == "" then return nil end local qid, statements1 = parseInput(frame, "", pid1) if not qid then return nil end local qid, statements2 = parseInput(frame, "", pid2) if not qid then return nil end -- topics like countries may have different names in categories from their label in Wikidata local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs") local join = args.join or "" local onlysrc = parseParam(args.onlysourced or args.osd, true) local maxvals = tonumber(args.maxvals) or 0 -- linkprefix (strip quotes) local lp = (args.linkprefix or args.lp or ""):gsub('"', '') -- sort key (strip quotes, hyphens and periods): local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '') -- family name: local famname = "" if sk == "" then local p734 = mw.wikibase.getBestStatements(qid, "P734")[1] local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or "" famname = mw.wikibase.getSitelink(p734id) or "" -- strip namespace and disambigation local pos = famname:find(":") or 0 famname = famname:sub(pos+1):gsub("%s%(.+%)$", "") if famname == "" then local lbl = mw.wikibase.getLabel(p734id) famname = lbl and mw.text.nowiki(lbl) or "" end end local cat1 = {} for k, v in ipairs(statements1) do if not onlysrc or sourced(v) then -- get the ID representing the value of the property local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id if pvalID then -- get the topic's main category (P910) for that entity local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1] if p910 and p910.mainsnak.snaktype == "value" then local tmcID = p910.mainsnak.datavalue.value.id -- use sitelink or the English label for the cat local cat = mw.wikibase.getSitelink(tmcID) if not cat then local lbl = mw.wikibase.getLabelByLang(tmcID, "en") if lbl then if lbl:sub(1,9) == "Category:" then cat = mw.text.nowiki(lbl) else cat = "Category:" .. mw.text.nowiki(lbl) end end end cat1[#cat1+1] = cat end -- of test for topic's main category exists end -- of test for property has vaild value end -- of test for sourced if maxvals > 0 and #cat1 >= maxvals then break end end local cat2 = {} for k, v in ipairs(statements2) do if not onlysrc or sourced(v) then local cat = rendersnak(v, args) if subs[cat] then cat = subs[cat] end cat2[#cat2+1] = cat end if maxvals > 0 and #cat2 >= maxvals then break end end local out = {} for k1, v1 in ipairs(cat1) do for k2, v2 in ipairs(cat2) do if sk ~= "" then out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]" elseif famname ~= "" then out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]" else out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]" end -- of check for sort keys end end args.noicon = "true" return assembleoutput(out, args, qid, pid1) end ------------------------------------------------------------------------------- -- qualsToTable takes most of the usual parameters. -- The usual whitelisting, blacklisting, onlysourced, etc. are implemented. -- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item. -- It takes a list of qualifier property IDs as |quals= -- For a given qid and property, it creates the rows of an html table, -- each row being a value of the property (optionally only if the property matches the value in |pval= ) -- each cell being the first value of the qualifier corresponding to the list in |quals ------------------------------------------------------------------------------- -- Dependencies: parseParam; setRanks; parseInput; sourced; ------------------------------------------------------------------------------- p.qualsToTable = function(frame) local args = frame.args local quals = args.quals or "" if quals == "" then return "" end args.reqranks = setRanks(args.rank) local propertyID = mw.text.trim(args[1] or "") local f = {} f.args = args local entityid, props = parseInput(f, "", propertyID) if not entityid then return "" end args.langobj = findLang(args.lang) args.lang = args.langobj.code local pval = args.pval or "" local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table for i, v in ipairs(qplist) do qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise end local col1 = args.firstcol or "" if col1 ~= "" then col1 = col1 .. "</td><td>" end local emptycell = args.emptycell or "&nbsp;" -- construct a 2-D array of qualifier values in qvals local qvals = {} for i, v in ipairs(props) do local skip = false if pval ~= "" then local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id if pid ~= pval then skip = true end end if not skip then local qval = {} local vqualifiers = v.qualifiers or {} -- go through list of wanted qualifier properties for i1, v1 in ipairs(qplist) do -- check for that property ID in the statement's qualifiers local qv, qtype if vqualifiers[v1] then qtype = vqualifiers[v1][1].datatype if qtype == "time" then if vqualifiers[v1][1].snaktype == "value" then qv = mw.wikibase.renderSnak(vqualifiers[v1][1]) qv = frame:expandTemplate{title="dts", args={qv}} else qv = "?" end elseif qtype == "url" then if vqualifiers[v1][1].snaktype == "value" then qv = mw.wikibase.renderSnak(vqualifiers[v1][1]) local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" ) if display then qv = "[" .. qv .. " " .. display .. "]" end end else qv = mw.wikibase.formatValue(vqualifiers[v1][1]) end end -- record either the value or a placeholder qval[i1] = qv or emptycell end -- of loop through list of qualifiers -- add the list of qualifier values as a "row" in the main list qvals[#qvals+1] = qval end end -- of for each value loop local out = {} for i, v in ipairs(qvals) do out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>" end return table.concat(out, "\n") end ------------------------------------------------------------------------------- -- getGlobe takes an optional qid of a Wikidata entity passed as |qid= -- otherwise it uses the linked item for the current page. -- If returns the Qid of the globe used in P625 (coordinate location), -- or nil if there isn't one. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getGlobe = function(frame) local qid = frame.args.qid or frame.args[1] or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end local coords = mw.wikibase.getBestStatements(qid, "P625")[1] local globeid if coords and coords.mainsnak.snaktype == "value" then globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)") end return globeid end ------------------------------------------------------------------------------- -- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid= -- It returns one of the following in order of preference: -- the Commons sitelink of the linked Wikidata item; -- the Commons sitelink of the topic's main category of the linked Wikidata item; ------------------------------------------------------------------------------- -- Dependencies: _getCommonslink(); _getSitelink(); parseParam() ------------------------------------------------------------------------------- p.getCommonsLink = function(frame) local oc = frame.args.onlycat or frame.args.onlycategories local fb = parseParam(frame.args.fallback or frame.args.fb, true) return _getCommonslink(frame.args.qid, oc, fb) end ------------------------------------------------------------------------------- -- getSitelink takes the qid of a Wikidata entity passed as |qid= -- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink -- If the parameter is blank, then it uses the local wiki. -- If there is a sitelink to an article available, it returns the plain text link to the article -- If there is no sitelink, it returns nil. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getSiteLink = function(frame) return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or "")) end ------------------------------------------------------------------------------- -- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= -- If there is a sitelink to an article on the local Wiki, it returns a link to the article -- with the Wikidata label as the displayed text. -- If there is no sitelink, it returns the label as plain text. -- If there is no label in the local language, it displays the qid instead. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getLink = function(frame) local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "") if itemID == "" then return end local sitelink = mw.wikibase.getSitelink(itemID) local label = labelOrId(itemID) if sitelink then return "[[:" .. sitelink .. "|" .. label .. "]]" else return label end end ------------------------------------------------------------------------------- -- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= -- It returns the Wikidata label for the local language as plain text. -- If there is no label in the local language, it displays the qid instead. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getLabel = function(frame) local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "") if itemID == "" then return end local lang = frame.args.lang or "" if lang == "" then lang = nil end local label = labelOrId(itemID, lang) return label end ------------------------------------------------------------------------------- -- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= -- if no qid is supplied, it uses the qid associated with the current page. -- It returns the Wikidata label for the local language as plain text. -- If there is no label in the local language, it returns nil. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.label = function(frame) local qid = mw.text.trim(frame.args[1] or frame.args.qid or "") if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return end local lang = frame.args.lang or "" if lang == "" then lang = nil end local label, success = labelOrId(qid, lang) if success then return label end end ------------------------------------------------------------------------------- -- getAT (Article Title) -- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= -- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text. -- If there is no sitelink or qid supplied, it returns nothing. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getAT = function(frame) local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "") if itemID == "" then return end return mw.wikibase.getSitelink(itemID) end ------------------------------------------------------------------------------- -- getDescription has the qid of a Wikidata entity passed as |qid= -- (it defaults to the associated qid of the current article if omitted) -- and a local parameter passed as the first unnamed parameter. -- Any local parameter passed (other than "Wikidata" or "none") becomes the return value. -- It returns the article description for the Wikidata entity if the local parameter is "Wikidata". -- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getDescription = function(frame) local desc = mw.text.trim(frame.args[1] or "") local itemID = mw.text.trim(frame.args.qid or "") if itemID == "" then itemID = nil end if desc:lower() == 'wikidata' then return mw.wikibase.getDescription(itemID) elseif desc:lower() == 'none' then return nil else return desc end end ------------------------------------------------------------------------------- -- getAliases has the qid of a Wikidata entity passed as |qid= -- (it defaults to the associated qid of the current article if omitted) -- and a local parameter passed as the first unnamed parameter. -- It implements blacklisting and whitelisting with a field name of "alias" by default. -- Any local parameter passed becomes the return value. -- Otherwise it returns the aliases for the Wikidata entity with the usual list options. -- Nothing is returned if the aliases do not exist. ------------------------------------------------------------------------------- -- Dependencies: findLang(); assembleoutput() ------------------------------------------------------------------------------- p.getAliases = function(frame) local args = frame.args local fieldname = args.name or "" if fieldname == "" then fieldname = "alias" end local blacklist = args.suppressfields or args.spf or "" if blacklist:find(fieldname) then return nil end local localval = mw.text.trim(args[1] or "") if localval ~= "" then return localval end local whitelist = args.fetchwikidata or args.fwd or "" if whitelist == "" then whitelist = "NONE" end if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid or not mw.wikibase.entityExists(qid) then return nil end local aliases = mw.wikibase.getEntity(qid).aliases if not aliases then return nil end args.langobj = findLang(args.lang) local langcode = args.langobj.code args.lang = langcode local out = {} for k1, v1 in pairs(aliases) do if v1[1].language == langcode then for k1, v2 in ipairs(v1) do out[#out+1] = v2.value end break end end return assembleoutput(out, args, qid) end ------------------------------------------------------------------------------- -- pageId returns the page id (entity ID, Qnnn) of the current page -- returns nothing if the page is not connected to Wikidata ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.pageId = function(frame) return mw.wikibase.getEntityIdForCurrentPage() end ------------------------------------------------------------------------------- -- formatDate is a wrapper to export the private function format_Date ------------------------------------------------------------------------------- -- Dependencies: format_Date(); ------------------------------------------------------------------------------- p.formatDate = function(frame) return format_Date(frame.args[1], frame.args.df, frame.args.bc) end ------------------------------------------------------------------------------- -- location is a wrapper to export the private function _location -- it takes the entity-id as qid or the first unnamed parameter -- optional boolean parameter first toggles the display of the first item -- optional boolean parameter skip toggles the display to skip to the last item -- parameter debug=<y/n> (default 'n') adds error msg if not a location ------------------------------------------------------------------------------- -- Dependencies: _location(); ------------------------------------------------------------------------------- p.location = function(frame) local debug = (frame.args.debug or ""):sub(1, 1):lower() if debug == "" then debug = "n" end local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper() if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end if not qid then if debug ~= "n" then return i18n.errors["entity-not-found"] else return nil end end local first = mw.text.trim(frame.args.first or "") local skip = mw.text.trim(frame.args.skip or "") return table.concat( _location(qid, first, skip), ", " ) end ------------------------------------------------------------------------------- -- checkBlacklist implements a test to check whether a named field is allowed -- returns true if the field is not blacklisted (i.e. allowed) -- returns false if the field is blacklisted (i.e. disallowed) -- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}} -- displays "blacklisted" -- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}} -- displays "not blacklisted" ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.checkBlacklist = function(frame) local blacklist = frame.args.suppressfields or frame.args.spf or "" local fieldname = frame.args.name or "" if blacklist ~= "" and fieldname ~= "" then if blacklist:find(fieldname) then return false else return true end else -- one of the fields is missing: let's call that "not on the list" return true end end ------------------------------------------------------------------------------- -- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags -- otherwise it returns the argument unchanged (including leading/trailing space). -- If the argument may contain "=", then it must be called explicitly: -- |1=arg -- (In that case, leading and trailing spaces are trimmed) -- It finds use in infoboxes where it can replace tests like: -- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }} -- with a form that uses just a single call to Wikidata: -- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }} ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.emptyor = function(frame) local s = frame.args[1] or "" if s == "" then return nil end local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "") if sx == "" then return nil else return s end end ------------------------------------------------------------------------------- -- labelorid is a public function to expose the output of labelOrId() -- Pass the Q-number as |qid= or as an unnamed parameter. -- It returns the Wikidata label for that entity or the qid if no label exists. ------------------------------------------------------------------------------- -- Dependencies: labelOrId ------------------------------------------------------------------------------- p.labelorid = function(frame) return (labelOrId(frame.args.qid or frame.args[1])) end ------------------------------------------------------------------------------- -- getLang returns the MediaWiki language code of the current content. -- If optional parameter |style=full, it returns the language name. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getLang = function(frame) local style = (frame.args.style or ""):lower() local langcode = mw.language.getContentLanguage().code if style == "full" then return mw.language.fetchLanguageName( langcode ) end return langcode end ------------------------------------------------------------------------------- -- getItemLangCode takes a qid parameter (using the current page's qid if blank) -- If the item for that qid has property country (P17) it looks at the first preferred value -- If the country has an official language (P37), it looks at the first preferred value -- If that official language has a language code (P424), it returns the first preferred value -- Otherwise it returns nothing. ------------------------------------------------------------------------------- -- Dependencies: _getItemLangCode() ------------------------------------------------------------------------------- p.getItemLangCode = function(frame) return _getItemLangCode(frame.args.qid or frame.args[1]) end ------------------------------------------------------------------------------- -- findLanguage exports the local findLang() function -- It takes an optional language code and returns, in order of preference: -- the code if a known language; -- the user's language, if set; -- the server's content language. ------------------------------------------------------------------------------- -- Dependencies: findLang ------------------------------------------------------------------------------- p.findLanguage = function(frame) return findLang(frame.args.lang or frame.args[1]).code end ------------------------------------------------------------------------------- -- getQid returns the qid, if supplied -- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists -- failing that, the Wikidata entity ID associated with the current page, if it exists -- otherwise, nothing ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getQid = function(frame) local qid = (frame.args.qid or ""):upper() -- check if a qid was passed; if so, return it: if qid ~= "" then return qid end -- check if there's a "category's main topic (P301)": qid = mw.wikibase.getEntityIdForCurrentPage() if qid then local prop301 = mw.wikibase.getBestStatements(qid, "P301") if prop301[1] then local mctid = prop301[1].mainsnak.datavalue.value.id if mctid then return mctid end end end -- otherwise return the page qid (if any) return qid end ------------------------------------------------------------------------------- -- followQid takes four optional parameters: qid, props, list and all. -- If qid is not given, it uses the qid for the connected page -- or returns nil if there isn't one. -- props is a list of properties, separated by punctuation. -- If props is given, the Wikidata item for the qid is examined for each property in turn. -- If that property contains a value that is another Wikibase-item, that item's qid is returned, -- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces. -- If |list= is set to a template, the qids are passed as arguments to the template. -- If props is not given, the qid is returned. ------------------------------------------------------------------------------- -- Dependencies: parseParam() ------------------------------------------------------------------------------- p._followQid = function(args) local qid = (args.qid or ""):upper() local all = parseParam(args.all, false) local list = args.list or "" if list == "" then list = nil end if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return nil end local out = {} local props = (args.props or ""):upper() if props ~= "" then for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate p = mw.text.trim(p) for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id if linkedid then if all then out[#out+1] = linkedid else return linkedid end -- test for all or just the first one found end -- test for value exists for that property end -- loop through values of property to follow end -- loop through list of properties to follow end if #out > 0 then local ret = "" if list then ret = mw.getCurrentFrame():expandTemplate{title = list, args = out} else ret = table.concat(out, " ") end return ret else return qid end end p.followQid = function(frame) return p._followQid(frame.args) end ------------------------------------------------------------------------------- -- globalSiteID returns the globalSiteID for the current wiki -- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.globalSiteID = function(frame) return mw.wikibase.getGlobalSiteId() end ------------------------------------------------------------------------------- -- siteID returns the root of the globalSiteID -- e.g. "en" for "enwiki", "enwikisource", etc. -- treats "en-gb" as "en", etc. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.siteID = function(frame) local txtlang = frame:callParserFunction('int', {'lang'}) or "" -- This deals with specific exceptions: be-tarask -> be-x-old if txtlang == "be-tarask" then return "be_x_old" end local pos = txtlang:find("-") local ret = "" if pos then ret = txtlang:sub(1, pos-1) else ret = txtlang end return ret end ------------------------------------------------------------------------------- -- projID returns the code used to link to the reader's language's project -- e.g "en" for [[:en:WikidataIB]] -- treats "en-gb" as "en", etc. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.projID = function(frame) local txtlang = frame:callParserFunction('int', {'lang'}) or "" -- This deals with specific exceptions: be-tarask -> be-x-old if txtlang == "be-tarask" then return "be-x-old" end local pos = txtlang:find("-") local ret = "" if pos then ret = txtlang:sub(1, pos-1) else ret = txtlang end return ret end ------------------------------------------------------------------------------- -- formatNumber formats a number according to the the supplied language code ("|lang=") -- or the default language if not supplied. -- The number is the first unnamed parameter or "|num=" ------------------------------------------------------------------------------- -- Dependencies: findLang() ------------------------------------------------------------------------------- p.formatNumber = function(frame) local lang local num = tonumber(frame.args[1] or frame.args.num) or 0 lang = findLang(frame.args.lang) return lang:formatNum( num ) end ------------------------------------------------------------------------------- -- examine dumps the property (the unnamed parameter or pid) -- from the item given by the parameter 'qid' (or the other unnamed parameter) -- or from the item corresponding to the current page if qid is not supplied. -- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}} -- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these -- or {{#invoke:WikidataIB |examine |P26}} for the current page. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.examine = function( frame ) local args if frame.args[1] or frame.args.pid or frame.args.qid then args = frame.args else args = frame:getParent().args end local par = {} local pid = (args.pid or ""):upper() local qid = (args.qid or ""):upper() par[1] = mw.text.trim( args[1] or "" ):upper() par[2] = mw.text.trim( args[2] or "" ):upper() table.sort(par) if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end if pid == "" then pid = par[1] end if qid == "" then qid = par[2] end local q1 = qid:sub(1,1) if pid:sub(1,1) ~= "P" then return "No property supplied" end if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return "No item for this page" end return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>" end ------------------------------------------------------------------------------- -- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid) -- from the item given by the parameter 'qid' -- or from the Wikidata item associated with the current page if qid is not supplied. -- It only checks ranks that are requested (preferred and normal by default) -- If property is not supplied, then P31 (instance of) is assumed. -- It returns val if found or nothing if not found. -- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}} -- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}} -- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}} -- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.checkvalue = function( frame ) local args if frame.args.val then args = frame.args else args = frame:getParent().args end local val = args.val if not val then return nil end local pid = mw.text.trim(args.pid or args[1] or "P31"):upper() local qid = (args.qid or ""):upper() if pid:sub(1,1) ~= "P" then return nil end if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return nil end local ranks = setRanks(args.rank) local stats = {} if ranks.b then stats = mw.wikibase.getBestStatements(qid, pid) else stats = mw.wikibase.getAllStatements( qid, pid ) end if not stats[1] then return nil end if stats[1].mainsnak.datatype == "wikibase-item" then for k, v in pairs( stats ) do local ms = v.mainsnak if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then return val end end end return nil end ------------------------------------------------------------------------------- -- url2 takes a parameter url= that is a proper url and formats it for use in an infobox. -- If no parameter is supplied, it returns nothing. -- This is the equivalent of Template:URL -- but it keeps the "edit at Wikidata" pen icon out of the microformat. -- Usually it will take its url parameter directly from a Wikidata call: -- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }} ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.url2 = function(frame) local txt = frame.args.url or "" if txt == "" then return nil end -- extract any icon local url, icon = txt:match("(.+)&nbsp;(.+)") -- make sure there's at least a space at the end url = (url or txt) .. " " icon = icon or "" -- extract any protocol like https:// local prot = url:match("(https*://).+[ \"\']") -- extract address local addr = "" if prot then addr = url:match("https*://(.+)[ \"\']") or " " else prot = "//" addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " " end -- strip trailing / from end of domain-only url and add <wbr/> before . and / local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.") return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span>&nbsp;" .. icon end ------------------------------------------------------------------------------- -- getWebsite fetches the Official website (P856) and formats it for use in an infobox. -- This is similar to Template:Official website but with a url displayed, -- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled. -- A local value will override the Wikidata value. "NONE" returns nothing. -- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }} ------------------------------------------------------------------------------- -- Dependencies: findLang(); parseParam(); ------------------------------------------------------------------------------- p.getWebsite = function(frame) local url = frame.args.url or "" if url:upper() == "NONE" then return nil end local urls = {} local quals = {} local qid = frame.args.qid or "" if url and url ~= "" then urls[1] = url else if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return nil end local prop856 = mw.wikibase.getBestStatements(qid, "P856") for k, v in pairs(prop856) do if v.mainsnak.snaktype == "value" then urls[#urls+1] = v.mainsnak.datavalue.value if v.qualifiers and v.qualifiers["P1065"] then -- just take the first archive url (P1065) local au = v.qualifiers["P1065"][1] if au.snaktype == "value" then quals[#urls] = au.datavalue.value end -- test for archive url having a value end -- test for qualifers end -- test for website having a value end -- loop through website(s) end if #urls == 0 then return nil end local out = {} for i, u in ipairs(urls) do local link = quals[i] or u local prot, addr = u:match("(http[s]*://)(.+)") addr = addr or u local disp, n = addr:gsub("%.", "<wbr/>%.") out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>" end local langcode = findLang(frame.args.lang).code local noicon = parseParam(frame.args.noicon, false) if url == "" and not noicon then out[#out] = out[#out] .. createicon(langcode, qid, "P856") end local ret = "" if #out > 1 then ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out} else ret = out[1] end return ret end ------------------------------------------------------------------------------- -- getAllLabels fetches the set of labels and formats it for display as wikitext. -- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getAllLabels = function(frame) local args = frame.args or frame:getParent().args or {} local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end local labels = mw.wikibase.getEntity(qid).labels if not labels then return i18n["labels-not-found"] end local out = {} for k, v in pairs(labels) do out[#out+1] = v.value .. " (" .. v.language .. ")" end return table.concat(out, "; ") end ------------------------------------------------------------------------------- -- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext. -- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getAllDescriptions = function(frame) local args = frame.args or frame:getParent().args or {} local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end local descriptions = mw.wikibase.getEntity(qid).descriptions if not descriptions then return i18n["descriptions-not-found"] end local out = {} for k, v in pairs(descriptions) do out[#out+1] = v.value .. " (" .. v.language .. ")" end return table.concat(out, "; ") end ------------------------------------------------------------------------------- -- getAllAliases fetches the set of aliases and formats it for display as wikitext. -- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.getAllAliases = function(frame) local args = frame.args or frame:getParent().args or {} local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end local aliases = mw.wikibase.getEntity(qid).aliases if not aliases then return i18n["aliases-not-found"] end local out = {} for k1, v1 in pairs(aliases) do local lang = v1[1].language local val = {} for k1, v2 in ipairs(v1) do val[#val+1] = v2.value end out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")" end return table.concat(out, "; ") end ------------------------------------------------------------------------------- -- showNoLinks displays the article titles that should not be linked. ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- p.showNoLinks = function(frame) local out = {} for k, v in pairs(donotlink) do out[#out+1] = k end table.sort( out ) return table.concat(out, "; ") end ------------------------------------------------------------------------------- -- checkValidity checks whether the first unnamed parameter represents a valid entity-id, -- that is, something like Q1235 or P123. -- It returns the strings "true" or "false". -- Change false to nil to return "true" or "" (easier to test with #if:). ------------------------------------------------------------------------------- -- Dependencies: none ------------------------------------------------------------------------------- function p.checkValidity(frame) local id = mw.text.trim(frame.args[1] or "") if mw.wikibase.isValidEntityId(id) then return true else return false end end ------------------------------------------------------------------------------- -- getEntityFromTitle returns the Entity-ID (Q-number) for a given title. -- Modification of Module:ResolveEntityId -- The title is the first unnamed parameter. -- The site parameter determines the site/language for the title. Defaults to current wiki. -- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true. -- Returns the Q-number or nil if it does not exist. ------------------------------------------------------------------------------- -- Dependencies: parseParam ------------------------------------------------------------------------------- function p.getEntityFromTitle(frame) local args=frame.args if not args[1] then args=frame:getParent().args end if not args[1] then return nil end local title = mw.text.trim(args[1]) local site = args.site or "" local showdab = parseParam(args.showdab, true) local qid = mw.wikibase.getEntityIdForTitle(title, site) if qid then local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1] if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then return nil else return qid end end end ------------------------------------------------------------------------------- -- getDatePrecision returns the number representing the precision of the first best date value -- for the given property. -- It takes the qid and property ID -- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times -- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day -- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist. ------------------------------------------------------------------------------- -- Dependencies: parseParam; sourced; ------------------------------------------------------------------------------- function p.getDatePrecision(frame) local args=frame.args if not args[1] then args=frame:getParent().args end local default = tonumber(args[2] or args.default) or 0 local prop = mw.text.trim(args[1] or "") if prop == "" then return default end local qid = args.qid or "" if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end if not qid then return default end local onlysrc = parseParam(args.onlysourced or args.osd, true) local stat = mw.wikibase.getBestStatements(qid, prop) for i, v in ipairs(stat) do local prec = (onlysrc == false or sourced(v)) and v.mainsnak.datavalue and v.mainsnak.datavalue.value and v.mainsnak.datavalue.value.precision if prec then return prec end end return default end return p ------------------------------------------------------------------------------- -- List of exported functions ------------------------------------------------------------------------------- --[[ _getValue getValue getPreferredValue getCoords getQualifierValue getSumOfParts getValueByQual getValueByLang getValueByRefSource getPropertyIDs getQualifierIDs getPropOfProp getAwardCat getIntersectCat getGlobe getCommonsLink getSiteLink getLink getLabel label getAT getDescription getAliases pageId formatDate location checkBlacklist emptyor labelorid getLang getItemLangCode findLanguage getQID followQid globalSiteID siteID projID formatNumber examine checkvalue url2 getWebsite getAllLabels getAllDescriptions getAllAliases showNoLinks checkValidity getEntityFromTitle getDatePrecision --]] ------------------------------------------------------------------------------- o26pvdzoveksr04pobp213ncnrqerd6 မေႃႇၵျူး:Complex date 828 19132 112369 41115 2025-06-26T08:08:36Z Saimawnkham 5 112369 Scribunto text/plain --[[ __ __ _ _ ____ _ _ | \/ | ___ __| |_ _| | ___ _ / ___|___ _ __ ___ _ __ | | _____ __ __| | __ _| |_ ___ | |\/| |/ _ \ / _` | | | | |/ _ (_) | / _ \| '_ ` _ \| '_ \| |/ _ \ \/ / / _` |/ _` | __/ _ \ | | | | (_) | (_| | |_| | | __/_| |__| (_) | | | | | | |_) | | __/> < | (_| | (_| | || __/ |_| |_|\___/ \__,_|\__,_|_|\___(_)\____\___/|_| |_| |_| .__/|_|\___/_/\_\ \__,_|\__,_|\__\___| |_| This module is intended for creation of complex date phrases in variety of languages. Once deployed, please do not modify this code without applying the changes first at Module:Complex date/sandbox and testing at Module:Complex date/sandbox/testcases. Authors and maintainers: * User:Sn1per - first draft of the original version * User:Jarekt - corrections and expansion of the original version ]] -- List of external modules and functions local p = {Error = nil} local i18n = require('Module:i18n/complex date') -- used for translations of date related phrases local ISOdate = require('Module:ISOdate')._ISOdate -- used for parsing dates in YYYY-MM-DD and related formats local Calendar -- loaded lazily -- ================================================== -- === Internal functions =========================== -- ================================================== local function langSwitch(list,lang) local langList = mw.language.getFallbacksFor(lang) table.insert(langList,1,lang) table.insert(langList,math.max(#langList,2),'default') for i,language in ipairs(langList) do if list[language] then return list[language] end end end -- ================================================== local function formatnum1(numStr, lang) -- mostly require('Module:Formatnum').formatNum function used to translate a number to use different numeral characters, -- except that it it does not call that function unless the language is on the list "LList" local LList = {bn=1,bpy=1,kn=1,hi=1,mr=1,new=1,pa=1,gu=1,fa=1,glk=1,mzn=1,ur=1,ar=1,ckb=1,ks=1,lo=1,['or']=1,bo=1,['ml-old']=1,mn=1,te=1,th=1} if LList[lang] then -- call only when the language is on the list numStr = require('Module:Formatnum').formatNum(numStr, lang, 1) end return numStr end -- ================================================== local function getISODate(datestr, datetype, lang, num, case) -- translate dates in the format YYYY, YYYY-MM, and YYYY-MM-DD if not case and i18n.Translations[datetype] then -- look up the grammatical case needed and call ISOdate module local rec = langSwitch(i18n.Translations[datetype], lang) if type(rec)=='table' then case = rec.case[num] end end return ISOdate(datestr, lang, case, '', 1) end -- ======================================================================= local function translatePhrase(date1, date2, operation, lang, state) -- use tables in Module:i18n/complex date to translate a phrase if not i18n.Translations[operation] then p.Error = string.format('<span style="background-color:red;">Error in [[Module:Complex date]]: input parameter "%s" is not recognized.</span>', operation or 'nil') return '' end local dateStr = langSwitch(i18n.Translations[operation], lang) if type(dateStr)=='table' then dateStr = dateStr[1] end if type(dateStr)=='function' then local dateFunc = dateStr local nDates = i18n.Translations[operation]['nDates'] if nDates==2 then -- 2 date phrase dateStr = dateFunc(date1, date2, state) else -- 1 date phrase dateStr = dateFunc(date1, state) end end if type(dateStr)=='string' then -- replace parts of the string '$date1' and '$date2' with date1 and date2 strings dateStr = mw.ustring.gsub(dateStr, '$date1', date1) dateStr = mw.ustring.gsub(dateStr, '$date2', date2) else -- Special case of more complex phrases that can be build out of simple phrases -- If complex case is not translated to "lang" than build it out of simpler ones local x = dateStr dateStr = p._complex_date(x.conj, x.adj1, date1, x.units1, x.era1, x.adj2, date2, x.units2, x.era2, lang, 2) end return dateStr end -- ======================================================================= local function oneDatePhrase(dateStr, adj, era, units, lang, num, case, state) -- translate a single date phrase if num==2 then state.adj, state.era, state.units, state.precision = state.adj2, state.era2, state.units2, state.precision2 end -- dateStr can have many forms: ISO date, year or a number for -- decade, century or millennium if units == '' then -- unit is "year", "month", "day" dateStr = getISODate(dateStr, adj, lang, num, case) else -- units is "decade", "century", "millennium'' dateStr = translatePhrase(dateStr, '', units, lang, state) end -- add adjective ("early", "mid", etc.) or preposition ("before", "after", -- "circa", etc.) to the date if adj ~= '' then dateStr = translatePhrase(dateStr, '', adj, lang, state) else -- only era? dateStr = formatnum1(dateStr, lang) end -- add era if era ~= '' then dateStr = translatePhrase(dateStr, '', era, lang, state) end return dateStr end -- ======================================================================= local function twoDatePhrase(date1, date2, state, lang) -- translate a double date phrase local dateStr, case local era='' if state.era1 == state.era2 then -- if both eras are the same than add it only once era = state.era1 state.era1 = '' state.era2 = '' end case = {nil, nil} if i18n.Translations[state.conj] then local rec = langSwitch(i18n.Translations[state.conj], lang) if type(rec)=='table' then case = rec.case end end date1 = oneDatePhrase(date1, state.adj1, state.era1, state.units1, lang, 1, case[1], state) date2 = oneDatePhrase(date2, state.adj2, state.era2, state.units2, lang, 2, case[2], state) dateStr = translatePhrase(date1, date2, state.conj, lang, state) if era ~= '' then dateStr = translatePhrase(dateStr, '', era, lang, state) end return dateStr end -- ======================================================================= local function otherPhrases(date1, date2, operation, era, lang, state) -- translate specialized phrases local dateStr = '' if operation == 'islamic' then if date2=='' then date2 = mw.getCurrentFrame():callParserFunction('#time', 'xmY', date1) end date1 = getISODate(date1, operation, lang, 1, nil) date2 = getISODate(date2, operation, lang, 2, nil) if era == '' then era = 'ad' end dateStr = translatePhrase(date1, '', era, lang, state) .. ' (' .. translatePhrase(date2, '', 'ah', lang, state) .. ')' era = '' elseif operation == 'julian' then if not date2 and date1 then -- Convert from Julian to Gregorian calendar date if Calendar == nil then Calendar = require("Module:Calendar") -- lazy loding (only if needed) end local JDN = Calendar._date2jdn(date1, 0) if JDN then date2 = date1 -- first date is assumed to be Julian date1 = Calendar._jdn2date(JDN, 1) end end date1 = getISODate(date1, operation, lang, 1, nil) date2 = getISODate(date2, operation, lang, 2, nil) dateStr = translatePhrase(date1, date2, operation, lang, state) dateStr = mw.ustring.gsub(mw.ustring.gsub(dateStr, '%( ', '('), ' %)', ')') -- in case date2 is empty elseif operation == 'turn of the year' or operation == 'turn of the decade' or operation == 'turn of the century' then local dt = 1 if operation == 'turn of the decade' then dt=10 end if not date2 or date2=='' then date2=tostring(tonumber(date1)-dt) end if era~='bp' and era~='bc' then date1, date2 = date2, date1 end if operation == 'turn of the year' then date1 = ISOdate(date1, lang, '', '', 1) date2 = ISOdate(date2, lang, '', '', 1) else date1 = formatnum1(date1, lang) date2 = formatnum1(date2, lang) end dateStr = translatePhrase(date1, date2, operation, lang, state) elseif operation == 'year unknown' then dateStr = translatePhrase('', '', operation, lang, state) .. '<div style="display: none;">Unknown date</div>' elseif operation == 'unknown' then dateStr = tostring(mw.message.new( "exif-unknowndate" ):inLanguage( lang )) .. '<div style="display: none;">Unknown date</div>' end -- add era if era ~= '' then dateStr = translatePhrase(dateStr, '', era, lang, state) end return dateStr end -- ======================================================================= local function checkAliases(str1, str2, sType) -- some inputs have many aliases - reconcile them and ensure string is playing a proper role local out = '' if str1 and str1~='' then local a = i18n.Synonyms[str1] -- look up synonyms of "str1" if a then out = a[1] else p.Error = string.format('<span style="background-color:red;">Error in [[Module:Complex date]]: %s is not recognized.</span>', str1) end elseif str2 and str2~='' then -- if "str1" of type "sType" is empty than maybe ... local a = i18n.Synonyms[str2] -- ..."str2" is of the same type and is not empty if a and a[2]==sType then out = a[1] str2 = '' end end return out, str2 end -- ======================================================================= local function datePrecision(dateStr, units) -- "in this module "Units" is a string like millennium, century, or decade -- "precision" is wikibase compatible date precision number: 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day -- based on string or numeric input calculate "Units" and "precision" local precision if type(units)=='number' then precision = units if precision>11 then precision=11 end -- clip the range of precision values if precision==6 then units='millennium' elseif precision==7 then units='century' elseif precision==8 then units='decade' else units = '' end elseif type(units)=='string' then units = string.lower(units) if units=='millennium' then precision=6 elseif units=='century' then precision=7 elseif units=='decade' then precision=8 else precision=9 end end if units=='' or precision==9 then local sLen = mw.ustring.len(dateStr) if sLen<= 4 then precision=9 elseif sLen== 7 then precision=10 elseif sLen>=10 then precision=11 end units='' end if precision==6 and dateStr.match( dateStr, '%d000' )~=nil then dateStr = tostring(math.floor(tonumber(dateStr)/1000) +1) elseif precision==7 and mw.ustring.match( dateStr, '%d%d00' )~=nil then dateStr = tostring(math.floor(tonumber(dateStr)/100) +1) end return dateStr, units, precision end -- ======================================================================= local function isodate2timestamp(dateStr, precision, era) -- convert date string to timestamps used by Quick Statements local tStamp = nil if era == 'ah' or precision<6 then return nil elseif era ~= '' then local eraLUT = {ad='+', bc='-', bp='-' } era = eraLUT[era] else era='+' end -- convert isodate to timestamp used by quick statements if precision>=9 then if string.match(dateStr,"^%d%d%d%d$") then -- if YYYY format tStamp = era .. dateStr .. '-00-00T00:00:00Z/9' elseif string.match(dateStr,"^%d%d%d%d%-%d%d$") then -- if YYYY-MM format tStamp = era .. dateStr .. '-00T00:00:00Z/10' elseif string.match(dateStr,"^%d%d%d%d%-%d%d%-%d%d$") then -- if YYYY-MM-DD format tStamp = era .. dateStr .. 'T00:00:00Z/11' end elseif precision==8 then -- decade tStamp = era .. dateStr .. '-00-00T00:00:00Z/8' elseif precision==7 then -- century local d = tostring(tonumber(dateStr)-1) tStamp = era .. d .. '50-00-00T00:00:00Z/7' elseif precision==6 then local d = tostring(tonumber(dateStr)-1) tStamp = era .. d .. '500-00-00T00:00:00Z/6' end return tStamp end -- ======================================================================= local function oneDateQScode(dateStr, adj, era, precision) -- create QuickStatements string for "one date" dates local outputStr = '' local d = isodate2timestamp(dateStr, precision, era) if not d then return '' end local rLUT = { early='Q40719727' , mid='Q40719748', late='Q40719766', ['1quarter']='Q40690303' , ['2quarter']='Q40719649' , ['3quarter']='Q40719662', ['4quarter']='Q40719674', spring='Q40720559' , summer='Q40720564' , autumn='Q40720568' , winter='Q40720553', firsthalf='Q40719687', secondhalf='Q40719707' } local qLUT = {['from']='P580', ['until']='P582', ['after']='P1319', ['before']='P1326', ['by']='P1326'} local refine = rLUT[adj] local qualitier = qLUT[adj] if adj=='' then outputStr = d elseif adj=='circa' then outputStr = d..",P1480,Q5727902" elseif refine then outputStr = d..",P4241,"..refine elseif precision>7 and qualitier then local century = string.gsub(d, 'Z%/%d+', 'Z/7') outputStr = century ..",".. qualitier ..","..d end return outputStr end -- ======================================================================= local function twoDateQScode(date1, date2, state) -- create QuickStatements string for "two date" dates if state.adj1~='' or state.adj2~='' or state.era1~=state.era2 then return '' -- QuickStatements string are not generated for two date phrases with adjectives end local outputStr = '' local d1 = isodate2timestamp(date1, state.precision1, state.era1) local d2 = isodate2timestamp(date2, state.precision2, state.era2) if (not d1) or (not d2) then return '' end -- find date with lower precision in common to both dates local cd local year1 = tonumber(string.sub(d1,2,5)) local year2 = tonumber(string.sub(d2,2,5)) local k = 0 for i = 1,10,1 do if string.sub(d1,1,i)==string.sub(d2,1,i) then k = i -- find last matching letter end end if k>=9 then -- same month, since "+YYYY-MM-" is in common cd = isodate2timestamp(string.sub(d1,2,8), 10, state.era1) elseif k>=6 and k<9 then -- same year, since "+YYYY-" is in common cd = isodate2timestamp(tostring(year1), 9, state.era1) elseif k==4 then -- same decade(k=4, precision=8), since "+YYY" is in common cd = isodate2timestamp(tostring(year1), 8, state.era1) elseif k==3 then -- same century(k=3, precision=7) since "+YY" is in common local d = tostring(math.floor(year1/100) +1) -- convert 1999 -> 20 cd = isodate2timestamp( d, 7, state.era1) elseif k==2 then -- same millennium (k=2, precision=6), since "+Y" is in common local d = tostring(math.floor(year1/1000) +1) -- convert 1999 -> 2 cd = isodate2timestamp( d, 6, state.era1) end if not cd then return '' end --if not cd then -- return ' <br/>error: ' .. d1.." / " .. d2.." / ".. (cd or '') .." / ".. string.sub(d1,2,5).." / " .. string.sub(d2,2,5).." / " .. tostring(k) --end -- if (state.conj=='from-until') or (state.conj=='and' and year1==year2-1) then outputStr = cd ..",P580,".. d1 ..",P582,".. d2 elseif (state.conj=='between') or (state.conj=='or' and year1==year2-1) then outputStr = cd ..",P1319,".. d1 ..",P1326,".. d2 elseif state.conj=='circa2' then outputStr = cd ..",P1319,".. d1 ..",P1326,".. d2 ..",P1480,Q5727902" end return outputStr end -- ======================================================================= local function processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr) -- process inputs and save date in state array local state = {} state.conj = string.lower(conj or '') state.adj1 = string.lower(adj1 or '') state.adj2 = string.lower(adj2 or '') state.era1 = string.lower(era1 or '') state.era2 = string.lower(era2 or '') state.units1 = string.lower(units1 or '') state.units2 = string.lower(units2 or '') -- if date 1 is missing but date 2 is provided than swap them if date1 == '' and date2 ~= '' then date1 = date2 date2 = '' state = {adj1 = state.adj2, era1 = state.era2, units1 = state.units2, adj2 = '', era2 = '', units2 = '', conj=state.conj, num=1} end if date2 ~= '' then state.nDates = 2 elseif date1 ~= '' then state.nDates = 1 else state.nDates = 0 end -- reconcile alternative names for text inputs local conj = checkAliases(state.conj ,'' ,'j') state.adj1 ,conj = checkAliases(state.adj1 ,conj,'a') state.units1,conj = checkAliases(state.units1,conj,'p') state.era1 ,conj = checkAliases(state.era1 ,conj,'e') state.special,conj = checkAliases('',conj,'c') state.adj2 = checkAliases(state.adj2 ,'','a') state.units2 = checkAliases(state.units2,'','p') state.era2 = checkAliases(state.era2 ,'','e') state.conj = conj state.lang = lang if p.Error~=nil then return nil end -- calculate date precision value date1, state.units1, state.precision1 = datePrecision(date1, state.units1) date2, state.units2, state.precision2 = datePrecision(date2, state.units2) -- Handle special cases -- Some complex phrases can be created out of simpler ones. Therefore on pass # 1 we try to create -- the phrase using complex phrase and if that is not found than on the second pass we try to build -- the phrase out of the simpler ones if passNr==1 then if state.adj1=='circa' and state.nDates == 2 then state.conj = 'circa2' state.adj1 = '' state.adj2 = '' end if state.nDates == 2 and state.adj1=='late' and state.adj2=='early' and state.conj=='and' and state.units1==state.units2 and state.era1==state.era2 then if state.units1=='century' then state.conj='turn of the century' elseif state.units1=='decade' then state.conj='turn of the decade' elseif state.units1=='' then state.conj='turn of the year' end state.adj1 = '' state.adj2 = '' state.units1 = '' state.units2 = '' end end state.adj, state.era, state.units, state.precision = state.adj1, state.era1, state.units1, state.precision1 return date1, date2, state end -- ================================================== -- === External functions =========================== -- ================================================== function p.Era(frame) -- process inputs local dateStr local args = frame.args if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language end local lang = args['lang'] local dateStr = args['date'] or '' local eraType = string.lower(args['era'] or '') dateStr = ISOdate(dateStr, lang, '', '', 1) if eraType then eraType = checkAliases(eraType ,'','e') dateStr = translatePhrase(dateStr, '', eraType, lang, {}) end return dateStr end -- ======================================================================= function p._complex_date(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr) local Output='' local state -- process inputs and save date in state array date1, date2, state = processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr) if p.Error~=nil then return nil end local errorStr = string.format( '\n*conj=%s, adj1=%s, era1=%s, unit1=%s, prec1=%i, adj2=%s, era2=%s, unit2=%s, prec2=%i, special=%s', state.conj, state.adj1, state.era1, state.units1, state.precision1, state.adj2, state.era2, state.units2, state.precision2, state.special) -- call specialized functions local QScode = '' if state.special~='' then Output = otherPhrases(date1, date2, state.special, state.era1, lang, state) elseif state.conj~='' then QScode = twoDateQScode(date1, date2, state) Output = twoDatePhrase(date1, date2, state, lang) elseif state.adj1~='' or state.era1~='' or state.units1~='' then Output = oneDatePhrase(date1, state.adj1, state.era1, state.units1, lang, 1, nil, state) QScode = oneDateQScode(date1, state.adj1, state.era1, state.precision1) elseif date1~='' then Output = ISOdate(date1, lang, '', 'dtstart', '100-999') end if p.Error~=nil then return errorStr end -- if there is any wikicode in the string than execute it if mw.ustring.find(Output, '{') then Output = mw.getCurrentFrame():preprocess(Output) end if QScode and #QScode>0 then QScode = ' <div style="display: none;">date QS:P,' .. QScode .. '</div>' end return Output .. QScode end -- ======================================================================= function p._complex_date_cer(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, certainty, lang) -- same as p._complex_date but with extra parameter for certainty: probably, possibly, presumably, etc. local dateStr = p._complex_date(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, 1) certainty = checkAliases(certainty, conj, 'r') local LUT = {probably='Q56644435', presumably='Q18122778', possibly='Q30230067', circa='Q5727902' } if certainty and LUT[certainty] then local state = {} date1, date2, state = processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, 1) dateStr = translatePhrase(dateStr, '', certainty, lang, state) dateStr = string.gsub(dateStr, '(%<div style="display: none;"%>date QS:P,[^%<]+)(%</div%>)', '%1,P1480,' .. LUT[certainty] .. '%2' ) end return dateStr end -- ======================================================================= function p.complex_date(frame) -- process inputs local dateStr local args = frame.args if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language end local date1 = args['date1'] or args['2'] or args['date'] or '' local date2 = args['date2'] or args['3'] or '' local conj = args['conj'] or args['1'] or '' local adj1 = args['adj1'] or args['adj'] or '' local adj2 = args['adj2'] or '' local units1 = args['precision1'] or args['precision'] or '' local units2 = args['precision2'] or args['precision'] or '' local era1 = args['era1'] or args['era'] or '' local era2 = args['era2'] or args['era'] or '' local certainty = args['certainty'] local lang = args['lang'] dateStr = p._complex_date_cer(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, certainty, lang) if p.Error~=nil then dateStr = p.Error .. '[[Category:Pages using Complex date template with incorrect parameter]]' end return dateStr end return p ppv1t08ydt8a9x36u2iltdsomq7mcr5 မေႃႇၵျူး:I18n/complex date 828 19133 112361 41116 2025-06-26T08:01:23Z Saimawnkham 5 112361 Scribunto text/plain --[[ __ __ _ _ ___ _ ___ __ _ _ _ | \/ | ___ __| |_ _| | ___ _|_ _/ |( _ ) _ __ / /__ ___ _ __ ___ _ __ | | _____ __ __| | __ _| |_ ___ | |\/| |/ _ \ / _` | | | | |/ _ (_)| || |/ _ \| '_ \ / / __/ _ \| '_ ` _ \| '_ \| |/ _ \ \/ / / _` |/ _` | __/ _ \ | | | | (_) | (_| | |_| | | __/_ | || | (_) | | | |/ / (_| (_) | | | | | | |_) | | __/> < | (_| | (_| | || __/ |_| |_|\___/ \__,_|\__,_|_|\___(_)___|_|\___/|_| |_/_/ \___\___/|_| |_| |_| .__/|_|\___/_/\_\ \__,_|\__,_|\__\___| |_| This code was copied from Commons please request changes there. Maintainers: *Jarekt ]] local function Ordinal(...) return require('Module:Ordinal-cd')._Ordinal(...) end local function Roman(...) return require('Module:Roman-cd')._Numeral(...) end -- ========================================================================== -- === Local Helper functions ============================================== -- ========================================================================== -- form of French "of" based on "precision", which is wikibase compatible date precision format: -- 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day -- 1 2 3 4 5 mill cent deca year month day local frOf = {'du','du','du','du','du', 'du', 'du', 'de', 'de', 'de', 'du'} local function decYear(state,lang,case) --Declension of word "year" in several languages if state.precision == 9 then yearCase = { fi={xxx='vuosien', gen='vuoden', ill='vuoteen', ptv='vuotta', ela='vuodesta', ine='vuonna'}, sl={insP='letoma', ins='letom', gen='leta', loc='letu'}, hsb={insP='lětami', ins='lětom', gen='lěta', loc='lěće'} } return yearCase[lang][case] .. ' ' else return '' end end local function decCentury(lang,case) --Declension of word "century" in several languages centuryCase = { pl={nom='wiek', gen='wieku', ins='wiekiem', loc='wieku', default = 'wiek'}, hsb={nom='lětstotk', gen='lětstotka', ins='lětstotkom', loc='lětstotku', default = 'lětstotk'} } return centuryCase[lang][case] or centuryCase[lang]['default'] end local function decMillennium(lang,case) --Declension of word "century" in several languages millenniumCase = { pl={nom='tysiąclecie', gen='tysiąclecia', ins='tysiącleciem', loc='tysiącleciu', default = 'tysiąclecie'}, hsb={nom='lěttysac', gen='lěttysaca', ins='lěttysacom', loc='lěttysacu', default = 'lěttysac'} } return millenniumCase[lang][case] or millenniumCase[lang]['default'] end -- ========================================================================== -- === Output data structure =============================================== -- ========================================================================== local p = {} --[[ Multiple formats are possible: 1) string with key words "$date1" and "$date2" which will be replaced later by the date strings 2) function which can be used to create output string * Function INPUTS: - date1 and date2 string with date strings. "$date1" and "$date2" can also be used which will be replaced latter - state is a table with full description of the phrase we are trying to construct. It includes state.precision1 (and 2) which is wikibase compatible date precision format: 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day 3) table with following fields: * table[1] is either string or a function * table.case is a 2 element table with Grammatical cases used by given language to alter month name or other adjective related to date # 1 and 2 ]] p.Translations = { -- ========================================== -- === Two date phrases ===================== -- ========================================== ['from-until'] = { nDates = 2, ar='من $date1 إلى $date2', ['be-tarask']={'з $date1 да $date2', case={'gen','gen'}}, bn='$date1 থেকে $date2 পর্যন্ত', ca='$date1 fins $date2', ckb='لە $date1 تاوەکوو $date2', cs='$date1 až $date2', da='fra $date1 til $date2', de='$date1 bis $date2', el='από $date1 έως $date2', en='from $date1 until $date2', ['en-gb']='from $date1 until $date2', ['en-ca']='from $date1 until $date2', eo='de $date1 al $date2', es='de $date1 a $date2', et='$date1 kuni $date2', fa='از $date1 تا $date2', fi='$date1–$date2', -- välisenä aikana fr=function(date1, date2, state) -- could actually be better should be "d'octobre à mars 2013' not "de octore 2013 à mars 2013" if state.precision > 10 then -- precision > month return 'du $date1 au $date2' else -- "DE septebmbre" / "D'octobre" return require("Module:Linguistic").of(date1, 'fr') .. " à $date2" end end, gl='de $date1 a $date2', --Template:From until used 'desde $date1 ata $date2' he='מ- $date1 עד $date2', hr='od $date1 do $date2', hsb={'wot $date1 do $date2', case={'gen','gen'}}, hu='$date1 – $date2', it='dal $date1 al $date2', ja='$date1から$date2まで', mk='од $date1 до $date2', ml='$date1 മുതൽ $date2 വരെ', nb='fra $date1 til $date2', nds='$date1 bet $date2', nn='fra $date1 til $date2', nl='$date1 tot $date2', no='fra $date1 til $date2', pl={'od $date1 do $date2', case={'gen','gen'}}, ro='din $date1 până în $date2', pt='de $date1 a $date2', qu="$date1 p'unchawmanta $date2 p\'unchawkama", ru={'с $date1 по $date2', case={'gen','gen'}}, sk={'od $date1 do $date2', case={'gen','gen'}}, sl={'od $date1 do $date2', case={'gen','gen'}}, sv='från $date1 till $date2', uk={'з $date1 до $date2', case={'gen','gen'}}, ur='از $date1 تا $date2', vi='từ $date1 đến $date2', ['zh-hans']='从$date1到$date2', ['zh-hant']='從$date1到$date2', default='<span style="color:red">$date1 - $date2</span>', }, ['between']={ nDates = 2, ar='بين $date1 و $date2', ['be-tarask']={'між $date1 і $date2', case={'ins','ins'}}, bn='$date1 এবং $date2-এর মাঝামাঝি', ca='entre $date1 i $date2', ckb='لەنێوان $date1 و $date2', cs={'mezi $date1 a $date2', case={'ins','ins'}}, da='mellem $date1 og $date2', de='zwischen $date1 und $date2', el='μεταξύ $date1 και $date2', en='between $date1 and $date2', ['en-gb']='between $date1 and $date2', ['en-ca']='between $date1 and $date2', eo='inter $date1 kaj $date2', es='entre $date1 y $date2', et='$date1 ja $date2 vahel', fa='بین $date1 و $date2', fi={function(date1, date2, state) return decYear(state,'fi','xxx') .. '$date1 ja $date2 välisenä aikana' end, case={'gen','gen'}}, fr='entre $date1 et $date2', gl='entre $date1 e $date2', he='בין $date1 ו- $date2', hr='između $date1 i $date2', hsb={'mjez $date1 a $date2', case={'ins','ins'}}, hu='$date1 és $date2 között', hi='$date1 और $date2 के बीच', it='tra il $date1 e il $date2', ja='$date1と$date2の間', mk='помеѓу $date1 и $date2', ml='$date1, $date2 എന്നിവയ്ക്കിടയ്ക്ക്', nb='mellom $date1 og $date2', nds='twischen $date1 un $date2', nn='mellom $date1 og $date2', nl='tussen $date1 en $date2', no='mellom $date1 og $date2', pl={'między $date1 a $date2', case={'ins','ins'}}, ro='între $date1 și $date2', pt='entre $date1 e $date2', qu="$date1 p'unchawpa $date2 p'unchawpapas chawpin", ru={'между $date1 и $date2', case={'ins','ins'}}, sk={'medzi $date1 a $date2', case={'ins','ins'}}, sl={function(date1, date2, state) return 'med ' .. decYear(state,'sl','insP') .. '$date1 in $date2' end, case={'ins','ins'}}, sv='mellan $date1 och $date2', uk={'між $date1 та $date2', case={'ins','ins'}}, ur='بین $date1 و $date2', vec='tra el $date1 e el $date2', vi='giữa $date1 và $date2', ['zh-hans']='在$date1到$date2之间', ['zh-hant']='在$date1到$date2之間', default='<span style="color:red">$date1 - $date2</span>', }, ['or'] = { nDates = 2, ar='$date1 أو $date2', ['be-tarask']='$date1 ці $date2', bn='$date1 অথবা $date2', ca='$date1 o $date2', ckb='$date1 یان $date2', cs='$date1 nebo $date2', da='$date1 eller $date2', de='$date1 oder $date2', el='$date1 ή $date2', en='$date1 or $date2', ['en-gb']='$date1 or $date2', ['en-ca']='$date1 or $date2', eo='$date1 aŭ $date2', es='$date1 o $date2', et='$date1 või $date2', fa='$date1 یا $date2', fi='$date1 tai $date2', fr='$date1 ou $date2', gl='$date1 ou $date2', he='$date1 או $date2', hr='$date1 ili $date2', hsb='$date1 abo $date2', hu='$date1 vagy $date2', it='$date1 o $date2', ja='$date1または$date2', mk='$date1 или $date2', ml='$date1 അഥവാ $date2', nb='$date1 eller $date2', nn='$date1 eller $date2', nds='$date1 oder $date2', nl='$date1 of $date2', no='$date1 eller $date2', pl='$date1 lub $date2', pt='$date1 ou $date2', qu='$date1 icha $date2', ro='$date1 sau $date2', ru='$date1 или $date2', sk='$date1 alebo $date2', sl='$date1 ali $date2', sv='$date1 eller $date2', uk='$date1 або $date2', ur='$date1 یا $date2', th='$date1 หรือ $date2', vi='$date1 hoặc $date2', ['zh-hans']='$date1或$date2', ['zh-hant']='$date1或$date2', default=function(date1, date2, state) return require("Module:linguistic").conj({date1, date2}, state.lang, 'or') end, }, ['and'] = { nDates = 2, ar='$date1 و $date2', ['be-tarask']='$date1 і $date2', bn='$date1 এবং $date2', ca='$date1 i $date2', ckb='$date1 و $date2', cs='$date1 a $date2', da='$date1 og $date2', de='$date1 und $date2', el='$date1 και $date2', en='$date1 and $date2', ['en-gb']='$date1 and $date2', ['en-ca']='$date1 and $date2', eo='$date1 kaj $date2', es='$date1 y $date2', et='$date1 ja $date2', fa='$date1 و $date2', fi='$date1 ja $date2', fr='$date1 et $date2', gl='$date1 e $date2', he='$date1 ו- $date2', hu='$date1 és $date2', hsb='$date1 a $date2', it='$date1 e $date2', ja='$date1および$date2', mk='$date1 и $date2', ml='$date1 ഒപ്പം $date2', nb='$date1 og $date2', nn='$date1 og $date2', nds='$date1 un $date2', nl='$date1 en $date2', no='$date1 og $date2', pl='$date1 i $date2', pt='$date1 e $date2', qu='$date1wan $date2pas', ro='$date1 și $date2', ru='$date1 и $date2', sk='$date1 a $date2', sl='$date1 in $date2', sv='$date1 och $date2', uk='$date1 та $date2', ur='$date1 و $date2', vi='$date1 và $date2', ['zh-hans']='$date1和$date2', ['zh-hant']='$date1和$date2', default=function(date1, date2, state) return require("Module:linguistic").conj({date1, date2}, state.lang, 'and') end, }, -- ========================================== -- === Prepositions ========================= -- ========================================== ['by'] = { nDates = 1, ar='حوالي $date1', ['be-tarask']={'да $date1', case={'gen',''}}, bn='$date1 কর্তৃক', ca='vers $date1', ckb='نزیکی $date1', cs={'kolem $date1', case={'gen',''}}, da='mod $date1', de='spätestens $date1', el='έως $date1', en='by $date1', ['en-gb']='by $date1', ['en-ca']='by $date1', eo='ne post $date1', es='para $date1', et='hiljemalt $date1', fa='توسط $date1', fi={function(date1, state) return decYear(state,'fi','ill') .. '$date1 mennessä' end, case={'ill',''}}, fr='$date1 (au plus tard)', gl='cara a $date1', he='עד $date1', hr='do $date1', hsb={'do $date1', case={'gen',''}}, it='entro il $date1', ja='$date1まで', mk='кон $date1', ml='$date1-ൽ', nb='innen $date1', nn='innan $date1', nds='$date1 oder vördem al', nl='tegen $date1', no='innen $date1', pl={'przed $date1', case={'ins',''}}, pt='por $date1', qu="$date1 p'unchawkama", ro='de $date1', ru={'к $date1', case={'dat',''}}, sk={'okolo $date1', case={'gen',''}}, sl={function(date1, state) return 'najpozneje ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='senast $date1', uk={'до $date1', case={'dat',''}}, ur='توسط $date1', vi='vào $date1', -- need to insert "đã" somewhere later in the sentence --> ['zh-hans']='$date1前后', ['zh-hant']='$date1前后', default='<span style="color:red">by $date1</span>', }, ['before'] = { nDates = 1, ar='قبل $date1', ['be-tarask']={'перад $date1', case={'ins',''}}, bn='$date1-এর আগে', bg='Преди $date1', ca='abans $date1', ckb='پێش $date1', cs={'před $date1', case={'ins',''}}, da='før $date1', de='vor $date1', el='πριν από $date1', en='before $date1', ['en-gb']='before $date1', ['en-ca']='before $date1', eo='antaŭ $date1', es='antes de $date1', et='enne $date1', fa='پیش از $date1', fi={function(date1, state) return 'ennen ' .. decYear(state,'fi','ptv') .. '$date1' end, case={'ptv',''}}, fr='avant $date1', gl='antes do $date1', he='לפני $date1', hr='prije $date1', hsb={'do $date1', case={'gen',''}}, hu='$date1 előtt', it='prima del $date1', ja='$date1より前', mk='пред $date1', ml='$date1-നു മുമ്പ്', nb='før $date1', nn='før $date1', nds='vör $date1', nl='voor $date1', no='før $date1', pl={'przed $date1', case={'ins',''}}, pt='antes de $date1', qu="$date1 p'unchaw ñawpan", ro='înainte de $date1', ru={'ранее $date1', case={'gen',''}}, sk={'pred $date1', case={'ins',''}}, sl={function(date1, state) return 'pred ' .. decYear(state,'sl','ins') .. ' $date1' end, case={'ins',''}}, sv='före $date1', uk={'до $date1', case={'gen',''}}, ur='قبل $date1', vi='trước $date1', ['zh-hans']='在$date1之前', ['zh-hant']='在$date1之前', default='<span style="color:red">before $date1</span>', }, ['from'] = { nDates = 1, ar='من $date1', ['be-tarask']={'з $date1', case={'gen',''}}, bn='$date1 থেকে', ckb='لە $date1', cs={'od $date1', case={'gen',''}}, de='Seit $date1', el='από $date1', en='from $date1', ['en-gb']='from $date1', ['en-ca']='from $date1', eo='ekde $date1', es='desde $date1', et='alates $date1', fa='از $date1', fi={function(date1, state) return decYear(state,'fi','ela') .. '$date1 alkaen' end, case={'ela',''}}, fr= function(date1, state) return 'à partir '.. frOf[state.precision] ..' $date1' end, gl='desde o $date1', he='מ- $date1', hr='od $date1', hsb={'wot $date1', case={'gen',''}}, it='dal $date1', ja='$date1から', nds='vonaf $date1', mk='од $date1', nb='fra $date1', nn='frå $date1', ml='$date1 മുതൽ', nl='vanaf $date1', no='fra $date1', pl={'od $date1', case={'gen',''}}, qu="$date1 p'unchawmanta", ro='din $date1', ru={'С $date1', case={'gen',''}}, sk={'od $date1', case={'gen',''}}, sl={function(date1, state) return 'od ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='från $date1', uk={'з $date1', case={'gen',''}}, ur='از $date1', vi='từ $date1', ['zh-hans']='自$date1', ['zh-hant']='自$date1', default='<span style="color:red">from $date1</span>', }, ['until'] = { nDates = 1, ['be-tarask']={'усутыч да $date1', case={'gen',''}}, bn='$date1 পর্যন্ত', ckb='تاوەکوو $date1', cs={'do $date1', case={'gen', ''}}, de='bis $date1', en='until $date1', ['en-gb']='until $date1', ['en-ca']='until $date1', eo='ĝis $date1', es='hasta $date1', fr=function(date1, state) if state.precision > 10 then -- precision > month return "jusqu'au $date1" else return "jusqu'à $date1" end end, hr='do $date1', hsb={'do $date1', case={'gen',''}}, it='al $date1', nb='til $date1', nl='tot $date1', nn='til $date1', ml='$date1 വരെ', pl={'do $date1', case={'gen',''}}, ru={'вплоть до $date1', case={'gen',''}}, sk={'do $date1', case={'gen', ''}}, uk={'аж до $date1', case={'gen',''}}, ur='تک $date1', ['zh-hans']='直到$date1', ['zh-hant']='直到$date1', default='<span style="color:red">until $date1</span>', }, ['after'] = { nDates = 1, ar='بعد $date1', ['be-tarask']={'пасьля $date1', case={'gen',''}}, bn='$date1-এর পরে', ca='després de $date1', ckb='دوای $date1', cs={'po $date1', case={'loc',''}}, de='nach $date1', da='efter $date1', el='μετά από $date1', en='after $date1', ['en-gb']='after $date1', ['en-ca']='after $date1', eo='post $date1', es='después de $date1', et='pärast $date1', fa='پس از $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 jälkeen' end, case={'gen',''}}, fr='après $date1', gl='despois do $date1', he='לאחר $date1', hr='nakon $date1', hu='$date1 után', hsb={'po $date1', case={'loc',''}}, it='dopo il $date1', ja='$date1より後', mk='по $date1', ml='$date1-നു ശേഷം', nb='etter $date1', nn='etter $date1', nds='na $date1', nl='na $date1', no='etter $date1', pl={'po $date1', case={'loc',''}}, pt='após $date1', qu="$date1 p'unchaw qhipan", ro='după $date1', ru={'после $date1', case={'gen',''}}, sk={'po $date1', case={'loc',''}}, sl={function(date1, state) return 'po ' .. decYear(state,'sl','loc') .. ' $date1' end, case={'loc',''}}, sv='efter $date1', uk={'після $date1', case={'gen',''}}, ur='بعد $date1', vi='sau $date1', ['zh-hans']='在$date1之后', ['zh-hant']='在$date1之後', default='<span style="color:red">after $date1</span>', }, -- ========================================== -- === Adjectives =========================== -- ========================================== ['early'] = { nDates = 1, ar='بداية $date1', ['be-tarask']={'пачатак $date1', case={'gen',''}}, bn='$date1-এর শুরুতে', ca='al principi de $date1', ckb='سەرەتای $date1', cs={'začátek $date1', case={'gen',''}}, da='tidlig $date1', de='Anfang $date1', el='αρχές του $date1', en='early $date1', ['en-gb']='early $date1', ['en-ca']='early $date1', eo='komence de $date1', es='a principios de $date1', et='$date1 algus', fa='اوایل $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 alku' end, case={'gen',''}}, fr='début $date1', gl='a principios de $date1', he='תחילת $date1', hr='početak $date1', hsb={'spočatk $date1', case={'gen',''}}, hu='$date1 elején', it='inizio del $date1', ja='$date1初頭', mk='почеток на $date1', ml='$date1 ആദ്യപാദം', nb='tidlig $date1', nn='tidleg $date1', nds='Anfang $date1', nl='begin $date1', no='tidlig $date1', pl={'początek $date1', case={'gen',''}}, pt='a princípios de $date1', qu="$date1 ñawpaq p'unchawkunapi", ro='începând cu $date1', ru={'начало $date1', case={'gen',''}}, sk={'začiatok $date1', case={'gen',''}}, sl=function(date1, state)-- could actually be better should be "d'octobre à mars 2013' not "de octore 2013 à mars 2013" if state.precision == 9 then -- precision > month return 'zgodnje leto $date1' else -- "DE septebmbre" / "D'octobre" return 'zgodnji $date1' end end, sv='början av $date1', uk={'початок $date1', case={'gen',''}}, ur='ابتدا $date1', vi='đầu năm $date1', ['zh-hans']='$date1早期', ['zh-hant']='$date1早期', default='<span style="color:red">early $date1</span>', }, ['mid'] = { nDates = 1, ar='منتصف $date1', ['be-tarask']={'сярэдзіна $date1', case={'gen',''}}, bn='$date1-এর মাঝামাঝি', ca='a mitjan $date1', ckb='ناوەڕاستی $date1', cs={'polovina $date1', case={'gen',''}}, da='midten af $date1', de='Mitte $date1', el='μέσα του $date1', en='mid $date1', ['en-gb']='mid $date1', ['en-ca']='mid $date1', eo='meze de $date1', es='a mediados de $date1', et='$date1 keskel', fa='اواسط $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 puoliväli' end, case={'gen',''}}, fr='mi $date1', gl='a mediados de $date1', he='אמצע $date1', hr='sredina $date1', hsb={'srjedź $date1', case={'gen',''}}, hu='$date1 közepén', it='metà del $date1', ja='$date1半ば', mk='средина на $date1', ml='$date1 മദ്ധ്യം', nb='midten av $date1', nn='midten av $date1', nds='Midd $date1', nl='midden $date1', no='midten av $date1', pl={'środek $date1', case={'gen',''}}, pt='meados de $date1', qu="$date1 chawpin p'unchawkunapi", ro='mijlocul lui $date1', ru={'середина $date1', case={'gen',''}}, sk={'polovica $date1', case={'gen',''}}, sl={function(date1, state) return 'sredina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='mitten av $date1', uk={'середина $date1', case={'gen',''}}, ur='وسط $date1', vi='giữa năm $date1', ['zh-hans']='$date1中期', ['zh-hant']='$date1中期', default='<span style="color:red">mid $date1</span>', }, ['late'] = { nDates = 1, ar='نهاية $date1', bn='$date1-এর শেষে', ['be-tarask']={'канец $date1', case={'gen',''}}, ca='al final de $date1', ckb='کۆتاییی $date1', cs='konec $date1', da='sen $date1', de='Ende $date1', el='τέλη του $date1', en='late $date1', ['en-gb']='late $date1', ['en-ca']='late $date1', eo='fine de $date1', es='a fines de $date1', et='$date1 lõpp', fa='اواخر $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 loppu' end, case={'gen',''}}, fr='fin $date1', gl='a finais de $date1', he='סוף $date1', hr='kraj $date1', hsb={'kónc $date1', case={'gen',''}}, hu='$date1 végén', it='fine del $date1', ja='$date1末', mk='крајот на $date1', ml='$date1 അന്ത്യപാദം', nb='sent $date1', no='seint $date1', nds='Enn $date1', nl='eind $date1', no='sent $date1', pl={'koniec $date1', case={'gen',''}}, pt='ao final de $date1', qu="$date1 qhipaq p'unchawkunapi", ro='sfârșitul lui $date1', ru={'конец $date1', case={'gen',''}}, sk={'koniec $date1', case={'gen',''}}, sl={function(date1, state) return 'pozno ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='slutet av $date1', uk={'кінець $date1', case={'gen',''}}, ur='اخیر $date1', vi='cuối năm $date1', ['zh-hans']='$date1晚期', ['zh-hant']='$date1晚期', default='<span style="color:red">late $date1</span>', }, ['circa'] = { nDates = 1, ar='حوالي $date1', ['be-tarask']={'каля $date1', case={'gen',''}}, bn='প্রায় $date1', ckb='بەنزیکی $date1', ca='cap a $date1', cs='cca $date1', da='ca. $date1', de='etwa $date1', el='περ. $date1', en='c. $date1', ['en-gb']='circa $date1', ['en-ca']='circa $date1', eo='ĉirkaŭ $date1', es='hacia $date1', -- suggestion use "hacia"/"hacia el" or leave the latin circa or ca. et='ca. $date1', fa='حوالی $date1', -- template:Circa used 'حدود $date1' fi={function(date1, state) return 'suunnilleen ' .. decYear(state,'fi','ine') .. '$date1' end, case={'ine',''}}, -- template:Circa used 'noin $date1' fr=function(date1, state) if state.precision >= 11 then -- precision >= day return 'vers le $date1' else return 'vers $date1' end end, gl='entre $date1', -- template:Circa used 'cara a $date1' he='בסביבות $date1', hr='oko $date1', hsb={'wokoło $date1', case={'gen',''}}, hu='$date1 körül', it='$date1 circa', ja='$date1頃', ko='$date1경', mk='~ $date1', -- template:Circa used 'o. $date1' ml= 'ഉദ്ദേശം $date1', nb='ca. $date1', nn='ca. $date1', nds='üm un bi $date1', nl='ca. $date1', no='ca. $date1', pl={'około $date1', case={'gen',''}}, pt='cerca de $date1', qu='$date1chá', ro='circa $date1', ru={'около $date1', case={'gen',''}}, sk='cca $date1', sl={function(date1, state) return 'ok. ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='c:a $date1', -- template:Circa used 'ca $date1' uk={'близько $date1', case={'gen', ''}}, ur='قریباً $date1', vi='vào khoảng $date1', ['zh-hans']='约$date1', ['zh-hant']='約$date1', default='<span style="color:red">circa $date1</span>', }, ['uncertain'] = { nDates = 1, ['zh-hans']='$date1(?)', ['zh-hant']='$date1(?)', default='$date1 (?)', }, probably = { -- see Q56644435 nDates = 1, ast = 'probablemente $date1', bn = 'সম্ভবত $date1', ca = 'probablement $date1', ckb = 'لەوانەیە $date1', cs = 'pravděpodobně $date1', de = 'wahrscheinlich $date1', el = 'πιθανόν $date1', en = 'probably $date1', ['en-gb']='probably $date1', ['en-ca']='probably $date1', eo = 'probable $date1', es = 'probable $date1', fa = 'احتمالاً $date1', fr = 'probablement $date1', he = 'כפי הנראה $date1', hu = 'feltehetőleg $date1', it = 'probabile $date1', mk = 'веројатно $date1', ml = 'ഒരുപക്ഷേ $date1', nl = 'waarschijnlijk $date1', pl = 'prawdopodobnie $date1', pt = 'provavelmente $date1', ru = 'вероятно $date1', sv = 'antagligen $date1', uk = 'ймовірно $date1', default='<span style="color:red">probably $date1</span>', }, possibly = { -- see Q30230067 nDates = 1, ast = 'posiblemente $date1', bn = 'যথাসম্ভব $date1', ckb = 'لەوانەیە $date1', cs = 'možná $date1', de = 'möglicherweise $date1', en = 'possibly $date1', ['en-gb']='possibly $date1', ['en-ca']='possibly $date1', eo = 'eble $date1', el = 'πιθανόν $date1', fa = 'احتمالاً $date1', fr = 'peut-être $date1', hu = 'talán $date1', mk = 'можеби $date1', ml = 'മിക്കവാറും $date1', nl = 'mogelijk $date1', pl = 'być może $date1', pt = 'possivelmente $date1', ro = 'poate $date1', ru = 'возможно $date1', sv = 'möjligen $date1', uk = 'можливо $date1', default='<span style="color:red">possibly $date1</span>', }, presumably = { -- see Q18122778 nDates = 1, ast = 'presumiblemente $date1', ckb = 'دەشێت $date1', de = 'vermutlich $date1', en = 'presumably $date1', ['en-gb']='presumably $date1', ['en-ca']='presumably $date1', fr = 'présumé $date1', it = 'presumibilmente $date1', ml = 'ഊഹപ്രകാരം $date1', ru = 'предположительно $date1', pl = 'przypuszczalnie $date1', uk = 'здогадно $date1', default='<span style="color:red">presumably $date1</span>', }, ['year unknown']= { nDates = 0, ca='Any desconegut', ['be-tarask']='Год невядомы', bn='অজানা বছর', ckb='ساڵی نەزاندراو', cs='neznámý rok', de='Jahr unbekannt', el='άγνωστο έτος', en='year unknown', ['en-gb']='year unknown', ['en-ca']='year unknown', eo='jaro nesciata', es='Año desconocido', fa='سال نامعلوم', fi='tuntematon vuosi', fr='Année inconnue', he='שנה לא ידועה', hsb='lěto njeznate', hr='nepoznata godina', it='anno sconosciuto', ja='年代不明', la='Sine anno', ml='വർഷം ലഭ്യമല്ല', mk='непозната година', nb='ukjent år', nn='ukjent år', nl='zonder jaar', no='ukjent år', pl='rok nieznany', qu='Mana riqsisqa wata', ru='Год неизвестен', sk='neznámy rok', sl='neznano leto', sv='Okänt år', uk='рік невідомий', ur='سال نامعلوم', vi='không rõ năm', ['zh-hans']='年份未知', ['zh-hant']='年份未知', default='<span style="color:red">year unknown</span>', }, -- ========================================== -- === Parts of a whole ===================== -- ========================================== ['firsthalf'] = { nDates = 1, ar='النصف الأول من $date1', ['be-tarask']={'першая палова $date1', case={'gen',''}}, bn='$date1-এর প্রথমার্ধ', ca='1a meitat de $date1', ckb='نیوەی یەکەمی $date1', cs={'1. polovina $date1', case={'gen',''}}, da='1. halvdel af $date1', de='1. Hälfte $date1', el='πρώτο μισό του $date1', en='first half of $date1', ['en-gb']='first half of $date1', ['en-ca']='first half of $date1', eo='unua duono de $date1', es='primera mitad de $date1', et='$date1 esimene pool', fa='نیمهٔ نخست $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 alkupuolisko' end, case={'gen',''}}, fr='1<sup>re</sup> moitié de $date1', gl='primeira metade de $date1', he='במחצית הראשונה של $date1', hsb={'prěnja połojca $date1', case={'gen',''}}, hu='$date1 első felében', hr='prva polovina $date1', it='prima metà del $date1', ja='$date1上半期', mk='прва половина на $date1', ml='$date1 ആദ്യപകുതി', nb='første halvdel av $date1', nn='fyrste halvdelen av $date1', nds='1. Helft $date1', nl='eerste helft $date1', no='første halvdel av $date1', pl={'pierwsza połowa $date1', case={'gen',''}}, pt='primeira metade de $date1', qu='$date1 ñawpaq kuskanpi', ro='prima jumătate a lui $date1', ru={'первая половина $date1', case={'gen',''}}, sk={'1. polovica $date1', case={'gen',''}}, sl={function(date1, state) return 'prva polovica ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='första halvan av $date1', uk={'перша половина $date1', case={'gen',''}}, ur='نصف اول $date1', vi='nửa đầu năm $date1', ['zh-hans']='$date1上半期', ['zh-hant']='$date1上半期', default='<span style="color:red">first half of $date1</span>', }, ['secondhalf'] = { nDates = 1, ar='النصف الثاني من $date1', ['be-tarask']={'другая палова $date1', case={'gen',''}}, bn='$date1-এর দ্বিতীয়ার্ধ', ca='2a meitat de $date1', ckb='نیوەی دووەمی $date1', cs={'2. polovina $date1', case={'gen',''}}, da='2. halvdel af $date1', de='2. Hälfte $date1', el='δεύτερο μισό του $date1', en='second half of $date1', ['en-gb']='second half of $date1', ['en-ca']='second half of $date1', eo='dua duono de $date1', es='segunda mitad de $date1', et='$date1 teine pool', fa='نیمهٔ دوم $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 loppupuolisko' end, case={'gen',''}}, fr='2<sup>e</sup> moitié de $date1', gl='segunda metade de $date1', he='במחצית השנייה של $date1', hsb={'druha połojca $date1', case={'gen',''}}, hr='druga polovina $date1', hu='$date1 második felében', it='seconda metà del $date1', ja='$date1下半期', mk='втора половина на $date1', ml='$date1 രണ്ടാം പകുതി', nb='andre halvdel av $date1', nn='andre halvdelen av $date1', nds='2. Helft vun $date1', nl='tweede helft $date1', no='andre halvdel av $date1', pl={'druga połowa $date1', case={'gen',''}}, pt='segunda metade de $date1', qu='$date1 qhipaq kuskanpi', ro='a doua jumătate a lui $date1', ru={'вторая половина $date1', case={'gen',''}}, sk={'2. polovica $date1', case={'gen',''}}, sl={'druga polovica {{IfNum | $date0 | leta}} $date1', case={'gen',''}}, sv='andra halvan av $date1', uk={'друга половина $date1', case={'gen',''}}, ur='نصف آخر $date1', vi='nửa cuối năm $date1', ['zh-hans']='$date1下半期', ['zh-hant']='$date1下半期', default='<span style="color:red">second half of $date1</span>', }, ['1quarter']= { nDates = 1, bn='$date1-এর প্রথম ত্রৈমাসিক', ['be-tarask']={'першая чвэрць $date1', case={'gen',''}}, ckb='چارەکی یەکەمی $date1', cs={'1. čtvrtina $date1', case={'gen',''}}, de='erstes Viertel $date1', en='first quarter of $date1', ['en-gb']='first quarter of $date1', ['en-ca']='first quarter of $date1', eo='unua kvarono de $date1', es='primer cuarto del $date1', fa='ربع نخست $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 ensimmäinen neljännes' end, case={'gen',''}}, fr= function(date1, state) return 'premier quart '.. frOf[state.precision] ..' $date1' end, he='רבעון ראשון של $date1', hsb={'prěnja štwórćina $date1', case={'gen',''}}, hr='prva četvrtina $date1', it='primo quarto del $date1', ja='$date1第1四半期', ml='$date1 ഒന്നാം ത്രൈമാസം', nb='første kvartal av $date1', nl='eerste kwart $date1', nn='fyrste kvartalet av $date1', no='første kvartal av $date1', pl={'pierwsza ćwiartka $date1', case={'gen',''}}, qu='$date1 ñawpaq ñiqin tawa phatmanpi', ru={'первая четверть $date1', case={'gen',''}}, sk={'1. štvrtina $date1', case={'gen',''}}, sl={'prva četrtina {{IfNum | $date0 | leta}} $date1', case={'gen',''}}, sl={function(date1, state) return 'prva četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='första kvartalet av $date1', uk={'1-ша чверть $date1', case={'gen',''}}, ur='پہلی سہ ماہی $date1', vi='quý 1 năm $date1', ['zh-hans']='$date1第一季度', ['zh-hant']='$date1第一季度', default='<span style="color:red">first quarter of $date1</span>', }, ['2quarter']= { nDates = 1, ['be-tarask']={'другая чвэрць $date1', case={'gen',''}}, bn='$date1-এর দ্বিতীয় ত্রৈমাসিক', ckb='چارەکی دووەمی $date1', cs={'2. čtvrtina $date1', case={'gen',''}}, de='zweites Viertel $date1', en='second quarter of $date1', ['en-gb']='second quarter of $date1', ['en-ca']='second quarter of $date1', eo='dua kvarono de $date1', es='segundo cuarto del $date1', fa='ربع دوم $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 toinen neljännes' end, case={'gen',''}}, fr= function(date1, state) return 'deuxième quart '.. frOf[state.precision] ..' $date1' end, he='רבעון שני של $date1', hsb={'druha štwórćina $date1', case={'gen',''}}, hr='druga četvrtina $date1', it='secondo quarto del $date1', ja='$date1第2四半期', ml='$date1 രണ്ടാം ത്രൈമാസം', nb='andre kvartal av $date1', nl='tweede kwart $date1', nn='andre kvartalet av $date1', no='andre kvartal av $date1', pl={'druga ćwiartka $date1', case={'gen',''}}, qu='$date1 iskay ñiqin tawa phatmanpi', ru={'вторая четверть $date1', case={'gen',''}}, sk={'2. štvrtina $date1', case={'gen',''}}, sl={function(date1, state) return 'druga četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='andra kvartalet av $date1', uk={'2-га чверть $date1', case={'gen',''}}, ur='دوسری سہ ماہی $date1', vi='quý 2 năm $date1', ['zh-hans']='$date1第二季度', ['zh-hant']='$date1第二季度', default='<span style="color:red">second quarter of $date1</span>', }, ['3quarter']= { nDates = 1, ['be-tarask']={'трэцяя чвэрць $date1', case={'gen',''}}, bn='$date1-এর তৃতীয় ত্রৈমাসিক', ckb='چارەکی سێیەمی $date1', cs={'3. čtvrtina $date1', case={'gen',''}}, de='drittes Viertel $date1', en='third quarter of $date1', ['en-gb']='third quarter of $date1', ['en-ca']='third quarter of $date1', eo='tria kvarono de $date1', es='tercer cuarto del $date1', fa='ربع سوم $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 kolmas neljännes' end, case={'gen',''}}, fr= function(date1, state) return 'troisième quart '.. frOf[state.precision] ..' $date1' end, he='רבעון שלישי של $date1', hsb={'třeća štwórćina $date1', case={'gen',''}}, hr='treća četvrtina $date1', it='terzo quarto del $date1', ja='$date1第3四半期', ml='$date1 മൂന്നാം ത്രൈമാസം', nb='tredje kvartal av $date1', nl='derde kwart $date1', nn='tredje kvartalet av $date1', no='tredje kvartal av $date1', pl={'trzecia ćwiartka $date1', case={'gen',''}}, qu='$date1 kimsa ñiqin tawa phatmanpi', sk={'3. štvrtina $date1', case={'gen',''}}, sl={function(date1, state) return 'tretja četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, ru={'третья четверть $date1', case={'gen',''}}, sv='tredje kvartalet av $date1', uk={'3-тя чверть $date1', case={'gen',''}}, ur='تیسری سہ ماہی $date1', vi='quý 3 năm $date1', ['zh-hans']='$date1第三季度', ['zh-hant']='$date1第三季度', default='<span style="color:red">third quarter of $date1</span>', }, ['4quarter']= { nDates = 1, ['be-tarask']={'чацьвёртая чвэрць $date1', case={'gen',''}}, bn='$date1-এর চতুর্থ ত্রৈমাসিক', ckb='چارەکی چوارەمی $date1', cs={'4. čtvrtina $date1', case={'gen',''}}, de='letztes Viertel $date1', en='fourth quarter of $date1', ['en-gb']='fourth quarter of $date1', ['en-ca']='fourth quarter of $date1', eo='kvara kvarono de $date1', es='último cuarto del $date1', fa='ربع چهارم $date1', fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 viimeinen neljännes' end, case={'gen',''}}, fr= function(date1, state) return 'quatrième quart '.. frOf[state.precision] ..' $date1' end, he='רבעון רביעי של $date1', hsb={'poslednja štwórćina $date1', case={'gen',''}}, hr='četvrta četvrtina $date1', it='quarto quarto del $date1', ja='$date1第4四半期', ml='$date1 നാലാം ത്രൈമാസം', nb='fjerde kvartal av $date1', nl='vierde kwart $date1', nn='tredje kvartalet av $date1', no='fjerde kvartal av $date1', pl={'czwarta ćwiartka $date1', case={'gen',''}}, qu='$date1 qhipaq ñiqin tawa phatmanpi', ru={'последняя четверть $date1', case={'gen',''}}, sk={'4. štvrtina $date1', case={'gen',''}}, sl={function(date1, state) return 'zadnja četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}}, sv='fjärde kvartalet av $date1', uk={'4-та чверть $date1', case={'gen',''}}, ur='چوتھی سہ ماہی $date1', vi='quý 4 năm $date1', ['zh-hans']='$date1第四季度', ['zh-hant']='$date1第四季度', default='<span style="color:red">forth quarter of $date1</span>', }, -- ========================================== -- === Seasons ============================== -- ========================================== ['spring'] = { nDates = 1, ar='ربيع $date1', ['be-tarask']='вясна $date1', bn='বসন্তকাল $date1', ca='primavera $date1', ckb='بەھاری $date1', cs={'jaro $date1', case={'gen', ''}}, da='Forår $date1', de='Frühling $date1', en='Spring $date1', ['en-gb']='Spring $date1', ['en-ca']='Spring $date1', eo='printempo $date1', es='primavera de $date1', et='$date1 kevad', fa='بهار $date1', fi='Kevät $date1', fr='printemps $date1', gl='primavera $date1', he='אביב $date1', hr='proljeće $date1', hsb='nalěćo $date1', hu='$date1 tavasza', it='primavera $date1', ja='{{#if:$date1|$date1年}}春', mk='пролет $date1', ml='$date1 വസന്തം', nb='våren $date1', nds='Vörjohr $date1', nn='våren $date1', nl='voorjaar $date1', no='våren $date1', pl='wiosna $date1', pt='primavera de $date1', ro='primăvara lui $date1', ru='весна $date1', sk={'jar $date1', case={'gen', ''}}, sl='pomlad $date1', sv='våren $date1', uk='весна $date1', ur='بہار $date1', vi='mùa đông năm $date1', ['zh-hans']='{{#if:$date1|$date1年}}春季', ['zh-hant']='{{#if:$date1|$date1年}}春季', default='<span style="color:red">Spring $date1</span>', }, ['summer'] = { nDates = 1, ar='صيف $date1', ['be-tarask']='лета $date1', bn='গ্রীষ্মকাল $date1', ca='estiu $date1', ckb='ھاوینی $date1', cs={'léto $date1', case={'gen', ''}}, da='Sommer $date1', de='Sommer $date1', en='Summer $date1', ['en-gb']='Summer $date1', ['en-ca']='Summer $date1', eo='somero $date1', es='verano de $date1', et='$date1 suvi', fa='تابستان $date1', fi='Kesä $date1', fr='été $date1', gl='verán $date1', he='קיץ $date1', hr='ljeto $date1', hsb='lěćo $date1', hu='$date1 nyara', it='estate $date1', ja='{{#if:$date1|$date1年}}夏', mk='лето $date1', ml='$date1 വേനൽ', nb='sommeren $date1', nds='Sommer $date1', nn='sumaren $date1', nl='zomer $date1', no='sommeren $date1', pl='lato $date1', pt='verão de $date1', ro='vara lui $date1', ru='лето $date1', sk={'leto $date1', case={'gen', ''}}, sl='poletje $date1', sv='sommaren $date1', uk='літо $date1', ur='گرما $date1', vi='mùa hè năm $date1', ['zh-hans']='{{#if:$date1|$date1年}}夏季', ['zh-hant']='{{#if:$date1|$date1年}}夏季', default='<span style="color:red">Summer $date1</span>', }, ['autumn'] = { nDates = 1, ar='خريف $date1', ['be-tarask']='восень $date1', bn='শরত্কাল $date1', ca='tardor $date1', ckb='پاییزی $date1', cs={'podzim $date1', case={'gen', ''}}, da='Efterår $date1', de='Herbst $date1', en='Autumn $date1', ['en-gb']='Autumn $date1', ['en-ca']='Autumn $date1', eo='aŭtuno $date1', es='otoño de $date1', et='$date1 sügis', fa='پاییز $date1', fi='Syksy $date1', fr='automne $date1', gl='outono $date1', he='סתיו $date1', hr='jesen $date1', hsb='nazyma $date1', hu='$date1 ősze', it='autunno $date1', ja='{{#if:$date1|$date1年}}秋', mk='есен $date1', ml='$date1 ശരത്കാലം', nb='høsten $date1', nds='Harvst $date1', nn='hausten $date1', nl='herfst $date1', no='høsten $date1', pl='jesień $date1', pt='outono de $date1', ro='toamna lui $date1', ru='осень $date1', sk={'jeseň $date1', case={'gen', ''}}, sl='jesen $date1', sv='hösten $date1', uk='осінь $date1', ur='خزاں $date1', vi='mùa thu năm $date1', ['zh-hans']='{{#if:$date1|$date1年}}秋季', ['zh-hant']='{{#if:$date1|$date1年}}秋季', default='<span style="color:red">Autumn $date1</span>', }, ['winter'] = { nDates = 1, ar='شتاء $date1', ['be-tarask']='зіма $date1', bn='শীতকাল $date1', ca='hivern $date1', ckb='زستانی $date1', cs={'zima $date1', case={'gen', ''}}, da='Vinter $date1', de='Winter $date1', en='Winter $date1', ['en-gb']='Winter $date1', ['en-ca']='Winter $date1', eo='vintro $date1', es='invierno de $date1', et='$date1 talv', fa='زمستان $date1', fi='Talvi $date1', fr='hiver $date1', gl='inverno $date1', he='חורף $date1', hr='zima $date1', hsb='zyma $date1', hu='$date1 tele', it='inverno $date1', ja='{{#if:$date1|$date1年}}冬', mk='зима $date1', ml='$date1 ശൈത്യകാലം', nds='Winter $date1', nl='winter $date1', nb='vinteren $date1', nn='vinteren $date1', no='vinteren $date1', pl='zima $date1', pt='inverno de $date1', ro='iarna lui $date1', ru='зима $date1', sk={'zima $date1', case={'gen', ''}}, sl='zima $date1', sv='vintern $date1', uk='зима $date1', ur='سرما $date1', vi='mùa đông năm $date1', ['zh-hans']='{{#if:$date1|$date1年}}冬季', ['zh-hant']='{{#if:$date1|$date1年}}冬季', default='<span style="color:red">Winter $date1</span>', }, -- ========================================== -- === Decade/Century/Millennium ============ -- ========================================== ['decade'] = { nDates = 1, ar='أعوام $date1', ['be-tarask']='$date1-я гады', bn='$date1-এর দশক', ca='dècada del $date1', ckb='دەیەی $date1', cs=function(date1, state) return ((date1 % 100 == 0) and 'první dekáda' or ((date1 % 100) .. '. léta')) .. ' ' .. (math.floor(date1 / 100) + 1) .. '. století' end, da="$date1'erne", de='$date1er-Jahre', el='δεκαετία του $date1', en='$date1s', ['en-gb']='$date1s', ['en-ca']='$date1s', eo='$date1-aj jaroj', es='años $date1', et='$date1ndad', fa='دههٔ $date1', fi='$date1-luvulla', fr='années $date1', gl='anos $date1', he='שנות ה-$date1', hr='$date1-ih', hsb='$date1te lěta', hu='$date1-s évek', it="{{#ifexpr: $date1 mod 100 = 0 | primo decennio del {{Roman|{{#expr: ($date1 / 100) + 1}}}} sec. | anni '{{#expr: $date1 mod 100 }} del {{Roman|{{#expr: floor($date1 / 100) + 1}}}} sec.}}", ja='$date1年代', mk='$date1-ти', ml='ദശകം $date1-ൽ', nb='$date1-årene', nn='$date1-åra', nds='Johren $date1', nl='jaren $date1', no='$date1-årene', pl=function(date1, state) local str = 'lata '..(date1 % 100)..'. ' if (date1 % 100 == 0) then str = 'pierwsza dekada ' elseif (date1 % 100 == 10) then str = 'druga dekada ' end return str .. Roman(math.floor(date1 / 100) + 1) .. ' wieku' end, pt='década de $date1', qu='$date1 watakuna', ro='anii $date1', ru='$date1-е годы', sk=function(date1, state) return ((date1 % 100 == 0) and 'prvé desaťročie' or ((date1 % 100) .. '. roky')) .. ' ' .. (math.floor(date1 / 100) + 1) .. '. storočia' end, sl='$date1-ta leta', sv='$date1-talet{{#switch:$date1|1300|1400|1500|1600|1700|1800|1900|2000|2100=&nbsp;(decennium)}}', uk='$date1-ті роки', ur='دہائی $date1', vi='thập niên $date1', ['zh-hans']='$date1年代', ['zh-hant']='$date1年代', default='<span style="color:red">$date1s</span>', }, ['century'] = { nDates = 1, ar='القرن $date1', ['be-tarask']=function(date1, state) return Ordinal(date1, 'be-tarask') .. ' стагодзьдзе' end, bn=function(date1, state) return Ordinal(date1, 'bn') .. ' শতাব্দী' end, ca='segle {{small-caps|{{lc:{{Roman year|$date1}}}}}}', ckb='سەدەی $date1', cs='$date1. století', da='$date1. århundrede', de='$date1. Jahrhundert', el='$date1ος αιώνας', en=function(date1, state) return Ordinal(date1, 'en') .. ' century' end, ['en-gb']=function(date1, state) return Ordinal(date1, 'en-gb') .. ' century' end, ['en-ca']=function(date1, state) return Ordinal(date1, 'en-ca') .. ' century' end, eo='$date1-a jarcento', es=function(date1, state) return 'siglo ' .. Roman(date1) end, et='$date1. sajand', fa='سدهٔ $date1', fi='{{#expr: ($date1 - 1) * 100}}-luvulla', fr=function(date1, state) return Ordinal(date1, 'fr', 'roman', 'm') .. ' siècle' end, gl=function(date1, state) return 'século ' .. Roman(date1) end, he='המאה ה-$date1', hr='$date1. stoljeće', hsb='$date1. lětstotk', hu='$date1. évszázad', it=function(date1, state) return Roman(date1) .. ' sec.' end, ja='$date1世紀', la='saeculum $date1', mk=function(date1, state) return Roman(date1) .. ' век' end, ml='$date1-ആം നൂറ്റാണ്ട്', nb=function(date1, state) return Ordinal(date1, 'nb') .. ' århundre' end, nn=function(date1, state) return 'det ' .. Ordinal(date1, 'no') .. ' århundre' end, nds='$date1. Johrhunnert', nl='$date1e eeuw', no=function(date1, state) return Ordinal(date1, 'no') .. ' århundre' end, pl=function(date1, state) return Roman(date1) .. ' ' .. decCentury('pl',state.case) end, pt=function(date1, state) return 'século ' .. Roman(date1) end, qu='$date1 ñiqin pachakwata', ro='secolul al $date1-lea', ru=function(date1, state) return Roman(date1) .. ' век' end, sk='$date1. storočie', sl=function(date1, state) return Ordinal(date1, 'sl') .. '. stoletje' end, sv='{{#expr:$date1 - 1}}00-talet', tt=function(date1, state) return Roman(date1) .. ' гасыр' end, uk=function(date1, state) return Roman(date1) .. ' ст.' end, ur='صدی $date1', vi='thế kỷ $date1', ['zh-hans']='$date1世纪', ['zh-hant']='$date1世紀', default='<span style="color:red">$date1 century</span>', }, ['millennium'] = { nDates = 1, ['be-tarask']=function(date1, state) return Ordinal(date1, 'be-tarask') .. ' тысячагодзьдзе' end, bn=function(date1, state) return Ordinal(date1, 'bn') .. ' সহস্রাব্দ' end, ckb=function(date1, state) return 'ھەزارەی ' .. Ordinal(date1, 'ckb') end, cs='$date1. tisíciletí', de='$date1. Jahrtausend', en=function(date1, state) return Ordinal(date1, 'en') .. ' millennium' end, ['en-gb']=function(date1, state) return Ordinal(date1, 'en-gb') .. ' millennium' end, ['en-ca']=function(date1, state) return Ordinal(date1, 'en-ca') .. ' millennium' end, eo='$date1-a jarmilo', es=function(date1, state) return Roman(date1) .. ' milenio' end, fa=function(date1, state) return 'هزارهٔ ' .. Ordinal(date1, 'fa') end, fr=function(date1, state) return Ordinal(date1, 'fr', 'roman', 'm') .. ' millénaire' end, hr='$date1. tisućljeće', hsb='$date1. lěttysac', it=function(date1, state) return Roman(date1) .. ' millennio' end, ja='$date1千年紀', la='millennium $date1', ml='$date1-മത്തെ സഹസ്രാബ്ദം', nb=function(date1, state) return Ordinal(date1, 'nb') .. ' årtusen' end, nn=function(date1, state) return Ordinal(date1, 'no') .. ' tusenår' end, nl='$date1e millennium', no=function(date1, state) return Ordinal(date1, 'no') .. ' årtusen' end, pl=function(date1, state) return Roman(date1) .. ' ' .. decMillennium('pl',state.case) end, pt=function(date1, state) return Roman(date1) .. ' milénio' end, qu='$date1 ñiqin waranqawata', ru=function(date1, state) return Roman(date1) .. ' тысячелетие' end, sk='$date1. tisícročie', sl=function(date1, state) return Ordinal(date1, 'sl') .. '. tisočletje' end, sv=function(date1, state) return Ordinal(date1, 'sv') .. ' årtusendet' end, uk=function(date1, state) return Roman(date1) .. ' тис.' end, ur=function(date1, state) return 'ہزارہ ' .. Ordinal(date1, 'ur') end, vi='thiên niên kỷ $date1', ['zh-hans']=function(date1, state) return Ordinal(date1, 'zh-hans') .. '千年' end, ['zh-hant']=function(date1, state) return Ordinal(date1, 'zh-hant') .. '千年' end, --default='{{Please translate|$date1 millennium|Module:I18n/complex date}}', default='<span style="color:red">$date1 millennium</span>', }, ['million'] = { ckb = '$date1 میلیۆن ساڵ', de = '$date1 Millionen Jahre', en = '$date1 million years', ['en-gb'] = '$date1 million years', ['en-ca'] = '$date1 million years', eo = '$date1 milionoj da jaroj', es = '$date1 millones de años', nl = '$date1e miljoen jaar', fr = '$date1 millions d’années', it = '$date1 milioni di anni', ml = function(date1, state) if date1 >= 10 then return (date1 / 10) .. ' കോടി വർഷങ്ങൾ' -- 100 lakh = 1 crore else return (date1 * 10) .. ' ലക്ഷം വർഷങ്ങൾ' end end, nb = '$date1 millioner år', nl = '$date1 miljoen jaar', nn = '$date1 millionar år', pl = '$date1 milionów lat', pt = '$date1 milhões de anos', ru = '$date1 миллиона лет', uk = '$date1 мільйони років', ur = '$date1 ملین سال', ['zh-hans'] = '$date1百万年', ['zh-hant'] = '$date1百万年', default='<span style="color:red">$date1 million years</span>', nDates = 1, }, ['billion'] = { ckb = '$date1 بیلیۆن ساڵ', de = '$date1 Milliarden Jahre', en = '$date1 billion years', ['en-gb'] = '$date1 billion years', ['en-ca'] = '$date1 billion years', es = '$date1 mil millones de años', nl = '$date1e miljard jaar', fr = '$date1 milliard d’années', it = '$date1 miliardi di anni', ml = function(date1, state) return (date1 * 10) .. ' കോടി വർഷങ്ങൾ' end, nb = '$date1 milliarder år', nl = '$date1 miljard jaar', nn = '$date1 milliardar år', pl = '$date1 miliardów lat', pt = '$date1 mil milhões de anos', ru = '$date1 миллиардов лет', uk = '$date1 мільярдів років', ur = '$date1 بلین سال', ['zh-hans'] = '$date1十亿年', ['zh-hant'] = '$date1十億年', default='<span style="color:red$date1 billion years</span>', nDates = 1, }, -- ========================================== -- === Complex phrases ====================== -- ========================================== -- Phrases which for some languages can be build out of simpler phrases -- Their "default" state, used when no translation in the requested language was found, returns a "state" like -- table which is used to call the function again and built the phrase out of simple phrases -- $date1 - original date - 1 -- $date2 - original date -- if era is BC than $date1 and $date2 are swapped ['turn of the century'] = { nDates = 2, ['be-tarask']=function(date1, date2, state) return 'канец ' .. Roman(date1) ..' — пачатак ' .. Roman(date2) ..' стагодзьдзя' end, bn=function(date1, date2, state) return '$date1/' .. Ordinal(date2, 'bn') .. ' শতাব্দীর পালাবদলে' end, ckb=function(date1, date2, state) return 'سەردەمی $date1/' .. Ordinal(date2, 'ckb') .. ' سەدە' end, cs='přelom $date1. a $date2. století', de=function(date1, date2, state) return 'Jahrhundertwende $date1/' .. Ordinal(date2, 'de') end, en=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en') .. ' century' end, ['en-gb']=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en-gb') .. ' century' end, ['en-ca']=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en-ca') .. ' century' end, eo='ŝanĝo de la $date1-a al la $date2-a jarcentoj', es=function(date1, date2, state) return 'hacia finales del siglo ' .. Roman(date1) .. ' y principios del siglo ' .. Roman(date2) .. '' end, fi='{{#expr: $date1 * 100-100}}-luvun loppu ja {{#expr: $date2 * 100-100}}-luvun alku', fr=function(date1, date2, state) return 'fin du ' .. Ordinal(date1, 'fr', 'roman', 'm') .. ' siècle / début du ' .. Ordinal(date2, 'fr', 'roman', 'm') end, hr='kraj $date1. i početak $date2. stoljeća', hsb=function(date1, date2, state) return 'přechod ' .. Roman(date1) ..' do ' .. Roman(date2) ..' lětstotka' end, it=function(date1, date2, state) return 'fine del ' .. Roman(date1) .. ' sec. e inizio del ' .. Roman(date2) .. ' sec.' end, ja='$date1世紀から$date2世紀への変わり目', ml='$date1 നൂറ്റാണ്ട് അവസാനവും $date2 നൂറ്റാണ്ട് ആദ്യവും', nb=function(date1, date2, state) return 'slutten av det ' .. Ordinal(date1, 'nb') .. ' århundre/begynnelsen av det ' .. Ordinal(date2, 'nb') .. ' århundre' end, nl=function(date1, date2, state) return 'eind $date1e/begin $date2e eeuw' end, nn=function(date1, date2, state) return 'slutten av det ' .. Ordinal(date1, 'nn') .. ' hundreåret/byrjinga av det ' .. Ordinal(date2, 'nn') .. ' hundreåret' end, pl=function(date1, date2, state) return 'przełom ' .. Roman(date1) ..' i ' .. Roman(date2) ..' wieku' end, qu="$date1 ñiqin waranqawatamanta $date2 ñiqin waranqawataman t'ikrasqanpi", ru=function(date1, date2, state) return 'конец ' .. Roman(date1) ..' — начало ' .. Roman(date2) ..' века' end, sk='prelom $date1. a $date2. storočia', sl=function(date1, date2, state) return 'pozno ' .. Ordinal(date1, 'sl') .. '. in zgodnje ' .. Ordinal(date2, 'sl') .. '. stoletje' end, sv=function(date1, date2, state) return '$date1/' .. Ordinal(date2, 'sv') .. ' årtusendets sekelskifte' end, uk=function(date1, date2, state) return 'кін. ' .. Roman(date1) ..' ст. — поч. ' .. Roman(date2) ..' ст.' end, vi='bước sang thế kỷ $date2', ['zh-hans']=function(date1, date2, state) return '$date1世纪末' .. Ordinal(date2, 'zh-hans') .. '世纪初' end, ['zh-hant']=function(date1, date2, state) return '$date1世紀末' .. Ordinal(date2, 'zh-hant') .. '世紀初' end, default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='century', era1=state.era1, adj2 = 'early', unit2='century', era2=state.era2} end, }, -- $date1 - original date - 10 -- $date2 - original date -- if era is BC than $date1 and $date2 are swapped ['turn of the decade']={ nDates = 2, ['be-tarask']='канец $date1-х — пачатак $date2-х гг.', bn='$date1-এর দশকের শেষে এবং $date2-এর দশকের শুরুতে', cs=function(date1, date2, state) local decade1 = math.floor((date1 % 100) / 10) local decade2 = math.floor((date2 % 100) / 10) local century1 = math.floor( date1 / 100) + 1 local century2 = math.floor( date2 / 100) + 1 if decade1 == 0 and date1 < date2 then return "přelom 1. a 2. dekády " .. century1 .. ". století" elseif decade2 == 0 and date2 < date1 then return "přelom 9. a 10. dekády " .. century1 .. ". století" elseif (decade1 == 9 and date1 < date2) or (decade2 == 9 and date2 < date1) then return "přelom " .. century1 .. ". a " .. century2 .. ". století" else return "přelom " .. decade1 .. "0. a " .. decade2 .. "0. let " .. century1 .. ". století" end end, de='späte $date1er und frühe $date2er', ckb='کۆتایییەکانی $date1 و سەرەتاکانی $date2', en='late $date1s and early $date2s', ['en-gb']='late $date1s and early $date2s', ['en-ca']='late $date1s and early $date2s', eo='ŝanĝo de la $date1-a al la $date2-a jardekoj', es='finales de los años $date1 y principios de los años $date2', fa='اواخر دههٔ $date1 و اوایل دههٔ $date2', fi='$date1-luvun loppu ja $date2-luvun alku', fr='fin des années $date1 / début des années $date2', hr='kraj $date1-ih i početak $date2-ih', hsb='pózdnje $date1te a zažne $date2te lěta', it='fine degli anni $date1 / inizio degli anni $date2', ja='$date1年代末から$date2年代初頭', ml='$date1കൾ അവസാനവും $date2കൾ ആദ്യവും', nb = 'sent på $date1-tallet og tidlig på $date2-tallet', nl = 'eind $date1e/begin $date2e decennium', nn = 'seint på $date1-talet og tidleg på $date2-talet', pl=function(date1, date2, state) local decade1 = math.floor(date1 % 100) local decade2 = math.floor(date2 % 100) local century1 = Roman(math.floor( date1 / 100) + 1) local century2 = Roman(math.floor( date2 / 100) + 1) if decade1 == 0 and date1 < date2 then return "przełom pierwszej i drugiej dekady " .. century1 .. " wieku" elseif decade1 == 10 and date1 < date2 then return "przełom drugiej dekady i lat 20. " .. century1 .. " wieku" elseif decade1 == 90 and decade2 == 0 then return "przełom ostatniej dekady " .. century1 .. " i pierwszej dekady " .. century2 .. " wieku" else return "przełom lat " .. decade1 .. ". i " .. decade2 .. ". " .. century1 .. " wieku" end end, qu='qhipaq $date1 watakuna ñawpaq $date2 watakunapas', ru='конец $date1-х — начало $date2-х гг.', sv='sena $date1-talet och tidiga $date2-talet', sk=function(date1, date2, state) local decade1 = math.floor((date1 % 100) / 10) local decade2 = math.floor((date2 % 100) / 10) local century1 = math.floor( date1 / 100) + 1 local century2 = math.floor( date2 / 100) + 1 if decade1 == 0 and date1 < date2 then return "prelom 1. a 2. desaťročia " .. century1 .. ". storočia" elseif decade2 == 0 and date2 < date1 then return "prelom 9. a 10. desaťročia " .. century1 .. ". storočia" elseif (decade1 == 9 and date1 < date2) or (decade2 == 9 and date2 < date1) then return "prelom " .. century1 .. ". a " .. century2 .. ". storočia" else return "prelom " .. decade1 .. "0. a " .. decade2 .. "0. rokov " .. century1 .. ". storočia" end end, sl='pozna $date1-ta in zgodnja $date2-ta leta', uk='кінець $date1-х — початок $date2-х рр.', ur='اخیر دہائی $date1 و ابتدا دہائی $date2', vi='bước sang thập niên $date2', ['zh-hans']='$date1年代末$date2年代初', ['zh-hant']='$date1年代末$date2年代初', default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='decade', era1=state.era1, adj2 = 'early', unit2='decade', era2=state.era2} end, }, -- $date1 - original date - 1 -- $date2 - original date -- if era is BC than $date1 and $date2 are swapped ['turn of the year']={ nDates = 2, ['be-tarask']='канец $date1 — пачатак $date2 г.', bn='$date1-এর শেষে এবং $date2-এর শুরুতে', ckb='کۆتاییی $date1 و سەرەتای $date2', cs='přelom roku $date1/$date2', de='Jahreswechsel $date1/$date2', en='late $date1 and early $date2', ['en-gb']='late $date1 and early $date2', ['en-ca']='late $date1 and early $date2', eo='jarŝanĝo $date1 / $date2', es='finales de $date1 y principios de $date2', fa='اواخر $date1 و اوایل $date2', fi='vuoden $date1 loppu ja vuoden $date2 alku', fr='fin $date1 / début $date2', hsb='kónc $date1/spočatk $date2', ja='$date1年末から$date2年初め', ml='$date1 അവസാനവും $date2 ആദ്യവും', nb='årsskiftet $date1/$date2', nl='eind $date1 en begin $date2', nn='årsskiftet $date1/$date2', pl='koniec $date1 i początek $date2 roku', qu="$date1 qhipaq p'unchawkuna $date2 ñawpaq p'unchawkunapas", ru='конец $date1 — начало $date2 г.', sk='prelom rokov $date1/$date2', sl='konec leta $date1 in začetek $date2', sv='sena $date1 och tidiga $date2', uk='кінець $date1 — початок $date2 р.', ur='اخیر $date1 و ابتدا $date2', vi='bước sang năm $date2', ['zh-hans']='$date1年末$date2年初', ['zh-hant']='$date1年末$date2年初', default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='year', era1=state.era1, adj2 = 'early', unit2='year', era2=state.era2} end, }, ['circa2'] = { nDates = 2, ar='حوالي $date1 – $date2', ['be-tarask']={'прыкладна з $date1 да прыкладна $date2', case={'gen','gen'}}, bn='প্রায় $date1 এবং প্রায় $date2-এর মাঝামাঝি', ca='cap a $date1 o $date2', ckb='بە نزیکی لەنێوان $date1 و $date2', cs='cca $date1 až $date2', da='ca. mellem $date1 og $date2', de='etwa $date1 bis $date2', el='περίπου μεταξύ $date1 και $date2', en='between c. $date1 and c. $date2', ['en-gb']='between circa $date1 and circa $date2', ['en-ca']='between circa $date1 and circa $date2', eo='proksimume de $date1 ĝis $date2', es='hacia $date1 o $date2', et='ca. $date1 ja $date2 vahel', fa='حدوداً بین $date1 و $date2', fi={function(date1, date2, state) return 'suunnilleen ' .. decYear(state,'fi','xxx') .. '$date1 ja $date2 välisenä aikana' end, case={'gen','gen'}}, fr='vers $date1-$date2', gl='entre $date1 e $date2', he='בסביבות ה- $date1 עד $date2', hr='oko između $date1 i $date2', hsb={'wot něhdźe $date1 do něhdźe $date2', case={'gen','gen'}}, hu='$date1 és $date2 között', it='tra il $date1 e il $date2 circa', ja='$date1頃と$date2頃の間', mk='~ помеѓу $date1 и $date2', ml='ഉദ്ദേശം $date1-നും ഉദ്ദേശം $date2-നും ഇടയ്ക്ക്', nb='ca. mellom $date1 og $date2', nn='ca. mellom $date1 og $date2', nds='üm un bi $date1 bet $date2', nl='ca. $date1 tot $date2', no='ca. mellom $date1 og $date2', pl={'od około $date1 do około $date2', case={'gen','gen'}}, pt='cerca de $date1 a $date2', qu="$date1 p'unchawmantachá $date2 p'unchawkamachá", ro='circa $date1 – $date2', ru={'с около $date1 до, примерно, $date2', case={'gen','gen'}}, sk='cca $date1 až $date2', sl={function(date1, date2, state) return 'ok. ' .. decYear(state,'sl','gen') .. ' $date1 do $date2' end, case={'gen','gen'}}, sv='c:a $date1 till $date2', uk={'з близько $date1 до, приблизно, $date2', case={'gen','gen'}}, ur='قریباً بین $date1 و $date2', vi='giữa vào khoảng $date1 và vào khoảng $date2', ['zh-hans']='约$date1~$date2间', ['zh-hant']='約$date1~$date2間', default=function(date1, date2, state) return {conj='between', adj1 = 'circa', unit1=state.unit1, era1=state.era1, adj2 = 'circa', unit2=state.unit2, era2=state.era2} end, }, -- ========================================== -- === Eras and calendars =================== -- ========================================== ['julian'] = { nDates = 2, ar='$date1 ($date2 حسب [[w:ar:التقويم اليولياني|تقويم يولياني]])', ['be-tarask']='$date1 ($date2 паводле [[w:be-tarask:Юліянскі каляндар|ст. ст.]]', bn='$date1 (জুলিয়ান ক্যালেন্ডারে $date2)', ca='$date1 ($date2 segons el [[w:ca:Calendari julià|calendari julià]])', ckb='$date1 ($date2 بەپێی [[w:ڕۆژژمێری جولیانی|ڕۆژژمێری جولیانی]])', cs='$date1 ($date2 podle [[w:cs:Juliánský kalendář|juliánského kalendáře]])', da='$date1 ($date2 [[w:da:Julianske kalender|Julianske kalender]])', de='$date1 ($date2 [[w:de:Julianischer Kalender|Julianischer Kalender]])', el='$date1 ($date2 με το [[w:el:Ιουλιανό ημερολόγιο|Ιουλιανό ημερολόγιο]])', en='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])', ['en-gb']='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])', ['en-ca']='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])', fa='$date1 ($date2 در [[w:fa:Old Style and New Style dates|تقویم جولیان]])', eo='$date1 ($date2 laŭ la [[w:eo:Julia kalendaro|Julia Kalendaro]])', es='$date1 ($date2 según el [[w:es:Calendario juliano|calendario juliano]])', et='$date1 ($date2 [[w:et:Juliuse kalender|Juliuse kalendris]])', fi='$date1 ($date2 [[w:fi:juliaaninen kalenteri|juliaanisen kalenterin]] mukaan)', fr='$date1 ($date2 dans le [[w:fr:calendrier julien|calendrier julien]])', gl='$date1 ($date2 segundo o [[w:gl:Calendario xuliano|calendario xuliano]])', hu='$date1 ($date2 a [[w:hu:Julianus-naptár|Julián naptárban]])', hr='$date1 ($date2 prema [[w:hr:Julijanski kalendar|julijanskom kalendaru]])', he='$date1 ($date2 ב[[w:he:לוח היוליאני|הלוח היוליאני]])', hsb='$date1 ($date2 po julianiskej protyce)', it='$date1 ($date2 secondo il [[w:it:Calendario giuliano|calendario giuliano]])', ja='$date1([[w:ja:ユリウス暦|ユリウス暦]] $date2)', mk='$date1 ($date2 по [[w:mk:Јулијански календар|Јулијанскиот календар]])', ml='$date1 ([[w:ml:ജൂലിയൻ കാലഗണനാരീതി|ജൂലിയൻ വർഷത്തിൽ]] $date2)', ml='$date1 ([[w:Old Style and New Style dates|ജൂലിയൻ കാലഗണനാരീതിയിൽ]] $date2)', nds='$date1 ($date2 na’n [[w:nds:Juliaansch Klenner|Juliaanschen Klenner]])', nb='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalenderen]])', nn='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalenderen]])', nl='$date1 ($date2 volgens de [[w:nl:Juliaanse kalender|Juliaanse kalender]])', no='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalender]])', pl='$date1 ($date2 wedle [[w:pl:Daty nowego i starego porządku|kalendarza juliańskiego]])', pt='$date1 ($date2 no [[w:pt:Mudança para o calendário gregoriano|calendário juliano]])', qu='$date1 ($date2 [[w:qu:Hulyanu kalindaryu|Hulyanu kalindaryupi]])', ro='$date1 ($date2 în [[w:ro:calendarul iulian|calendarul iulian]])', ru='$date1 ($date2 [[w:ru:Юлианский календарь|по ст. ст.]])', sk='$date1 ($date2 podľa [[w:sk:Juliánsky kalendár|juliánskeho kalendára]])', sl='$date1 ($date2 po [[w:sl:Julijanski koledar|julijanskem koledarju]])', sv='$date1 ($date2 [[w:sv:Gamla stilen|gamla stilen]])', uk='$date1 ($date2 [[w:uk:Юліанський календар|Юліанський календар]])', ur='$date1 ($date2 حسب [[w:ur:نئے اور پانے انداز کی تاریخ|جولین تقویم]])', vi='$date1 ($date2 trong [[w:vi:Lịch Julius|lịch Juliêng]])', ['zh-hans']='$date1([[w:Old Style and New Style dates|格里历]]$date2)', ['zh-hant']='$date1([[w:Old Style and New Style dates|格里曆]]$date2)', default='<span style="color:red">$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])</span>', }, ['ad'] = { nDates = 1, ['be-tarask']='$date1 [[w:be-tarask:ад Нараджэньня Хрыста|пасьля Н. Х.]]', bn ='$date1 খ্রিস্টাব্দ', ca ='$date1 dC', ckb ='$date1 [[w:ckb:ئانۆ دۆمینی|پاز]]', cs ='$date1 n. l.', de ='$date1 n. Chr.', el ='$date1 μ.Χ.', en ='$date1 [[w:en:Anno Domini|AD]]', ['en-gb'] ='$date1 [[w:en:Anno Domini|AD]]', ['en-ca'] ='$date1 [[w:en:Anno Domini|AD]]', eo ='$date1 pK', es ='$date1 [[w:es:Anno Dómini|d. C.]]', fa ='$date1 م.', fi ='$date1 jaa.', fr ='$date1 ap. J.-C.', gl ='$date1 d.C.', he ='$date1 לספירה', hu ='i. sz. $date1', hr ='$date1 p. Kr.', hsb='$date1 po Chr.', it ='$date1 d.C.', ja ='西暦$date1', mk ='$date1 н.е.', ml ='ക്രി.വ. $date1', nb ='$date1 e.Kr.', nl ='$date1 n.Chr.', nn ='$date1 e.Kr.', no ='$date1 e.Kr.', pl ='$date1 [[w:pl:naszej ery|n.e.]]', ro ='$date1 d.Hr.', ru ='$date1 н. э.', sk ='$date1 po Kr.', sl ='$date1 n. št.', sv ='$date1 [[w:sv:Efter Kristus|e.Kr.]]', uk ='$date1 н. е.', ur ='$date1 ء', vi ='$date1 [[w:vi:Công Nguyên|CN]]', ['zh-hans'] ='[[w:zh:基督纪年|公元]]$date1', ['zh-hant'] ='[[w:zh:基督纪年|公元]]$date1', default='<span style="color:red">$date1 [[w:en:Anno Domini|AD]]</span>', }, ['ah'] = { nDates = 1, ['be-tarask']='$date1 [[w:be-tarask:Ісламскі каляндар|хіджры]]', bn ='$date1 [[w:bn:ইসলামি বর্ষপঞ্জি|হিজরী]]', ckb ='$date1 [[w:ckb:ساڵی کۆچی|سک]]', cs ='$date1 [[w:cs:Anno Hegirae|AH]]', en ='$date1 [[w:en:Hijri year|AH]]', ['en-gb'] ='$date1 [[w:en:Hijri year|AH]]', ['en-ca'] ='$date1 [[w:en:Hijri year|AH]]', eo ='$date1 post la [[w:eo:Heĝiro|Heĝiro]]', fa ='$date1 ه.ق.', fr ='$date1 [[w:fr:Calendrier musulman|A.H.]]', he ="$date1 [[w:he:הלוח המוסלמי|להג'רה]]", hr ='$date1 god. hidžre', ja ='[[w:ja:ヒジュラ暦|ヒジュラ暦]]$date1', ml ='$date1 [[w:ml:ഇസ്‌ലാമിക കലണ്ടർ|ഹിജ്റ]]', nb ='$date1 [[w:no:Den muslimske kalenderen|A.H.]]', nn ='$date1 [[w:nn:Den muslimske kalenderen|A.H.]]', pl ='$date1 [[w:pl:Kalendarz muzułmański|A.H.]]', ru ='$date1 [[w:ru:Исламский календарь|хиджры]]', sk ='$date1 [[w:sk:A. H.|A. H.]]', sv ='$date1 [[w:sv:Muslimska kalendern|A.H.]]', uk ='$date1 [[w:uk:Мусульманський календар|хіджри]]', ur ='$date1 ھ', vi ='$date1 [[w:vi:Lịch Hồi giáo|AH]]', ['zh-hans'] ='[[w:en:Hijri year|Hijri历]]$date1', ['zh-hant'] ='[[w:en:Hijri year|Hijri曆]]$date1', default='<span style="color:red">$date1 [[w:en:Hijri year|AH]]</span>', }, ['bc'] = { nDates = 1, ar ='$date1 ق.م.', ['be-tarask']='$date1 [[w:be-tarask:да Нараджэньня Хрыста|да Н. Х.]]', bn ='খ্রিস্টপূর্ব $date1', ca ='$date1 [[w:ca:Abans de Crist|aC]]', ckb ='$date1 [[w:ckb:پێش زایین|پز]]', cs ='$date1 [[w:cs:Př. n. l.|př. n. l.]]', de ='$date1 [[w:de:v. Chr.|v. Chr.]]', el ='$date1 π.Χ.', en ='$date1 [[w:en:Ante Christum Natum|BC]]', ['en-gb'] ='$date1 [[w:en:Ante Christum Natum|BC]]', ['en-ca'] ='$date1 [[w:en:Ante Christum Natum|BC]]', eo ='$date1 aK', es ='$date1 [[w:es:Antes de Cristo|a. C.]]', fa ='$date1 پ.م.', fi ='$date1 eaa.', fr ='$date1 av. J.-C.', gl ='$date1 [[w:gl:Antes de Cristo|a.C.]]', he ='$date1 לפני הספירה', hr ='$date1 [[w:hr:Pr. Kr.|pr. Kr.]]', hsb='$date1 do Chr.', hu ='i. e. $date1', it ='$date1 [[w:it:Avanti Cristo|a.C.]]', ja ='[[w:ja:紀元前|紀元前]]$date1', mk ='$date1 п.н.е.', ml ='ക്രി.മു. $date1', nds='$date1 vör uns Tied', nb ='$date1 f.Kr.', nl ='$date1 v.Chr.', nn ='$date1 f.Kr.', no ='$date1 f.Kr.', pl ='$date1 [[w:pl:przed naszą erą|p.n.e.]]', ro ='$date1 î.Hr.', ru ='$date1 до н. э.', sk ='$date1 [[w:sk:Pred Kristom|pred Kr.]]', sl ='$date1 pr. n. št.', sv ='$date1 [[w:sv:Före Kristus|f.Kr.]]', uk ='$date1 до н. е.', ur ='$date1 ق م', vi ='$date1 [[w:vi:Trước Công Nguyên|TCN]]', ['zh-hans'] ='[[w:zh:基督纪年|公元前]]$date1', ['zh-hant'] ='[[w:zh:基督纪年|公元前]]$date1', default='<span style="color:red">$date1 [[w:en:Ante Christum Natum|BC]]</span>', }, ['bp'] = { nDates = 1, ar ='$date1 [[w:ar:قبل الحاضر|قبل الحاضر]]', be ='$date1 [[w:be-tarask:Да нашых дзён|Да нашых дзён]]', ['be-tarask']='$date1 [[w:be-tarask:Да нашых дзён|Да нашых дзён]]', bn ='বর্তমানের আগে $date1', ca ='$date1 [[w:ca:BP (unitat de temps)|BP]]', ckb ='$date1 [[w:ckb:پێش ئێستا|پێش ئێستا]]', cs ='$date1 [[w:cs:B. P.|B. P.]]', de ='$date1 [[w:de:Before Present|BP]]', el ='$date1 [[w:en:Before Present|BP]]', en ='$date1 [[w:en:Before Present|BP]]', ['en-gb'] ='$date1 [[w:en:Before Present|BP]]', ['en-ca'] ='$date1 [[w:en:Before Present|BP]]', eo='$date1 [[w:eo:Before Present|BP]]', es ='$date1 [[w:es:Before Present|BP]]', et ='$date1 [[w:et:Before Present|BP]]', fa ='$date1 پیش از اکنون', fi ='$date1 [[w:fi:BP (ajanlasku)|BP]]', fr ='$date1 [[w:fr:Avant le présent|avant le présent]]', hr ='$date1 [[w:hr:BP|prije današnjice]]', it ='$date1 [[w:it:Before Present|BP]]', ja ='$date1 [[w:ja:BP (年代測定)|BP]]', lv ='$date1 [[w:lv:Pirms mūsdienām|Pirms mūsdienām]]', mk ='$date1 [[w:mk:Пред сегашноста|п.с.]]', ml ='[[w:en:Before Present|ഇന്നത്തെ കാലത്തിനു മുമ്പ്]] $date1', nb ='$date1 [[w:no:Before Present|BP]]', nn ='$date1 [[w:nn:Before Present|BP]]', nl ='$date1 [[w:nl:Before Present|BP]]', no ='$date1 [[w:no:Before Present|BP]]', pl ='$date1 [[w:pl:Before Present|BP]]', pt ='$date1 [[w:pt:Antes do Presente|Antes do Presente]]', ru ='$date1 [[w:ru:До настоящего времени|до н. в.]]', sk ='$date1 [[w:sk:BP (čas)|BP]]', sl ='$date1 [[w:sl:pred sedanjostjo|p. s.]]', sr ='$date1 [[w:sr:Прије садашњости|Прије садашњости]]', sv ='$date1 [[w:sv:B.P.|B.P.]]', uk ='$date1 [[w:uk:Років тому|Років тому]]', ur ='$date1 قبل حاضر', vi ='$date1 [[w:en:Before Present|trước ngày nay]]', ['zh-hans'] ='[[w:zh:距今|距今]]$date1', ['zh-hant'] ='[[w:zh:距今|距今]]$date1', default='<span style="color:red">$date1 [[w:en:Before Present|BP]]</span>', }, } -- List of possible string inputs to "adj", "junction", "era", and "precision" fields -- Each term is matched to its synonym and the role: a - adjective, e - era -- p - precision, c - calendar and combos, r - certainty and j - conjunction p.Synonyms = { -- adjectives and prepositions ['quarter1']={'1quarter','a'}, ['1stquarter']={'1quarter','a'}, ['1st quarter']={'1quarter','a'}, ['first quarter']={'1quarter','a'}, ['1quarter']={'1quarter','a'}, ['quarter2']={'2quarter','a'}, ['2ndquarter']={'2quarter','a'}, ['2nd quarter']={'2quarter','a'}, ['second quarter']={'2quarter','a'}, ['2quarter']={'2quarter','a'}, ['quarter3']={'3quarter','a'}, ['3rdquarter']={'3quarter','a'}, ['3rd quarter']={'3quarter','a'}, ['third quarter']={'3quarter','a'}, ['3quarter']={'3quarter','a'}, ['quarter4']={'4quarter','a'}, ['4thquarter']={'4quarter','a'}, ['4th quarter']={'4quarter','a'}, ['fourth quarter']={'4quarter','a'}, ['4quarter']={'4quarter','a'}, ['spring']={'spring','a'}, ['summer']={'summer','a'}, ['fall']={'autumn','a'}, ['autumn']={'autumn','a'}, ['winter']={'winter','a'}, ['beginning']={'early','a'}, ['early']={'early','a'}, ['1half']={'firsthalf','a'}, ['1sthalf']={'firsthalf','a'}, ['1st half']={'firsthalf','a'}, ['firsthalf']={'firsthalf','a'}, ['first half']={'firsthalf','a'}, ['end']={'late','a'}, ['late']={'late','a'}, ['middle']={'mid','a'}, ['mid']={'mid','a'}, ['2half']={'secondhalf','a'}, ['2ndhalf']={'secondhalf','a'}, ['2nd half']={'secondhalf','a'}, ['secondhalf']={'secondhalf','a'}, ['second half']={'secondhalf','a'}, ['<']={'before','a'}, ['b']={'before','a'}, ['before']={'before','a'}, ['>']={'after','a'}, ['a']={'after','a'}, ['after']={'after','a'}, ['~']={'circa','a'}, ['c']={'circa','a'}, ['ca']={'circa','a'}, ['circa']={'circa','a'}, ['by']={'by','a'}, ['from']={'from','a'}, ['until']={'until','a'}, ['uncertain']={'uncertain','r'}, ['possibly']={'possibly','r'}, ['probably']={'probably','r'}, ['presumably']={'presumably','r'}, -- eras ['bc']={'bc','e'}, ['bce']={'bc','e'}, ['before present']={'bp','e'}, ['bp']={'bp','e'}, ['ce']={'ad','e'}, ['ad']={'ad','e'}, ['ah']={'ah','e'}, -- conjunctions ['&']={'and','j'}, ['and']={'and','j'}, ['or']={'or','j'}, ['-']={'from-until','j'}, ['–']={'from-until','j'}, ['from-until']={'from-until','j'}, ['between']={'between','j'}, ['circa2']={'circa2','a'}, -- precision ['day']={'day','p'}, ['month']={'month','p'}, ['year']={'year','p'}, ['s']={'decade','p'}, ['decade']={'decade','p'}, ['century']={'century','p'}, ['millennium']={'millennium','p'}, ['million']={'million','p'}, ['billion']={'billion','p'}, -- calendar ['julian']={'julian','c'}, ['islamic']={'islamic','c'}, ['hijri']={'islamic','c'}, -- "Turn of the ..." options are a combos which will be handled in similar way as calendars ['turn of the century']={'turn of the century','c'}, ['century turn']={'turn of the century','c'}, ['turn of the decade']={'turn of the decade','c'}, ['decade turn']={'turn of the decade','c'}, ['turn of the year']={'turn of the year','c'}, ['year turn']={'turn of the year','c'}, -- other dates which will be handled in similar way as calendars ['?']={'unknown','c'}, ['unknown']={'unknown','c'}, ['unknown year']={'year unknown','c'}, ['year unknown']={'year unknown','c'}, } return p dq6g8vtfaua8zgt63ytoeyms0jwcsm1 မေႃႇၵျူး:DateI18n 828 19136 112377 60948 2025-06-26T08:12:03Z Saimawnkham 5 112377 Scribunto text/plain --[[ __ __ _ _ ____ _ ___ _ ___ | \/ | ___ __| |_ _| | ___ _| _ \ __ _| |_ ___|_ _/ |( _ ) _ __ | |\/| |/ _ \ / _` | | | | |/ _ (_) | | |/ _` | __/ _ \| || |/ _ \| '_ \ | | | | (_) | (_| | |_| | | __/_| |_| | (_| | || __/| || | (_) | | | | |_| |_|\___/ \__,_|\__,_|_|\___(_)____/ \__,_|\__\___|___|_|\___/|_| |_| This module is intended for processing of date strings. Please do not modify this code without applying the changes first at Module:Date/sandbox and testing at Module:Date/sandbox/testcases and Module talk:Date/sandbox/testcases. Authors and maintainers: * User:Parent5446 - original version of the function mimicking template:ISOdate * User:Jarekt - original version of the functions mimicking template:Date ]] require('strict') -- ================================================== -- === Internal functions =========================== -- ================================================== -- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to Module:Yesno local function yesno(val, default) if type(val) == 'boolean' then return val elseif type(val) == 'number' then if val==1 then return true elseif val==0 then return false end elseif type(val) == 'string' then val = mw.ustring.lower(val) -- put in lower case if val == 'no' or val == 'n' or val == 'false' or tonumber(val) == 0 then return false elseif val == 'yes' or val == 'y' or val == 'true' or tonumber(val) == 1 then return true end end return default end --------------------------------------------------------------------------------------- -- String replacement that ignores part of the string in "..." local function strReplace(String, old, new) if String:find('"') then local T={} for i, str in ipairs(mw.text.split( String, '"', true )) do if i%2==1 then str = str:gsub(old, new) end table.insert(T, str) end return table.concat(T,'"') else return String:gsub(old, new) end end --------------------------------------------------------------------------------------- -- process datevec -- INPUT: -- * datevec - Array of {year,month,day,hour,minute,second, tzhour, tzmin} containing broken -- down date-time component strings or numbers -- OUTPUT: -- * datecode - a code specifying content of the array where Y' is year, 'M' is month, -- 'D' is day, 'H' is hour, 'M' minute, 'S' is second. output has to be one of YMDHMS, YMDHM, YMD, YM, MD, Y -- * datenum - same array but holding only numbers or nuls local function parserDatevec(datevec) -- if month is not a number than check if it is a month name in project's language local month = datevec[2] if month and month~='' and not tonumber(month) then datevec[2] = mw.getContentLanguage():formatDate( "n", month) end -- create datecode based on which variables are provided and check for out-of-bound values local maxval = {nil, 12, 31, 23, 59, 59, 23, 59} -- max values for year, month, ... local minval = {nil, 1, 1, 0, 0, 0, -23, 0} -- min values for year, month, ... local c = {'Y', 'M', 'D', 'H', 'M', 'S', '', ''} local datecode = '' -- a string signifying which combination of variables was provided local datenum = {} -- date-time encoded as a vector = [year, month, ... , second] for i = 1,8 do datenum[i] = tonumber(datevec[i]) if datenum[i] and (i==1 or (datenum[i]>=minval[i] and datenum[i]<=maxval[i])) then datecode = datecode .. c[i] end end return datecode, datenum end --------------------------------------------------------------------------------------- -- process datevec -- INPUT: -- * datecode - a code specifying content of the array where Y' is year, 'M' is month, -- 'D' is day, 'H' is hour, 'M' minute, 'S' is second. output has to be one of YMDHMS, YMDHM, YMD, YM, MD, Y -- * datenum - Array of {year,month,day,hour,minute,second, tzhour, tzmin} as numbers or nuls -- OUTPUT: -- * timeStamp - date string in the format taken by mw.language:formatDate lua function and {{#time}} perser function -- https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language:formatDate -- https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time -- * datecode - with possible corrections local function getTimestamp(datecode, datenum) -- create time stamp string (for example 2000-02-20 02:20:20) based on which variables were provided local timeStamp if datecode == 'YMDHMS' then timeStamp = string.format('%04i-%02i-%02i %02i:%02i:%02i', datenum[1], datenum[2], datenum[3], datenum[4], datenum[5], datenum[6] ) elseif datecode == 'YMDHM' then timeStamp = string.format('%04i-%02i-%02i %02i:%02i', datenum[1], datenum[2], datenum[3], datenum[4], datenum[5] ) elseif datecode:sub(1,3)=='YMD' then timeStamp = string.format('%04i-%02i-%02i', datenum[1], datenum[2], datenum[3] ) datecode = 'YMD' -- 'YMD', 'YMDHMS' and 'YMDHM' are the only supported format starting with 'YMD'. All others will be converted to 'YMD' elseif datecode == 'YM' then timeStamp = string.format('%04i-%02i', datenum[1], datenum[2] ) elseif datecode:sub(1,1)=='Y' then timeStamp = string.format('%04i', datenum[1] ) datecode = 'Y' elseif datecode == 'M' then timeStamp = string.format('%04i-%02i-%02i', 2000, datenum[2], 1 ) elseif datecode == 'MD' then timeStamp = string.format('%04i-%02i-%02i', 2000, datenum[2], datenum[3] ) else timeStamp = nil -- format not supported end return timeStamp, datecode end --------------------------------------------------------------------------------------- -- trim leading zeros in years prior to year 1000 -- INPUT: -- * datestr - translated date string -- * lang - language of translation -- OUTPUT: -- * datestr - updated date string local function trimYear(datestr, year, lang) local yearStr0, yearStr1, yearStr2, zeroStr yearStr0 = string.format('%04i', year ) -- 4 digit year in standard form "0123" yearStr1 = mw.language.new(lang):formatDate( 'Y', yearStr0) -- same as calling {{#time}} parser function --yearStr1 = mw.getCurrentFrame():callParserFunction( "#time", { 'Y', yearStr0, lang } ) -- translate to a language if yearStr0==yearStr1 then -- most of languages use standard form of year yearStr2 = tostring(year) else -- some languages use different characters for numbers yearStr2 = yearStr1 zeroStr = mw.ustring.sub(yearStr1,1,1) -- get "0" in whatever language for i=1,3 do -- trim leading zeros if mw.ustring.sub(yearStr2,1,1)==zeroStr then yearStr2 = mw.ustring.sub(yearStr2, 2, 5-i) else break end end end return string.gsub(datestr, yearStr1, yearStr2 ) -- in datestr replace long year with trimmed one end --------------------------------------------------------------------------------------- -- Look up proper format string to be passed to {{#time}} parser function -- INPUTS: -- * datecode: YMDHMS, YMDHM, YMD, YM, MD, Y, or M -- * day : Number between 1 and 31 (not needed for most languages) -- * lang : language -- OUTPUT: -- * dFormat : input to {{#time}} function local function getDateFormat(datecode, day, lang) local function parseFormat(dFormat, day) if dFormat:find('default') and #dFormat>10 then -- special (and messy) case of dFormat code depending on a day number -- then json contains a string with more json containing "default" field and 2 digit day keys -- if desired day is not in that json than use "default" case dFormat = dFormat:gsub('”','"') -- change fancy double quote to a straight one, used for json marking local D = mw.text.jsonDecode( dFormat ) --com = mw.dumpObject(D) day = string.format('d%02i',day) -- create day key dFormat = D[day] or D.default dFormat = dFormat:gsub("'", '"') -- change single quote to a double quote, used for {{#time}} marking end return dFormat end local T = {} local tab = mw.ext.data.get('DateI18n.tab', lang) for _, row in pairs(tab.data) do -- convert the output into a dictionary table local id, _, msg = unpack(row) T[id] = msg end local dFormat = T[datecode] if dFormat=='default' and (datecode=='YMDHMS' or datecode=='YMDHM') then -- for most languages adding hour:minute:second is done by adding ", HH:MM:SS to the -- day precission date, those languages are skipped in DateI18n.tab and default to -- English which stores word "default" dFormat = parseFormat(T['YMD'], day).. ', H:i' if datecode=='YMDHMS' then dFormat = dFormat .. ':s' end else dFormat = parseFormat(dFormat, day) end return dFormat end --------------------------------------------------------------------------------------- -- Look up proper format string to be passed to {{#time}} parser function -- INPUTS: -- * month : month number -- * case : gramatic case abbriviation, like "ins", "loc" -- * lang : language -- OUTPUT: -- * dFormat : input to {{#time}} function local function MonthCase(month, case, lang) local T = {{},{},{},{},{},{},{},{},{},{},{},{}} local tab = mw.ext.data.get('I18n/MonthCases.tab', lang) for _, row in pairs(tab.data) do local mth, cs, msg = unpack(row) T[mth][cs] = msg end return T[month][case] end -- ================================================== -- === External functions =========================== -- ================================================== local p = {} --[[ ======================================================================================== Date This function is the core part of the ISOdate template. Usage: local Date = require('Module:DateI18n')._Date local dateStr = Date({2020, 12, 30, 12, 20, 11}, lang) Parameters: * {year,month,day,hour,minute,second, tzhour, tzmin}: broken down date-time component strings or numbers tzhour, tzmin are timezone offsets from UTC, hours and minutes * lang: The language to display it in * case: Language format (genitive, etc.) for some languages * class: CSS class for the <time> node, use "" for no metadata at all ]] function p._Date(datevec, lang, case, class, trim_year) -- make sure inputs are in the right format if not lang or not mw.language.isValidCode( lang ) then lang = mw.getCurrentFrame():callParserFunction( "int", "lang" ) -- get user's chosen language end if lang == 'be-tarsk' then lang = 'be-x-old' end -- process datevec and extract timeStamp and datecode strings as well as numeric datenum array local datecode, datenum = parserDatevec(datevec) local year, month, day = datenum[1], datenum[2], datenum[3] local timeStamp, datecode = getTimestamp(datecode, datenum) if not timeStamp then -- something went wrong in parserDatevec return '' end -- Commons [[Data:DateI18n.tab]] page stores prefered formats for diferent -- languages and datecodes (specifying year-month-day or just year of month-day, etc) -- Look up country specific format input to {{#time}} function local dFormat = getDateFormat(datecode, day, lang) -- By default the gramatical case is not specified (case=='') allowing the format to be specified -- in [[Data:DateI18n.tab]]. You can overwrite the default grammatical case of the month by -- specifying "case" variable. This is needed mostly by Slavic languages to create more complex -- phrases as it is done in [[c:Module:Complex date]] case = case or '' if (lang=='qu' or lang=='qug') and (case=='nom') then -- Special case related to Quechua and Kichwa languages. The form in the I18n is -- Genitive case with suffix "pi" added to month names provided by {#time}} -- in Nominative case that "pi" should be removed -- see https://commons.wikimedia.org/wiki/Template_talk:Date#Quechua from 2014 dFormat = dFormat:gsub('F"pi"', 'F') elseif (case=='gen') then dFormat = strReplace(dFormat, "F", "xg") elseif (case=='nom') then dFormat = strReplace(dFormat, "xg", "F") elseif (case ~= '') then -- see is page [[Data:I18n/MonthCases.tab]] on Commons have name of the month -- in specific gramatic case in desired language. If we have it than replace -- "F" and xg" in dFormat local monthMsg = MonthCase(month, case, lang) if monthMsg and monthMsg ~= '' then -- make sure it exists dFormat = strReplace(dFormat, 'F', '"'..monthMsg..'"') -- replace default month with month name we already looked up dFormat = strReplace(dFormat, 'xg', '"'..monthMsg..'"') end end -- Translate the date using specified format -- See https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language:formatDate and -- https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions##time for explanation of the format local datestr = mw.language.new(lang):formatDate( dFormat, timeStamp) -- same as using {{#time}} parser function -- Special case related to Thai solar calendar: prior to 1940 new-year was at different -- time of year, so just year (datecode=='Y') is ambiguous and is replaced by "YYYY or YYYY" phrase if lang=='th' and datecode=='Y' and year<=1940 then datestr = string.format('%04i หรือ %04i', year+542, year+543 ) end -- If year<1000 than either keep the date padded to the length of 4 digits or trim it -- decide if the year will stay padded with zeros (for years in 0-999 range) if year and year<1000 then if type(trim_year)=='nil' then trim_year = '100-999' end local trim = yesno(trim_year,nil) -- convert to boolean if trim==nil and type(trim_year)=='string' then -- if "trim_year" not a simple True/False than it is range of dates -- for example '100-999' means to pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is local YMin, YMax = trim_year:match( '(%d+)-(%d+)' ) trim = (YMin~=nil and year>=tonumber(YMin) and year<=tonumber(YMax)) end if trim==true then datestr = trimYear(datestr, year, lang) -- in datestr replace long year with trimmed one end end -- append timezone if present if datenum[7] and (datecode == 'YMDHMS' or datecode == 'YMDHM') then -- use {{#time}} parser function to create timezone string, so that we use correct character set local sign = (datenum[7]<0) and '−' or '+' timeStamp = string.format("2000-01-01 %02i:%02i:00", math.abs(datenum[7]), datenum[8] or 0) local timezone = mw.language.new(lang):formatDate( 'H:i', timeStamp) -- same as using {{#time}} parser function datestr = string.format("%s %s%s", datestr, sign, timezone ) end -- html formating and tagging of date string if class and class ~= '' and datecode~='M' and datecode~='MD'then local DateHtmlTags = '<span style="white-space:nowrap"><time class="%s" datetime="%s">%s</time></span>' datestr = DateHtmlTags:format(class, timeStamp, datestr) end return datestr end --[[ ======================================================================================== Date This function is the core part of the ISOdate template. Usage: {{#invoke:DateI18n|Date|year=|month=|day=|hour=|minute=|second=|tzhour=|tzmin=|lang=en}} Parameters: * year, month, day, hour, minute, second: broken down date-time component strings * tzhour, tzmin: timezone offset from UTC, hours and minutes * lang: The language to display it in * case: Language format (genitive, etc.) for some languages * class: CSS class for the <time> node, use "" for no metadata at all ]] function p.Date(frame) local args = {} for name, value in pairs( frame.args ) do name = string.gsub( string.lower(name), ' ', '_') args[name] = value end return p._Date( { args.year, args.month, args.day, args.hour, args.minute, args.second, args.tzhour, args.tzmin }, args.lang, -- language args.case, -- allows to specify grammatical case for the month for languages that use them args.class or 'dtstart', -- allows to set the html class of the time node where the date is included. This is useful for microformats. args.trim_year or '100-999' -- by default pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is ) end return p lcwmkh5p6iicle9dw7qzn6d8j6xkduv ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း Wales 10 34194 112335 2025-06-26T07:27:03Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း မိူင်းဝေးလ်သ်]] 112335 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း မိူင်းဝေးလ်သ်]] sri6cgsmpj0n2ptw2niajfs17lii58y ထႅမ်းပလဵတ်ႉ:Full-time equivalent 10 34195 112336 2025-06-26T07:28:29Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "(on an [[Full-time equivalent|FTE]] basis)<noinclude>{{documentation}}</noinclude>" 112336 wikitext text/x-wiki (on an [[Full-time equivalent|FTE]] basis)<noinclude>{{documentation}}</noinclude> p7g34ez1y02dndhfs2ze9tpjzpfgxwb ထႅမ်းပလဵတ်ႉ:Full-time equivalent/doc 10 34196 112337 2025-06-26T07:28:58Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Documentation subpage}} {{tsh|FTE}} This template inserts the phrase {{tq|(on an [[Full-time equivalent|FTE]] basis)}} to a page. It takes no parameters. <includeonly>{{Sandbox other|| <!-- Categories below this line --> [[Category:Education templates]] }}</includeonly>" 112337 wikitext text/x-wiki {{Documentation subpage}} {{tsh|FTE}} This template inserts the phrase {{tq|(on an [[Full-time equivalent|FTE]] basis)}} to a page. It takes no parameters. <includeonly>{{Sandbox other|| <!-- Categories below this line --> [[Category:Education templates]] }}</includeonly> 843ps8w9x2jq64fro58gmk5bfu2z0q9 ထႅမ်းပလဵတ်ႉ:FTE 10 34197 112338 2025-06-26T07:29:08Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:Full-time equivalent]] 112338 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:Full-time equivalent]] 5rk1bhtqtbnzh75juj814jp19t9bu3g ထႅမ်းပလဵတ်ႉ:Has short description 10 34198 112339 2025-06-26T07:29:48Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{#invoke:string2 |findpagetext |text={%{ *[Ss]hort description |plain=false |title={{{title|{{{1|}}} }}} }}<noinclude> {{documentation}} </noinclude>" 112339 wikitext text/x-wiki {{#invoke:string2 |findpagetext |text={%{ *[Ss]hort description |plain=false |title={{{title|{{{1|}}} }}} }}<noinclude> {{documentation}} </noinclude> ft5kyvczz6qco0i5pi6lhc8wxmanu4c ထႅမ်းပလဵတ်ႉ:Has short description/doc 10 34199 112340 2025-06-26T07:30:14Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Documentation subpage}} {{High-use}} {{Lua|Module:String2}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> Convenience template that returns the position of the phrase <code><nowiki>{{short description</nowiki></code> within the article wiki-text, or nothing if the phrase does not exist. It can take an optional parameter {{para|title}} (or the first unnamed parameter..." 112340 wikitext text/x-wiki {{Documentation subpage}} {{High-use}} {{Lua|Module:String2}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> Convenience template that returns the position of the phrase <code><nowiki>{{short description</nowiki></code> within the article wiki-text, or nothing if the phrase does not exist. It can take an optional parameter {{para|title}} (or the first unnamed parameter) which is the title of the page to test. The title defaults to the current page if not supplied. == လွင်ႈၸႂ်ႉတိုဝ်း == Examples: * <code><nowiki>{{Has short description |title=Loyola Academy}}</nowiki></code> → {{Has short description |title=Loyola Academy}} * <code><nowiki>{{Has short description |title=Rock Bridge High School}}</nowiki></code> → {{Has short description |title=Rock Bridge High School}} It is directly useable in tests within templates like <code><nowiki>{{#if:{{Has short description}} |Something when short description exists |Something when short description doesn't exist}}</nowiki></code>. It may find use in infoboxes that generate short descriptions (with categories, etc.), where it is desirable to suppress the generated short description if one already exists. <includeonly>{{sandbox other|| <!-- Categories below this line; interwikis at Wikidata --> [[Category:Short description templates]] }}</includeonly> rk12qydlmph1eb4lto1vk21tod8noid ထႅမ်းပလဵတ်ႉ:Infobox NRHP 10 34200 112341 2025-06-26T07:33:34Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "<includeonly>{{#ifeq:{{{embed|}}}|yes||{{main other|{{short description|United States historic place|noreplace}}}}}}</includeonly>{{Infobox |child={{#ifeq:{{{embed|}}}|yes|yes}} |bodystyle = border-spacing:1px;{{#if:{{{borderless|}}}|border-collapse:collapse; border-spacing:0px; border:none; width:100%; margin:0px; font-size:100%; clear:none; float:none}} |subheaderstyle = padding:0; border:none; |subheader = {{info..." 112341 wikitext text/x-wiki <includeonly>{{#ifeq:{{{embed|}}}|yes||{{main other|{{short description|United States historic place|noreplace}}}}}}</includeonly>{{Infobox |child={{#ifeq:{{{embed|}}}|yes|yes}} |bodystyle = border-spacing:1px;{{#if:{{{borderless|}}}|border-collapse:collapse; border-spacing:0px; border:none; width:100%; margin:0px; font-size:100%; clear:none; float:none}} |subheaderstyle = padding:0; border:none; |subheader = {{infobox|child=yes |data1 = <includeonly><div class="skin-nightmode-reset-color" style="width:100%; font-size:110%; font-weight:bold;color: #202122; background:{{Designation/color|NRHP}}; line-height:1.5">{{{name|{{PAGENAMEBASE}}}}}</div></includeonly> |data2 = {{#ifeq:{{#invoke:String|find|source={{{refnum|}}}|target=^%s*(%d%d%d%d%d%d%d%d)|plain=false}}|0|{{#if:{{#switch:{{lc:{{{nrhp_type|}}}}}|cp|nhldcp=a}}{{#switch:{{lc:{{{nrhp_type2|}}}}}|cp|nhldcp=a}}{{#switch:{{lc:{{{nrhp_type3|}}}}}|cp|nhldcp=a}}{{#switch:{{lc:{{{nrhp_type4|}}}}}|cp|nhldcp=a}}||{{cat handler|main=[[Category:NRHP infobox needing cleanup]]}}}}|<div style="width:100%; text-align:center; line-height:1.5;color: #202122; background:{{#if:{{{delisted|}}}|&#35;ddd|{{Designation/color|NRHP}}}};">{{#if:{{{delisted|}}}|Formerly listed on the&nbsp;}}[[National Register of Historic Places|U.S. National Register of Historic Places]]</div>}} |data3 = {{#if:{{lc:{{{nrhp_type|}}}}}|{{#ifeq:{{lc:{{{nrhp_type}}}}}|nrhp||<div style="width:100%; text-align:center; line-height:1.4; color: #202122; background:{{Infobox NRHP/conv|color|{{lc:{{{nrhp_type}}}}}}}">{{Infobox NRHP/conv|text|{{lc:{{{nrhp_type}}}}}|{{#if:{{{nocat|}}}|nocat|{{#if:{{{locmapin|}}}|{{#switch:{{{locmapin}}}|New York|New York#USA=New York (state)|USA Georgia=Georgia (U.S. state)|USA Washington|Washington=Washington (state)|District of Columbia|USA District of Columbia|Washington DC|Washington, DC|United States Washington, D.C.=Washington, D.C.|US Virgin Islands=the United States Virgin Islands|USA=the United States|{{{locmapin}}}}}|the United States}}}}}}</div>}}}} |data4 = {{#if:{{lc:{{{nrhp_type2|}}}}}|{{#ifeq:{{lc:{{{nrhp_type2}}}}}|nrhp||<div style="width:100%; text-align:center; line-height:1.5; color: #202122;background:{{Infobox NRHP/conv|color|{{lc:{{{nrhp_type2}}}}}}}">{{Infobox NRHP/conv|text|{{lc:{{{nrhp_type2}}}}}|{{#if:{{{nocat|}}}|nocat|{{#if:{{{locmapin|}}}|{{#switch:{{{locmapin}}}|New York|New York#USA=New York (state)|USA Georgia=Georgia (U.S. state)|USA Washington|Washington=Washington (state)|District of Columbia|USA District of Columbia|Washington DC|Washington, DC|United States Washington, D.C.=Washington, D.C.|US Virgin Islands=the United States Virgin Islands|USA=the United States|{{{locmapin}}}}}|the United States}}}}}}</div>}}}} |data5 = {{#if:{{lc:{{{nrhp_type3|}}}}}|{{#ifeq:{{lc:{{{nrhp_type3}}}}}|nrhp||<div style="width:100%; text-align:center; line-height:1.5; color: #202122;background:{{Infobox NRHP/conv|color|{{lc:{{{nrhp_type3}}}}}}}">{{Infobox NRHP/conv|text|{{lc:{{{nrhp_type3}}}}}|{{#if:{{{nocat|}}}|nocat|{{#if:{{{locmapin|}}}|{{#switch:{{{locmapin}}}|New York|New York#USA=New York (state)|USA Georgia=Georgia (U.S. state)|USA Washington|Washington=Washington (state)|District of Columbia|USA District of Columbia|Washington DC|Washington, DC|United States Washington, D.C.=Washington, D.C.|US Virgin Islands=the United States Virgin Islands|USA=the United States|{{{locmapin}}}}}|the United States}}}}}}</div>}}}} |data6 = {{#if:{{lc:{{{nrhp_type4|}}}}}|{{#ifeq:{{lc:{{{nrhp_type4}}}}}|nrhp||<div style="width:100%; text-align:center; line-height:1.5;color: #202122; background:{{Infobox NRHP/conv|color|{{lc:{{{nrhp_type4}}}}}}}">{{Infobox NRHP/conv|text|{{lc:{{{nrhp_type4}}}}}|{{#if:{{{nocat|}}}|nocat|{{#if:{{{locmapin|}}}|{{#switch:{{{locmapin}}}|New York|New York#USA=New York (state)|USA Georgia=Georgia (U.S. state)|USA Washington|Washington=Washington (state)|District of Columbia|USA District of Columbia|Washington DC|Washington, DC|United States Washington, D.C.=Washington, D.C.|US Virgin Islands=the United States Virgin Islands|USA=the United States|{{{locmapin}}}}}|the United States}}}}}}</div>}}}} |data7 = {{#if:{{{designated_other1_name|{{{designated_other1|}}}}}}|<div style="width:100%; text-align:center; line-height:1.5;color: #202122; background:{{#ifeq:{{Designation/text|{{{designated_other1|}}}}}|Invalid designation|{{{designated_other1_color|#FFF}}}|{{Designation/color|{{{designated_other1|}}}}}}}">{{#ifeq:{{Designation/text|{{{designated_other1|}}}}}|Invalid designation|{{#if:{{{designated_other1_textcolor|}}}|{{auto link|{{{designated_other1_link}}}|<span style{{=}}"color:{{{designated_other1_textcolor}}}">{{{designated_other1_name}}}</span>}}|{{auto link|{{{designated_other1_link}}}|{{{designated_other1_name}}}}}}}|{{Designation/text|{{{designated_other1|}}}}}}}{{#if:{{#switch:{{{designated_other1_num_position|both}}}|both|top=a}}|{{#if:{{{designated_other1_number|}}}|&nbsp;{{abbr|No.|number}}&nbsp;{{{designated_other1_number}}}}}}}</div>}} |data8 = {{#if:{{{designated_other2_name|{{{designated_other2|}}}}}}|<div style="width:100%; text-align:center; line-height:1.5;color: #202122; background:{{#ifeq:{{Designation/text|{{{designated_other2|}}}}}|Invalid designation|{{{designated_other2_color|#FFF}}}|{{Designation/color|{{{designated_other2|}}}}}}}">{{#ifeq:{{Designation/text|{{{designated_other2|}}}}}|Invalid designation|{{#if:{{{designated_other2_textcolor|}}}|{{auto link|{{{designated_other2_link}}}|<span style{{=}}"color:{{{designated_other2_textcolor}}}">{{{designated_other2_name}}}</span>}}|{{auto link|{{{designated_other2_link}}}|{{{designated_other2_name}}}}}}}|{{Designation/text|{{{designated_other2|}}}}}}}{{#if:{{#switch:{{{designated_other2_num_position|both}}}|both|top=a}}|{{#if:{{{designated_other2_number|}}}|&nbsp;{{abbr|No.|number}}&nbsp;{{{designated_other2_number}}}}}}}</div>}} |data9 = {{#if:{{{designated_other3_name|{{{designated_other3|}}}}}}|<div style="width:100%; text-align:center; line-height:1.5; color: #202122;background:{{#ifeq:{{Designation/text|{{{designated_other3|}}}}}|Invalid designation|{{{designated_other3_color|#FFF}}}|{{Designation/color|{{{designated_other3|}}}}}}}">{{#ifeq:{{Designation/text|{{{designated_other3|}}}}}|Invalid designation|{{#if:{{{designated_other3_textcolor|}}}|{{auto link|{{{designated_other3_link}}}|<span style{{=}}"color:{{{designated_other3_textcolor}}}">{{{designated_other3_name}}}</span>}}|{{auto link|{{{designated_other3_link}}}|{{{designated_other3_name}}}}}}}|{{Designation/text|{{{designated_other3|}}}}}}}{{#if:{{#switch:{{{designated_other3_num_position|both}}}|both|top=a}}|{{#if:{{{designated_other3_number|}}}|&nbsp;{{abbr|No.|number}}&nbsp;{{{designated_other3_number}}}}}}}</div>}} }} |image1 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_size|}}}|sizedefault=frameless|upright=1.136|alt={{{alt|}}}}} |caption1 = {{{caption|}}} |image2 = {{#if:{{{district_map|}}} |{{#invoke:InfoboxImage|InfoboxImage|image={{{district_map|}}}|size={{{map_width|}}}|sizedefault=frameless|upright=1.136|alt={{{map_alt|}}}}} |{{#if:{{both|{{{locmapin|}}}|{{{coordinates|}}}{{#switch:{{#property:P625}}|unknown value|=|#default=1}}}}|{{Location map|{{{locmapin|USA}}}|border=infobox|float=center|alt={{{map_alt|}}}|relief={{{locmap_relief|}}}|coordinates={{{coordinates|}}}|label={{{map_label|{{{locmap_label|}}}}}}|label_width={{{label_width|}}}|label_size={{{label_size|}}}|position={{{label_position|{{{locmap_label_position|}}}}}}|background={{{label_background|}}}|marksize=7|width={{{map_width|250}}}|caption={{{map_caption|}}}}} }} }} |caption2 = {{#if:{{{district_map|}}}|{{{map_caption|}}}}} |image3 = {{#invoke:Infobox mapframe|auto|mapframe-frame-width=250}} |caption3 = {{#invoke:Infobox mapframe|autocaption}} |headerstyle=color: #202122;background:{{#if:{{{delisted|}}}|&#35;ddd|{{Designation/color|NRHP}}}} |datastyle = border: 0;<!---Style fix for when embedding in bordered infoboxes---> |labelstyle = font-weight:bold; border: 0; |label1 = Location |data1 = {{{location|}}} |label2 = Nearest city |data2 = {{{nearest_city|}}} <!--- Coordinates ---> |label3 = {{#ifeq:{{{coord_display}}}|title||Coordinates}} |data3 = {{#if:{{{coordinates|}}}|{{#invoke:Coordinates|coordinsert|{{{coordinates|}}}|type:landmark|region:{{Country abbreviation|United States|{{Infobox NRHP/locmapin2region|{{{locmapin|}}}}}}}}}|}} |label4 = Area |data4 = {{{area|}}} |label5 = Built |data5 = {{{built|}}} |label6 = Built by |data6 = {{{builder|}}} |label7 = Architect |data7 = {{{architect|}}} |label8 = Engineer |data8 = {{{engineer|}}} |label9 = {{{customarchitect_title|}}} |data9 = {{{customarchitect|}}} |label10 = Architectural&nbsp;style |data10 = {{{architecture|}}} |label11 = Demolished |data11 = {{{demolished|}}} |label12 = Restored |data12 = {{{restored|}}} |label13 = Restored by |data13 = {{{restored_by|}}} |label14 = Visitation |data14 = {{#if:{{{visitation_num|}}}|{{{visitation_num}}} {{#if:{{{visitation_year|}}}|({{{visitation_year}}})}}}}{{#if:{{{visitation_ref|}}}|{{{visitation_ref}}}}} |label15 = Website |data15 = {{{website|}}} <!-- leave space for possible future expansion of basic information parameters --> |label20 = Part of |data20 = {{#if:{{{partof2|}}} |{{Unbulleted list |1={{#if:{{{partof|}}}|{{auto link|{{{partof|}}}}} {{#if:{{{partof_refnum|}}}|({{#invoke:String|replace|{{{partof_refnum}}}|(%d+)|[{{NRHP Focus|%1|url=yes}} #%1]|1|false}})}}}} |2={{#if:{{{partof2|}}}|{{auto link|{{{partof2|}}}}} {{#if:{{{partof2_refnum|}}}|({{#invoke:String|replace|{{{partof2_refnum}}}|(%d+)|[{{NRHP Focus|%1|url=yes}} ID%1]|1|false}})}}}} }} |{{#if:{{{partof|}}}|{{auto link|{{{partof|}}}}} {{#if:{{{partof_refnum|}}}|({{#invoke:String|replace|{{{partof_refnum}}}|(%d+)|[{{NRHP Focus|%1|url=yes}} ID%1]|1|false}})}}}} }} |label21 = [[Multiple Property Submission|MPS]] |data21 = {{{mpsub|}}} |label22 = NRHP&nbsp;reference&nbsp;{{abbr|No.|number}} |data22 = {{#if:{{{refnum|}}}|{{#invoke:String|replace|{{{refnum}}}|^%s*(%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}}}{{#if:{{{increase_refnum|{{{increase1_refnum|}}}}}}|&nbsp;(original)<br />{{#invoke:String|replace|{{{increase_refnum|{{{increase1_refnum}}}}}}|(%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(increase{{#if:{{{increase2_refnum|}}}|&nbsp;1}}){{#if:{{{increase2_refnum|}}}|<br />{{#invoke:String|replace|{{{increase2_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(increase&nbsp;2)}}{{#if:{{{increase3_refnum|}}}|<br />{{#invoke:String|replace|{{{increase3_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(increase&nbsp;3)}}{{#if:{{{increase4_refnum|}}}|<br />{{#invoke:String|replace|{{{increase4_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(increase&nbsp;4)}}}} {{#if:{{{decrease_refnum|{{{decrease1_refnum|}}}}}}|<br />{{#invoke:String|replace|{{{decrease_refnum|{{{decrease1_refnum|}}}}}}|(%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(decrease{{#if:{{{decrease2_refnum|}}}|&nbsp;1}}){{#if:{{{decrease2_refnum|}}}|<br />{{#invoke:String|replace|{{{decrease2_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(decrease&nbsp;2)}}{{#if:{{{decrease3_refnum|}}}|<br />{{#invoke:String|replace|{{{decrease3_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(decrease&nbsp;3)}}{{#if:{{{decrease4_refnum|}}}|<br />{{#invoke:String|replace|{{{decrease4_refnum}}}|(%d%d+)|[{{NRHP Focus|%1|url=yes}} %1]|1|false}}&nbsp;(decrease&nbsp;4)}}}} |label23 = {{#if:{{#switch:{{{designated_other1_num_position|both}}}|both|bottom=a}}|{{#ifeq:{{Designation/abbreviation|{{{designated_other1|}}}}}|???|{{uc:{{{designated_other1_abbr}}}}}|{{Designation/abbreviation|{{{designated_other1|}}}}}}}&nbsp;{{abbr|No.|number}}}} |data23 = {{#if:{{#switch:{{{designated_other1_num_position|both}}}|both|bottom=a}}|{{{designated_other1_number|}}}}} |label24 = {{#if:{{#switch:{{{designated_other2_num_position|both}}}|both|bottom=a}}|{{#ifeq:{{Designation/abbreviation|{{{designated_other2|}}}}}|???|{{uc:{{{designated_other2_abbr}}}}}|{{Designation/abbreviation|{{{designated_other2|}}}}}}}&nbsp;{{abbr|No.|number}}}} |data24 = {{#if:{{#switch:{{{designated_other2_num_position|both}}}|both|bottom=a}}|{{{designated_other2_number|}}}}} |label25 = {{#if:{{#switch:{{{designated_other3_num_position|both}}}|both|bottom=a}}|{{#ifeq:{{Designation/abbreviation|{{{designated_other3|}}}}}|???|{{uc:{{{designated_other3_abbr}}}}}|{{Designation/abbreviation|{{{designated_other3|}}}}}}}&nbsp;{{abbr|No.|number}}}} |data25 = {{#if:{{#switch:{{{designated_other3_num_position|both}}}|both|bottom=a}}|{{{designated_other3_number|}}}}} <!--- Begin significant dates; more space for possible future expansion ---> |header30 = {{#ifexpr:0{{#if:{{{designated_other1_date|}}}|1}}{{#if:{{{designated_other2_date|}}}|1}}{{#if:{{{designated_other3_date|}}}|1}}{{#if:{{{added|}}}|1}}{{#if:{{{increase|}}}|1}}{{#if:{{{increase2|}}}|1}}{{#if:{{{increase3|}}}|1}}{{#if:{{{decrease|}}}|1}}{{#if:{{{decrease2|}}}|1}}{{#if:{{{decrease3|}}}|1}}{{#if:{{{designated_nrhp_type|}}}|1}}{{#if:{{{designated_nrhp_type2|}}}|1}}{{#if:{{{designated_nrhp_type3|}}}|1}}{{#if:{{{designated_nrhp_type4|}}}|1}}{{#if:{{{delisted|}}}|1}}{{#if:{{{delisted_nrhp_type|}}}|1}}{{#if:{{{delisted_nrhp_type2|}}}|1}}{{#if:{{{delisted_nrhp_type3|}}}|1}}{{#if:{{{delisted_nrhp_type4|}}}|1}}{{#if:{{{delisted_other1_date|}}}|1}}{{#if:{{{delisted_other2_date|}}}|1}}{{#if:{{{delisted_other3_date|}}}|1}}{{#if:{{{sigdate1|{{{sigdate|}}}}}}|1}}{{#if:{{{sigdate2|}}}|1}}{{#if:{{{sigdate3|}}}|1}}>1|Significant dates}} |label31 = {{{sigdate1_label|{{{sigdate_label|}}}}}} |data31 = {{{sigdate1|{{{sigdate|}}}}}} |label32 = {{{sigdate2_label|}}} |data32 = {{{sigdate2|}}} |label33 = {{{sigdate3_label|}}} |data33 = {{{sigdate3|}}} |label34 = Added to NRHP |data34 = {{{added|}}} |label35 = Boundary&nbsp;increase{{#if:{{{increase2|}}}|s}} |data35 = {{{increase|{{{increase1|}}}}}}{{#if:{{{increase2|}}}|<br />{{{increase2}}}}}{{#if:{{{increase3|}}}|<br />{{{increase3}}}}}{{#if:{{{increase4|}}}|<br />{{{increase4}}}}} |label36 = Boundary&nbsp;decrease{{#if:{{{decrease2|}}}|s}} |data36 = {{{decrease|{{{decrease1|}}}}}}{{#if:{{{decrease2|}}}|<br />{{{decrease2}}}}}{{#if:{{{decrease3|}}}|<br />{{{decrease3}}}}}{{#if:{{{decrease4|}}}|<br />{{{decrease4}}}}} |label37 = Designated&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type}}}}}}} |data37 = {{{designated_nrhp_type|}}} |label38 = Designated&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type2}}}}}}} |data38 = {{{designated_nrhp_type2|}}} |label39 = Designated&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type3}}}}}}} |data39 = {{{designated_nrhp_type3|}}} |label40 = Designated&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type4}}}}}}} |data40 = {{{designated_nrhp_type4|}}} |label41 = Designated&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other1|}}}}}|???|{{uc:{{{designated_other1_abbr}}}}}|{{Designation/abbreviation|{{{designated_other1|}}}}}}} |data41 = {{{designated_other1_date|}}} |label42 = Designated&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other2|}}}}}|???|{{uc:{{{designated_other2_abbr}}}}}|{{Designation/abbreviation|{{{designated_other2|}}}}}}} |data42 = {{{designated_other2_date|}}} |label43 = Designated&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other3|}}}}}|???|{{uc:{{{designated_other3_abbr}}}}}|{{Designation/abbreviation|{{{designated_other3|}}}}}}} |data43 = {{{designated_other3_date|}}} |label44 = Removed from NRHP |data44 = {{{delisted|}}} |label45 = Delisted&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type}}}}}}} |data45 = {{{delisted_nrhp_type|}}} |label46 = Delisted&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type2}}}}}}} |data46 = {{{delisted_nrhp_type2|}}} |label47 = Delisted&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type3}}}}}}} |data47 = {{{delisted_nrhp_type3|}}} |label48 = Delisted&nbsp;{{Infobox NRHP/conv|abbr|{{lc:{{{nrhp_type4}}}}}}} |data48 = {{{delisted_nrhp_type4|}}} |label49 = Delisted&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other1|}}}}}|???|{{uc:{{{designated_other1_abbr}}}}}|{{Designation/abbreviation|{{{designated_other1|}}}}}}} |data49 = {{{delisted_other1_date|}}} |label50 = Delisted&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other2|}}}}}|???|{{uc:{{{designated_other2_abbr}}}}}|{{Designation/abbreviation|{{{designated_other2|}}}}}}} |data50 = {{{delisted_other2_date|}}} |label51 = Delisted&nbsp;{{#ifeq:{{Designation/abbreviation|{{{designated_other3|}}}}}|???|{{uc:{{{designated_other3_abbr}}}}}|{{Designation/abbreviation|{{{designated_other3|}}}}}}} |data51 = {{{delisted_other3_date|}}} | header52 = {{{embedded|{{{module|}}}}}} }}<!--End of infobox-->{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox NRHP with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox NRHP]] with unknown parameter "_VALUE_"|ignoreblank=y| added | alt | architect | architecture | area | borderless | builder | built | caption | coordinates | customarchitect_title | customarchitect | decrease | decrease_refnum | decrease1 | decrease1_refnum | decrease2 | decrease2_refnum | decrease3 | decrease3_refnum | decrease4 | decrease4_refnum | delisted | delisted_nrhp_type | delisted_nrhp_type2 | delisted_nrhp_type3 | delisted_nrhp_type4 | delisted_other1_date | delisted_other2_date | delisted_other3_date | demolished | designated_nrhp_type | designated_nrhp_type2 | designated_nrhp_type3 | designated_nrhp_type4 | designated_other1 | designated_other1_abbr | designated_other1_color | designated_other1_date | designated_other1_link | designated_other1_name | designated_other1_num_position | designated_other1_number | designated_other1_textcolor | designated_other2 | designated_other2_abbr | designated_other2_color | designated_other2_date | designated_other2_link | designated_other2_name | designated_other2_num_position | designated_other2_number | designated_other2_textcolor | designated_other3 | designated_other3_abbr | designated_other3_color | designated_other3_date | designated_other3_link | designated_other3_name | designated_other3_num_position | designated_other3_number | designated_other3_textcolor | district_map | embed | engineer | image | image_size | increase | increase_refnum | increase1 | increase1_refnum | increase2 | increase2_refnum | increase3 | increase3_refnum | increase4 | increase4_refnum | label_background | label_position | label_size | label_width | location | locmap_label | locmap_label_position | locmap_relief | locmapin | map_alt | map_caption | map_label | map_width | mpsub | name | nearest_city | nocat | nrhp_type | nrhp_type2 | nrhp_type3 | nrhp_type4 | partof | partof_refnum | partof2 | partof2_refnum | refnum | restored | restored_by | sigdate | sigdate_label | sigdate1 | sigdate1_label | sigdate2 | sigdate2_label | sigdate3 | sigdate3_label | visitation_num | visitation_ref | visitation_year | website | mapframe | mapframe-caption | mapframe-custom | mapframe-id | mapframe-coord | mapframe-wikidata | mapframe-point | mapframe-shape | mapframe-frame-width | mapframe-frame-height | mapframe-shape-fill | mapframe-shape-fill-opacity | mapframe-stroke-color | mapframe-stroke-colour | mapframe-stroke-width | mapframe-marker | mapframe-marker-color | mapframe-marker-colour | mapframe-geomask | mapframe-geomask-stroke-color | mapframe-geomask-stroke-colour | mapframe-geomask-stroke-width | mapframe-geomask-fill | mapframe-geomask-fill-opacity | mapframe-zoom | mapframe-length_km | mapframe-length_mi | mapframe-area_km2 | mapframe-area_mi2 | mapframe-frame-coordinates | mapframe-frame-coord | mapframe-switcher | embedded | module }}<!-- -->{{Main other|{{#if:{{{nocat|}}}|[[Category:NRHP infobox with nocat]]}}}}<noinclude> {{documentation}} </noinclude> iqvo191hta4qg49dv2fths7z9icxn9t ထႅမ်းပလဵတ်ႉ:Infobox NRHP/doc 10 34201 112342 2025-06-26T07:35:00Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{High-use}} {{Auto short description|conditions=unless it is embedded as a module}} {{Lua|Module:Infobox|Module:InfoboxImage|Module:String|Module:Coordinates|Module:Check for unknown parameters}} {{Infobox NRHP | name = {{{name}}} | refnum = {{{refnum}}} | de..." 112342 wikitext text/x-wiki {{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{High-use}} {{Auto short description|conditions=unless it is embedded as a module}} {{Lua|Module:Infobox|Module:InfoboxImage|Module:String|Module:Coordinates|Module:Check for unknown parameters}} {{Infobox NRHP | name = {{{name}}} | refnum = {{{refnum}}} | delisted = {{{delisted}}} | nocat = {{{nocat}}} | locmapin = {{{locmapin}}} | designated_other1_name = {{{designated_other1_name}}} | designated_other1 = {{{designated_other1}}} | designated_other1_color = {{{designated_other1_color}}} | designated_other1_textcolor = {{{designated_other1_textcolor}}} | designated_other1_link = {{{designated_other1_link}}} | designated_other1_num_position = {{{designated_other1_num_position}}} | designated_other1_number = {{{designated_other1_number}}} | designated_other2_name = {{{designated_other2_name}}} | designated_other2 = {{{designated_other2}}} | designated_other2_color = {{{designated_other2_color}}} | designated_other2_textcolor = {{{designated_other2_textcolor}}} | designated_other2_link = {{{designated_other2_link}}} | designated_other2_num_position = {{{designated_other2_num_position}}} | designated_other2_number = {{{designated_other2_number}}} | image = {{{image}}} | image_size = {{{image_size}}} | alt = {{{alt}}} | caption = {{{caption}}} | district_map = {{{district_map}}} | map_width = {{{map_width}}} | map_alt = {{{map_alt}}} | map_caption = {{{map_caption}}} | locmap_relief = {{{locmap_relief}}} | map_label = {{{map_label}}} | locmap_label = {{{locmap_label}}} | label_size = {{{label_size}}} | label_position = {{{label_position}}} | locmap_label_position = {{{locmap_label_position}}} | label_background = {{{label_background}}} | location = {{{location}}} | nearest_city = {{{nearest_city}}} | coordinates = {{{coordinates}}} | area = {{{area}}} | built = {{{built}}} | builder = {{{builder}}} | architect = {{{architect}}} | architecture = {{{architecture}}} | engineer = {{{engineer}}} | customarchitect_title = {{{customarchitect_title}}} | customarchitect = {{{customarchitect}}} | demolished = {{{demolished}}} | restored = {{{restored}}} | restored_by = {{{restored_by}}} | visitation_num = {{{visitation_num}}} | visitation_year = {{{visitation_year}}} | visitation_ref = {{{visitation_ref}}} | partof = {{{partof}}} | partof_refnum = {{{partof_refnum}}} | partof2 = {{{partof2}}} ({{{partof2_refnum}}}) | mpsub = {{{mpsub}}} | increase_refnum = {{{increase_refnum}}} | increase1_refnum = {{{increase_1refnum}}} | increase2_refnum = {{{increase_2refnum}}} | increase3_refnum = {{{increase_3refnum}}} | increase4_refnum = {{{increase_4refnum}}} | decrease_refnum = {{{decrease_refnum}}} | decrease1_refnum = {{{decrease1_refnum}}} | decrease2_refnum = {{{decrease2_refnum}}} | decrease3_refnum = {{{decrease3_refnum}}} | decrease4_refnum = {{{decrease4_refnum}}} | designated_other1_abbr = {{{designated_other1_abbr}}} | designated_other2_abbr = {{{designated_other2_abbr}}} | website = {{{website}}} | designated_other1_date = {{{designated_other1_date}}} | designated_other2_date = {{{designated_other2_date}}} | added = {{{added}}} | increase = {{{increase}}} | increase1 = {{{increase1}}} | increase2 = {{{increase2}}} | increase3 = {{{increase3}}} | increase4 = {{{increase4}}} | decrease = {{{decrease}}} | decrease1 = {{{decrease1}}} | decrease2 = {{{decrease2}}} | decrease3 = {{{decrease3}}} | decrease4 = {{{decrease4}}} | designated_nrhp_type = {{{designated_nrhp_type}}} | designated_nrhp_type2 = {{{designated_nrhp_type2}}} | delisted_nrhp_type = {{{delisted_nrhp_type}}} | delisted_nrhp_type2 = {{{delisted_nrhp_type2}}} | delisted_other1_date = {{{delisted_other1_date}}} | delisted_other2_date = {{{delisted_other2_date}}} | sigdate1_label = {{{sigdate1_label}}} | sigdate_label = {{{sigdate_label}}} | sigdate1 = {{{sigdate1}}} | sigdate = {{{sigdate}}} | sigdate2_label = {{{sigdate2_label}}} | sigdate2 = {{{sigdate2}}} }} This template is part of [[Wikipedia:WikiProject National Register of Historic Places|WikiProject National Register of Historic Places]]. The infobox should only be used on articles about sites listed on the [[National Register of Historic Places]]. For sites that are not listed on the register but otherwise historic, {{tl|Infobox historic site}} may be useful. Examples of the usage of this infobox are displayed at the bottom of the page. == Usage == To get started, copy and paste one of the following blank templates into the top of the article. There is also a tool developed by [[User:Elkman]] found [http://www.elkman.net/nrhp/infobox.php here] that will create a pre-filled infobox for any site listed on the register that can be pasted into an article. === Blank template with most common parameters === <syntaxhighlight lang="wikitext" style="width:50%;"> {{Infobox NRHP | name = | nrhp_type = | image = | alt = | caption = | mapframe = | mapframe-caption = | coordinates = <!-- {{coord|latitude|longitude|type:landmark|display=inline,title}} --> | location = | built = | architect = | architecture = | added = | designated_nrhp_type = | refnum = | website = <!-- {{URL|www.example.com}} --> | mpsub = }} </syntaxhighlight> === Blank template with all parameters === <syntaxhighlight lang="wikitext" style="width:50%"> {{Infobox NRHP | name = | nrhp_type = | nrhp_type2 = | nrhp_type3 = | nrhp_type4 = | designated_other1 = | designated_other1_name = | designated_other1_abbr = | designated_other1_color = | designated_other1_link = | designated_other2 = | designated_other2_name = | designated_other2_abbr = | designated_other2_color = | designated_other2_link = | designated_other3 = | designated_other3_name = | designated_other3_abbr = | designated_other3_color = | designated_other3_link = | partof = | partof_refnum = | image = | image_size = 240 | alt = | caption = | mapframe = | mapframe-caption = | district_map = | locmapin = | map_label = | label_position = | label_size = | label_background = | map_width = 235 | map_alt = | map_caption = | coordinates = <!-- {{coord|latitude|longitude|type:landmark|display=inline,title}} --> | location = | nearest_city = | area = | built = | builder = | demolished = | restored = | restored_by = | architect = | engineer = | customarchitect_title = | customarchitect = | architecture = | visitation_num = | visitation_year = | visitation_ref = | mpsub = | sigdate1_label = | sigdate1 = | sigdate2_label = | sigdate2 = | sigdate3_label = | sigdate3 = | added = | increase = | increase1 = | increase2 = | increase3 = | increase4 = | decrease = | decrease1 = | decrease2 = | decrease3 = | decrease4 = | delisted = | designated_nrhp_type = | designated_nrhp_type2 = | designated_nrhp_type3 = | designated_nrhp_type4 = | designated_other1_date = | designated_other2_date = | designated_other3_date = | delisted_nrhp_type = | delisted_nrhp_type2 = | delisted_nrhp_type3 = | delisted_nrhp_type4 = | delisted_other1_date = | delisted_other2_date = | delisted_other3_date = | refnum = | website = <!-- {{URL|www.example.com}} --> | increase_refnum = | increase1_refnum = | increase2_refnum = | increase3_refnum = | increase4_refnum = | decrease_refnum = | decrease1_refnum = | decrease2_refnum = | decrease3_refnum = | decrease4_refnum = | designated_other1_number = | designated_other1_num_position = both | designated_other2_number = | designated_other2_num_position = both | designated_other3_number = | designated_other3_num_position = both | nocat = }} </syntaxhighlight> == Parameters == All fields are optional because they use [[mw:Help:Extension:ParserFunctions|ParserFunctions]], which allow fields to be hidden if no value is set. Wikilinks are acceptable in any of the Infobox fields except coordinates and map parameters. Please spend some time at the [[Wikipedia:WikiProject National Register of Historic Places|National Register of Historic Places WikiProject]] article and its [[Wikipedia talk:WikiProject National Register of Historic Places|talk page]] for standards on presenting names and other data. {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{Coord|36|43|42|N|118|9|16|W|display=inline}} | locmapin = USA California | map_label =Manzanar War Relocation Center | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | designated_other1 = California Historical Landmark | designated_other1_date = 1972 | designated_other1_number = 850 | designated_other2 = LAHCM | designated_other2_date = September 15, 1976 | designated_other2_number = 160 | visitation_num = 81,344 | visitation_year = 2007 | refnum=76000484 }} === Designations === ''name'' — The NRHP listing name, preferably the exact name listed on the Register, although we turn around names that have been reordered for alphabetization purposes, such as "Smith, John, House". This does not have to match the name of the article. If the article name is different, then this name should also be included with bold text in the lead. :: '''''Example format —''' name = Manzanar War Relocation Center''. ''added'' — Date that the NRHP was added to the register. :: '''''Example format —''' added = July 30, 1976''. ''nrhp_type'' — Type of historic place (as defined by the [[National Park Service]]). Setting any value to this causes a bar to be shown across the top of the infobox with that designation and its standard color. Former designations grey out the bar and add the word "Former." {{hidden|style=width:50%|header=Accepted values|content="nrhp" — National Register of Historic Places<br />"nhl" — National Historic Landmark<br />"hd" — Historic District (more information [[#Districts|here]])<br />"nhld" — National Historic Landmark District (NHL that is also a historic district)<br />"cp" — Contributing Property to a Historic District (more info [[#Contributing properties|here]])<br />"nhldcp" — Contributing Property to a National Historic Landmark District<br />"indcp" — Contributing Property that is also individually listed (more info [[#Individually listed contributing property|here]])<br />"nmon" — National Monument<br />"nhs" — National Historic Site<br />"nmem" — National Memorial<br />"nhp" — National Historic Park<br />"nb" — National Battlefield<br />"nmp" — National Military Park<br />"nbp" — National Battlefield Park<br />"nbs" — National Battlefield Site<br />"nhr" — National Historic Reserve<br />"ihs" — International Historic Site<br /><br />If a property has been delisted from one of these designations, append "former" to the beginning of the value (i.e. "formernhl", "formerhd", etc.) "formernrhp" is also available, though not required. For more information about delistings, [[#Delistings|click here]].}} ''nrhp_type2'', ''nrhp_type3'', ''nrhp_type4'' — Second, third, and fourth type of historic place (some places may be designated as more than one); same accepted values as ''nrhp_type''. Setting a value to any these causes multiple bars to be displayed across the top of the infobox. ''designated_nrhp_type'' — Date the NRHP was designated a specific NPS title (NHL, NMEM, etc.). This parameter requires an acceptable value in ''nrhp_type''. :: '''''Example formats —''''' ::: If the site was designated a National Historic Landmark on January 1, 2000: :::: ''nrhp_type = nhl'', and ''designated_nrhp_type = January 1, 2000''. ::: Works with former designations as well; if the site is a former NHL, ''designated_nrhp_type'' is the date on which it was '''added''', not delisted. (There is another parameter for that date) :::: ''nrhp_type = formernhl'', and ''designated_nrhp_type = January 1, 2000''. ''designated_nrhp_type2'', ''designated_nrhp_type3'', ''designated_nrhp_type4'' — Date the NRHP was designated a second, third, or fourth specific NPS title (NHL, NMEM, etc.). Requires an acceptable value in ''nrhp_type'''n''''' and works like ''designated_nrhp_type''. ==== Local designations ==== Many sites are not only listed on the NRHP but on state or local registers as well. For example, [[Manzanar]] (the example infobox to the right) is listed on the NRHP but also as a [[California Historical Landmark]] and a [[Los Angeles Historic-Cultural Monument]]. For sites like Manzanar, the infobox contains parameters to allow information about the local register to be displayed as well. For sites that are ''not'' listed on the NRHP – ''only'' on the local register(s) – {{tl|Infobox historic site}} may be useful. '''Designations supported by Template:Designation''' This infobox supports use of [[Template:Designation]], which is a centralized template for standardizing the appearance of many state and local designations, as well as national and international ones. Adding any register supported by the Designation template (a list of supported designations can be found [[Template:Designation#Supported designations|here]]) requires only one parameter for full support. ''designated_other1'' – This parameter value must match up with the list of [[Template:Designation#Supported designations|designations supported by the Designation template]]. Setting a value for this parameter causes a bar to be displayed across the top of the infobox under the NPS bars. If the value is a valid callname, the bar's color, text, and abbreviation (used farther down in the infobox) are automatically filled in. :: '''''Example format –''' designated_other1 = California Historical Landmark'' would automatically color the bar gold and link to [[List of California Historical Landmarks]], as well as make the abbreviation "CHISL" show up farther down in the information section of the infobox. '''Designations not supported by Template:Designation''' To achieve the same effect as the above parameter for sites not supported by the Designation template, the following parameters are necessary. The use of the above ''designated_other1'' parameter overrides these. ''designated_other1_name'' — The name of the state or local register. :: '''''Example format —''' designated_other1_name = California Historical Landmark''. ''designated_other1_abbr'' — An abbreviation (preferably official) used for the state or local register. :: '''''Example format —''' designated_other1_abbr = CHISL''. ''designated_other1_color'' — The background color of the bar at the top of the infobox for that register. Accepts standard HTML colors and any hex value. Default value is white. :: '''''Example format —''' designated_other1_color = blue''. :: '''''Example format —''' designated_other1_color = #073ACF''. ''designated_other1_textcolor'' — The color of the text in the bar at the top of the infobox for that register. Accepts standard HTML colors and any hex value. If no value is set, the text appears as regular text, i.e. black for no link and blue for a link. :: '''''Example format —''' designated_other1_textcolor = white''. :: '''''Example format —''' designated_other1_textcolor = #FFFFFF''. ''designated_other1_link'' — If there is a Wikipedia article describing the local designation, type the name of it into this parameter, and the title bar will link to that page. :: '''''Example format —''' designated_other1_link = List of California Historical Landmarks'' '''All state and local designations''' For any site listed on a state or local register (even if it is supported by the Designation template), the following parameters are available ''designated_other1_date'' — Date that the site was declared the local designation set in ''designated_other1'' or ''designated_other1_name''. :: '''''Example format —''' designated_other1_date = January 1, 1972''. ''designated_other1_number'' — Much like the NRHP reference number (''refnum'' parameter explained below), some local designations have numbers (i.e. California Historic Landmark #850). This parameter allows the user to display that number. :: '''''Example format —''' designated_other1_number = 850''. ''designated_other1_num_position'' — Tells the infobox where to display the number declared above. Number can be displayed in the local designation's title bar (set parameter to "top"), in the information section of the infobox (set parameter to "bottom"), or both locations (set parameter to "both"). Default is both. :: '''''Example format —''' designated_other1_num_position = bottom''. If a site is listed on more than one state or local register, there are also ''designated_other2'' and ''designated_other3'' parameters, as well as the ''_name'', ''_color'', etc. parameters for subsequent designations. ====Limitation on adding international designations==== Using the above methods for inserting local designations, it is technically possible to also add international designations such as a [[World Heritage Site|UNESCO World Heritage Site]]. However, this infobox lists the NRHP designation first. Instead, articles such as [[Statue of Liberty]] use {{tl|Infobox historic site}} to list the international designation(s) first. === Delistings === ''delisted'' — Date that the NRHP was removed from the register. Setting a value to this parameter causes the NRHP bar to turn grey and adds the word "Former" to the beginning. :: '''''Example format —''' delisted = January 2, 2000''. ''delisted_nrhp_type'' — Date that the site was delisted from a specific NPS title (NHL, NMEM, etc.). Requires an acceptable value in ''nrhp_type'' (which should be a former designation such as "formernhl", but doesn't have to be). ::'''Example formats —''' ::: If the site was designated a National Historic Landmark on January 1, 2000, and delisted on January 2, 2000: :::: ''nrhp_type = formernhl'', ''designated_nrhp_type = January 1, 2000'', and ''delisted_nrhp_type = January 2, 2000''. ''delisted_nrhp_type2'' — Date the NRHP was delisted from a second specific NPS title (NHL, NMEM, etc.). Requires an acceptable value in ''nrhp_type2'' and works like ''delisted_nrhp_type''.<br/> ''delisted_nrhp_type3'' — Date the NRHP was delisted from a third specific NPS title (NHL, NMEM, etc.). Requires an acceptable value in ''nrhp_type3'' and works like ''delisted_nrhp_type''.<br/> ''delisted_nrhp_type4'' — Date the NRHP was delisted from a fourth specific NPS title (NHL, NMEM, etc.). Requires an acceptable value in ''nrhp_type4'' and works like ''delisted_nrhp_type''. ''delisted_other1_date'' – Date that the site was delisted from the local register set in ''designated_other1_name''. :: '''''Example format –''' delisted_other1_date = June 15, 2007''. ''delisted_other2_date'' and ''delisted_other3_date'' correspond to delisting from local registers set in ''designated_other2_name'' and ''designated_other3_name'', respectively. === Image and map === ''image'' — Name of main image displayed. Only the title of the image. If left blank, no image is shown. :: '''''Example format —''' image = Manzanar Flag.jpg''. ''image_size'' — Size of main image in pixels ('''Do not include "px"'''). Default 240. :: '''''Example format —''' image_size = 400''. ''alt'' — Alt text for main image. This is for visually impaired readers, and typically has little in common with the image's caption; see [[WP:ALT]]. :: '''''Example format —''' alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds.'' ''caption'' — Caption for main image. :: '''''Example format —''' caption = A hot windstorm brings dust from the surrounding desert July 3, 1942''. ''locmapin'' — If you want a map to be displayed, set this parameter to the state in which the NRHP is located. Set to "USA" if you want a map of the entire USA displayed. If the parameter is left blank, no map will be displayed. In some larger cities and some counties, more local maps can be displayed. For a complete listing of maps available, see [[Template:Location map]]. :: '''''Example format —''' locmapin = USA California''. ''district_map'' – For districts, a map of the district can be displayed if one exists rather than a pinpoint map of the state. Set this value to the image containing the district map. Complete details about districts are explained [[#Districts|below]]. This parameter can also be used with {{tl|Maplink}} to add interactive maps to the infobox; see second example below. :: '''''Example format –''' district_map = McClellan Heights district (Davenport).svg''. :: '''''Example format –''' district_map = <nowiki>{{Maplink|frame=yes|plain=yes|frame-align=center|frame-width=270|frame-height=180|zoom=13|type=point|title=The Octagon|description=|marker=}}.</nowiki>'' ''map_width'' — Width of the map in pixels ('''Do not include "px"'''). Default 235. This parameter is compatible with both a pinpoint map and a district map. :: '''''Example format —''' map_width = 275''. ''map_alt'' — Alt text for map. This parameter is compatible with both a pinpoint map and a district map. :: '''''Example format —''' map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada''. ''map_caption'' — Caption displayed under the map. This parameter is compatible with both a pinpoint map and a district map. :: '''''Example format —''' map_caption = Location of Thomas Center in Florida''. ''map_label'' – If you want text displayed by the marker on the location map, set that text here. :: '''''Example format –''' map_label = Location of Manzanar''. ''label_size'' – Font size of the label text as a percentage relative to regular. :: '''''Example format –''' label_size = 90'' would result in font-size:90% ''label_position'' – Position of the label text. Valid values are ''left'', ''right'', ''top'', or ''bottom''. :: '''''Example format –''' label_position = right''. ''label_background'' – Background color of the label text. :: '''''Example format –''' label_background = transparent''. ''locmap_relief'' – Set to any nonblank value to use an optional relief map, if one is provided by the selected location map template. :: '''''Example format –''' locmap_relief = y''. ====Mapframe maps==== {{Infobox mapframe/doc/parameters}} === Coordinates === Coordinates should use the {{tl|Coord}} template; see that template's documentation for more information on how to use it. :: ''coordinates'' — Coordinates in any display format desired, using the {{tl|Coord}} template ::: '''''Example format —''' coordinates = <nowiki>{{Coord|40|46|05|N|73|58|57|W|region:US-NY_type:railwaystation|display=inline,title}}</nowiki>''. ::: '''''Example format —''' coordinates = <nowiki>{{Coord|36.6453|-118.1567|region:US-CA|display=inline}}</nowiki>''. ::* Unless other values are set for <code>type:</code> and <code>region:</code>, the template automatically adds <code>type:landmark</code> and <code>region:US-<var>XY</var></code>, where <code><var>XY</var></code> is the two-letter state/territory (if any) found from {{para|locmapin}}. ::* If ''locmapin='' is set to a value other than the name of a U.S. state, indicate the correct <code>[[Wikipedia:WikiProject Geographical coordinates/region:|region:]]</code> in the last unnamed parameter of {{tl|Coord}}. (Otherwise the invalid ''US-X'' is generated.) ::* If the NRHP is a school, former school, rail station, or former rail station, indicate the correct <code>[[Wikipedia:WikiProject Geographical coordinates/type:|type:]]</code> (''edu'' or ''railwaystation'') in the last unnamed parameter. === Site info === ''location'' — Generally the street address and city where the listed property is located. Sometimes a street address is not available or is not adequate to describe the location; in such cases other location descriptions may be used, such as an intersection, boundary description, situation relative to major landforms, etc. If no location information is publicly available because of confidentiality (i.e. "address restricted"), say so in this field. :: '''''Example format —''' location = <nowiki>123 Main Street<br />[[Independence, California]]</nowiki>''. :: '''''Example format —''' location = <nowiki>[[Roseburg, Oregon]], along SE Mill and Pine Streets between Rice and Mosher Avenues</nowiki>''. :: '''''Example format —''' location = <nowiki>{{Address restricted}}</nowiki>''. ''nearest_city'' — If NRHP is located in a mostly rural area, this parameter may be used instead of or in addition to ''location''. :: '''''Example format —''' nearest_city = <nowiki>[[Independence, California]]</nowiki>''. ''area'' — Area of the NRHP. Mostly used with districts, parks, and sites. <nowiki>{{convert}}</nowiki> tags should be used to display standard alongside metric measurements. :: '''''Example format —''' area = <nowiki>{{convert|814|acre|ha}}</nowiki>''. ''built'' — If the NRHP is a building or manmade structure, when it was built. :: '''''Example format —''' built = {{Start date|1942}}''. ''builder'' – Person who built the NRHP (building or manmade structure). ::'''''Example format –''' builder = John Smith''. ''architect'' — Architect of the NRHP (building or manmade structure). ::'''''Example format —''' architect = <nowiki>[[William Augustus Edwards]] of Edwards & Saywards</nowiki>''. ''engineer'' — Engineer of the NRHP (building or manmade structure). ::'''''Example format —''' engineer = <nowiki>[[Gunvald Aus]]</nowiki>'', as used [[Austin, Nichols and Company Warehouse|here]] ''customarchitect_title'' — Custom title for someone involved in the construction of the site, such as "artist" or "sculptor". ::'''''Example format —''' customarchitect_title = Sculptor''. ''customarchitect'' — Name of the person in ''customarchitect_title'' ::'''''Example format —''' customarchitect = <nowiki>[[Olin Levi Warner]]</nowiki>''. ''architecture'' — Architectural style. ::'''''Example format —''' architecture = <nowiki>[[Classical Revival]]</nowiki>''. ''demolished'' – For structures that have been demolished, the date of demolition. :: '''''Example format –''' demolished = January 4, 2008''. ''restored'' – Date range through which the building underwent a restoration process. :: '''''Example format –''' restored = May 2005 – September 2010''. ''restored_by'' – Person, group, or organization that performed or oversaw the restoration. :: '''''Example format –''' restored_by = Historic Properties, Incorporated''. ''visitation_num'' — Number of visitors to the site. :: '''''Example format —''' visitation_num = 81,344''. ''visitation_year'' — Year in which ''visitation_num'' occurred. :: '''''Example format —''' visitation_year = 2007''. ''visitation_ref'' — Source used for ''visitation_num''. :: '''''Example format —''' visitation_ref = <nowiki><ref>{{NPS visitation}}</ref></nowiki>''. ''refnum'' — NRHP Reference Number. :: '''''Example format —''' refnum = 76000484''. ''website'' — The official website, if there is one. :: '''''Example format —''' website = {{Tlf|URL|www.example.com}}'' ''mpsub'' — If the NRHP was submitted under a Multiple Property Submission, type its name here. :: '''''Example format —''' mpsub = California MRA''. == Embedding == Many articles about National Register of Historic Places listings may overlap with other categories ([[Point Reyes Lighthouse]] is also a lighthouse and contains a [[Template:Infobox lighthouse|lighthouse infobox]]). Sometimes it may be necessary or desirable to combine the NRHP infobox with the other infobox(es) in an article to conserve space or to reduce redundancy. This infobox accepts a special parameter that does just this. By adding "''embed = yes''" to the first line of the infobox code, one can embed this infobox into another, creating the illusion of one continuous infobox. Though the process is a little complicated, it is possible to insert this infobox into most if not all other infoboxes. In order to embed this infobox, first look at the pre-existing infobox; it should provide a {{para|module}}, {{para|embedded}}, or {{para|extra}} parameter, inside of which the NRHP should be placed. If the pre-existing infobox does not have the capacity for embedding, do ''not'' insert the NRHP infobox in any other field, but request that a parameter for embedding be added on the talk page of the other infobox. {{Infobox lighthouse | qid=Q779685 | module = {{Infobox NRHP | embed = yes | name = Historic Lighthouse | image = | alt = | caption = | coordinates = {{coord|37|59|51|N|123|0|59|W}} | locmapin = USA California | map_alt = Located on the California coast, just north of San Francisco Bay | area = | architect = Marston, Phineas F. | added = September 3, 1991 | mpsub = Light Stations of California MPS | refnum = 91001100 }} }} <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll"> {{Infobox lighthouse | qid=Q779685 | module = {{Infobox NRHP | embed = yes | name = Historic Lighthouse | image = | alt = | caption = | coordinates = {{coord|37|59|51|N|123|0|59|W}} | locmapin = USA California | map_alt = Located on the California coast, just north of San Francisco Bay | area = | architect = Marston, Phineas F. | added = September 3, 1991 | mpsub = Light Stations of California MPS | refnum = 91001100 }} }} </syntaxhighlight> <br style="clear:both"/> == Districts == {{Infobox NRHP | name = Beaver Historic District | nrhp_type = hd | nocat = yes | image = First Christian Church, Beaver.jpg | caption = First Christian Church, a part of the district | location= Roughly bounded by the [[Cumberland and Pennsylvania Railroad]] tracks, Fair Ave., 5th St., 3rd St., and Sassafras Ln. | district_map = Beaver Historic District map.png | map_caption = Map of the Beaver Historic District | coordinates = {{coord|40|41|41|N|80|18|27|W}} | locmapin = Pennsylvania | area = {{convert|317|acre}} | built = {{Start date|1792}} | architect = multiple | architecture = Italianate, Queen Anne, American Foursquare | added = October 24, 1996 | increase = September 3, 1999 | refnum = 96001201 | increase_refnum = 79003319 }} Many listings on the National Register are of [[Historic districts in the United States|historic districts]] rather than buildings or structures. Historic districts are collections of buildings or areas that have a certain theme or event in common with each other. Most districts consist of many buildings that, when looked at together, illustrate a significant historical event. Many times, a district will be re-evaluated after it is originally listed, and the boundaries of the district may be increased or decreased to include more buildings or to remove some old ones. If a district's boundaries are altered, a new listing on the NRHP is required as well as a new reference number. There are several parameters that deal with boundary increases and decreases: ''increase'' and ''decrease'' – Date on which the boundary was increased or decreased. :: '''''Example format –''' increase = September 3, 1979''. :: '''''Example format –''' decrease = November 21, 1985''. ''increase_refnum'' and ''decrease_refnum'' – New reference number of the boundary increase or decrease. :: '''''Example format –''' increase_refnum = 79003319''. :: '''''Example format –''' decrease_refnum = 85004727''. If a district has been increased or decreased more than once in its history, there are also ''increase2'', ''increase2_refnum'', ''decrease2'', ''decrease2_refnum'', and the respective parameters for third increase or decrease and fourth increase or decrease that are used the same way. There is also a special functionality of the infobox to replace the normal pinpoint locator map with an image file containing a map of the district (Example [[:File:Beaver Historic District map.png|here]]). This is useful because a district may cover a very large area while the pinpoint can only show a single point. If a district map is used, it is desirable to still include the ''locmapin'' parameter (though the location map will be suppressed) as this will help with autocategorization, explained below. The parameters for the district map are: ''district_map'' – File name of the image of the map of the district. "Image:" or "File:" should not be included. :: '''''Example format –''' district_map = Beaver Historic District map.png''. ''map_caption'', ''map_width'', and ''map_alt'' are all compatible with this map as well as the pinpont map. For an explanation of these parameters, see [[#Image/Map|above]]. {{Anchor|Auto-categorization of Historic district articles}} Historic district articles are autocategorized into a state-level category, Category:Historic districts in STATE, which are all listed in [[:Category:Historic districts in the United States by state]]. This categorization uses the ''locmapin'' parameter; if ''locmapin'' is left blank or not included, the article will be placed into [[:Category:Historic districts in the United States]]. Since this is a top-level category, it is desirable to move articles down to lower, more localized categories. Most times this can be fixed by simply adding a state name to the ''locmapin'' parameter, but this will cause the locator map to be displayed. If, for whatever reason, the location map should not be displayed, there is a workaround: ''nocat'' – Setting any value to this parameter will cancel all autocategorization and allow you to manually categorize the article. :: '''''Example format –''' nocat = yes''. This will suppress autocategorization and still allow no locator map to be displayed. This is also a useful fix for when the locator map displayed doesn't have a category yet. For example, [[Module:Location map/data/Boston]] exists, but [[:Category:Historic districts in Boston]] does not. For this case, ''nocat'' can be set, and [[:Category:Historic districts in Massachusetts]] can be added manually to the article. Pages using the ''nocat'' parameter are tracked in [[:Category:NRHP infobox with nocat]] (population: {{PAGESINCATEGORY:NRHP infobox with nocat}}). === Contributing properties === Though most of the buildings in a historic district are an integral part of its history, some have nothing to do with the history of the district and are called non-contributing elements. Conversely, any property that contributes to the history of the district is called a ''[[contributing property]]''. A list of all contributing and non-contributing properties can normally be found in the official NRHP nomination form for the district. If an article exists about one of these contributing properties, this infobox can be used on that article. There are several parameters included in the infobox specifically for contributing properties: ''partof'' — District to which the property contributes. This district is automatically linked using the {{tl|Auto link}} template. If disambiguation is needed, a link can be input. :: '''''Example format —''' partof = DeFuniak Springs Historic District''. :: '''''Example format —''' partof = <nowiki>[[East End Historic District (Meridian, Mississippi)|East End Historic District]]</nowiki>''. ''partof_refnum'' — The reference number of the district in ''partof''. '''NOTE: The district's reference number should <u>NOT</u> be put in the ''refnum'' parameter. That parameter is <u>only</u> for properties that are ''individually'' listed (i.e. not contributing properties).''' :: '''''Example format —''' partof_refnum = 92001048''. The date the district was listed can also be included. ''designated_nrhp_type'' should contain the date the district was listed, and it will display as "'''Designated CP:''' ''date''" in the infobox. If the property is part of two districts, use ''partof2'' and ''partof2_refnum'' for the second district. ==== Contributing property only ==== {{Infobox NRHP | name = St. Agatha's Episcopal Church | nrhp_type = cp | nocat = yes | partof = DeFuniak Springs Historic District | partof_refnum = 92001048 | image = DeFuniak Springs Hist Dist CD0144a St Agathas.jpg | alt = Small white clapboard church. The entrance is on the left, under another story just above the entrance, which gives the church a lopsided appearance. | caption = St. Agatha's Episcopal Church, 2008 | location = 144 Circle Drive<br />[[DeFuniak Springs, Florida|Defuniak Springs]], [[Florida]] | coordinates = {{coord|30|42|59|N|86|6|57|W}} | locmapin = USA Florida | area = | built = {{Start date|1896}} | architect = | architecture = [[Carpenter Gothic]] | designated_nrhp_type = August 28, 1992 | visitation_num = | visitation_year = | mpsub = }} Most contributing properties, though historic, do not possess enough status individually (without considering the other properties in the district) to be listed on the National Register. For these properties "''nrhp_type = cp''" can be used (or if the district to which the property contributes is a National Historic Landmark District, "''nrhp_type = nhldcp''"). The infobox for a contributing property does not display the blue NRHP bar at the top of the infobox because the property is not actually on the National Register of Historic Places; it is only a contributing property to a district. See the next section for properties that are contributing to a district but are also individually listed. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll"> {{Infobox NRHP | name = St. Agatha's Episcopal Church | nrhp_type = cp | partof = DeFuniak Springs Historic District | partof_refnum = 92001048 | image = DeFuniak Springs Hist Dist CD0144a St Agathas.jpg | alt = Small white clapboard church. The entrance is on the left, under another story just above the entrance, which gives the church a lopsided appearance. | caption = St. Agatha's Episcopal Church, 2008 | location = 144 Circle Drive<br />[[DeFuniak Springs, Florida|Defuniak Springs]], [[Florida]] | coordinates = {{coord|30|42|59|N|86|6|57|W}} | locmapin = USA Florida | area = | built = {{Start date|1896}} | architect = | architecture = [[Carpenter Gothic]] | designated_nrhp_type = August 28, 1992 | visitation_num = | visitation_year = | mpsub = }} </syntaxhighlight> {{clear}} ==== Individually listed contributing property ==== {{Infobox NRHP | name = Melrose | nrhp_type = nhl | nrhp_type2 = cp | nocat = yes | partof = Natchez National Historical Park | partof_refnum = 01000276 | image = Melrose, Main House, 1 Melrose-Montebello Parkway (Natchez, Adams County, Mississippi).jpg | alt = Two-story building fronted with a portico with four Greek columns | caption = Melrose in 1975 | location = Melrose Avenue, [[Natchez, Mississippi]] | area = {{convert|80|acre}} | built = {{Start date|1845}} | architect = | architecture = [[Greek Revival architecture|Greek Revival]] | designated_nrhp_type = May 30, 1974 | designated_nrhp_type2 = October 7, 1988 | added = May 30, 1974 | refnum = 74002253 }} Some contributing properties possess enough status to be listed individually (with their own reference number) ''and'' as part of a district. For these properties, the blue NRHP bar '''is''' shown because the site is listed and has its own reference number. While it is not mandatory, there is a special nrhp_type for these properties, "''nrhp_type = indcp''"; ''nrhp_type = cp'' or ''nrhp_type = nhldcp'' can also be used, but unless a reference number for the individual property is supplied, the blue NRHP bar will not be displayed. For individually listed contributing properties, ''partof_refnum'' should contain the reference number of the district, and ''refnum'' should contain the reference number of the property itself. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll"> {{Infobox NRHP | name = Melrose | nrhp_type = nhl | nrhp_type2 = cp | partof = Natchez National Historical Park | partof_refnum = 01000276 | image = Melrose, Main House, 1 Melrose-Montebello Parkway (Natchez, Adams County, Mississippi).jpg | alt = Two-story building fronted with a portico with four Greek columns | caption = Melrose in 1975 | location = Melrose Avenue, [[Natchez, Mississippi]] | area = {{convert|80|acre}} | built = {{Start date|1845}} | architect = | architecture = [[Greek Revival architecture|Greek Revival]] | designated_nrhp_type = May 30, 1974 | designated_nrhp_type2 = October 7, 1988 | added = May 30, 1974 | refnum = 74002253 }} </syntaxhighlight> {{clear}} == Examples == {{hatnote|See [[Template:Infobox NRHP/testcases|testcases page]] for more examples.}} === Standard NRHP === {{Infobox NRHP | name = Oakwood Cemetery | nrhp_type = | image = Oakwood Chapel Pano.jpg | caption = Section G-4 of Oakwood Cemetery, overlooking Sections G-3 and H-1 | location = 50 101st Street<br />[[Troy, New York]], United States | alt = A panoramic view of the cemetery; a dirt road pass in front of the view from right to left. At center is a grey church-like structure, surrounded on all sides by various sized grave stones. | coordinates = {{coord|42|45|20.11|N|73|40|16.92|W}} | locmapin = USA New York | map_alt = A map of New York with a red dot near the eastern central portion of the state. | area = '''Total''': {{convert|352|acre|ha}}<br /> '''NRHP Property''': {{convert|325|acre|ha}} | built = {{Start date|1848}} | architect = John C. Sidney<br />John Boetcher | architecture = [[Greek Revival]], [[Roman Revival]], [[Gothic Revival]], [[Romanesque architecture|Romanesque]], [[Egyptian Revival]], [[Palladian]], and other eclectic styles | added = October 4, 1984 | refnum = 84000021 }} The infobox to the right is an example of Infobox NRHP in action at the [[Oakwood Cemetery (Troy, New York)|Oakwood Cemetery]] article. Oakwood cemetery was listed on the NRHP in 1984 and has had no further designations (e.g. NHL, NMON, etc.) <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Oakwood Cemetery | nrhp_type = | image = Oakwood Chapel Pano.jpg | caption = Section G-4 of Oakwood Cemetery, overlooking Sections G-3 and H-1 | location = 50 101st Street<br />[[Troy, New York]], United States | alt = A panoramic view of the cemetery; a dirt road pass in front of the view from right to left. At center is a grey church-like structure, surrounded on all sides by various sized grave stones. | coordinates = {{coord|42|45|20.11|N|73|40|16.92|W}} | locmapin = USA New York | map_alt = A map of New York with a red dot near the eastern central portion of the state. | area = '''Total''': {{convert|352|acre|ha}}<br /> '''NRHP Property''': {{convert|325|acre|ha}} | built = {{Start date|1848}} | architect = John C. Sidney<br />John Boetcher | architecture = [[Greek Revival]], [[Roman Revival]], [[Gothic Revival]], [[Romanesque architecture|Romanesque]], [[Egyptian Revival]], [[Palladian]], and other eclectic styles | added = October 4, 1984 | refnum = 84000021 }} </syntaxhighlight> {{clear}} === More than one NRHP type === {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} Notice that ''nrhp_type'' and ''nrhp_type2'' contain the NPS designation, and ''designated_nrhp_type'' and ''designated_nrhp_type2'' contain the designation dates for the corresponding nrhp_types. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} </syntaxhighlight> {{clear}} === Delisted NRHP === {{Infobox NRHP | name = Lenoir Cotton Mill | image = Lenoir-cotton-mill-front-habs4.jpg | caption = Lenoir Cotton Mill in 1983 | location = Depot Street in [[Lenoir City, Tennessee]] | coordinates = {{coord|35|47|27|N|84|15|47|W}} | locmapin = USA Tennessee | built = circa 1830 | added = 1973 | delisted = July 30, 2002 | refnum = 75001767 }} The [[Lenoir Cotton Mill]] was originally listed on the NRHP in 1973 but was destroyed by fire in 1991. Subsequently, in 2002, the building's NRHP designation was withdrawn. To reflect this in the infobox, the ''delisted'' parameter contains the date on which the site was delisted, and it causes the NRHP bar at the top of the infobox to turn grey and adds "Formerly listed." <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Lenoir Cotton Mill | image = Lenoir-cotton-mill-front-habs4.jpg | caption = Lenoir Cotton Mill in 1983 | location = Depot Street in [[Lenoir City, Tennessee]] | coordinates = {{coord|35|47|27|N|84|15|47|W}} | locmapin = USA Tennessee | built = circa 1830 | added = 1973 | delisted = July 30, 2002 | refnum = 75001767 }} </syntaxhighlight> {{clear}} === Delisted from NPS designation but not NRHP === {{Infobox NRHP | name = Lincoln Motor Company Plant | nrhp_type = formernhl | image = LincolnPlant1923.jpg | caption = Lincoln plant in 1923, showing newer Ford-built addition in rear | location = 6200 W. Warren Ave., [[Detroit, Michigan|Detroit]], [[Michigan]] | coordinates = {{coord|42|20|44|N|83|7|46|W}} | locmapin = USA Michigan | built = {{Start date|1917}} | architect = Walbridge-Aldinger Co.; [[George Mason]], [[Albert Kahn (architect)|Albert Kahn]] | architecture = | added = June 2, 1978 | designated_nrhp_type = June 2, 1978 | delisted_nrhp_type = April 4, 2005 | area = {{convert|62|acre}} | refnum = 78001521 }} A property can sometimes be delisted from a certain NPS title (National Monument, National Historic Landmark, etc.), but still remain on the NRHP. For example, the [[Lincoln Motor Company Plant]] was first designated a National Historic Landmark in 1978. After part of the campus was demolished, however, the NHL status was removed, although the NRHP status was kept. To reflect this in the infobox, ''nrhp_type = '''former'''nhl''. ''delisted_nrhp_type'' contains the date on which the site was '''delisted''' as an NHL, and ''designated_nrhp_type'' contains the date on which the site was '''originally listed or designated''' as an NHL. The site, however, still remains on the NRHP, so the infobox still shows the blue NRHP bar at the top. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Lincoln Motor Company Plant | nrhp_type = formernhl | image = LincolnPlant1923.jpg | caption = Lincoln plant in 1923, showing newer Ford-built addition in rear | location = 6200 W. Warren Ave., [[Detroit, Michigan|Detroit]], [[Michigan]] | coordinates = {{coord|42|20|44|N|83|7|46|W}} | locmapin = USA Michigan | built = {{Start date|1917}} | architect = Walbridge-Aldinger Co.; [[George Mason]], [[Albert Kahn (architect)|Albert Kahn]] | architecture = | added = June 2, 1978 | designated_nrhp_type = June 2, 1978 | delisted_nrhp_type = April 4, 2005 | area = {{convert|62|acre}} | refnum = 78001521 }} </syntaxhighlight> {{clear}} === One or more local designations === {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | designated_other1 = California Historical Landmark | designated_other1_date = 1972 | designated_other1_number = 850 | designated_other1_num_position = top | designated_other2 = LAHCM | designated_other2_date = September 15, 1976 | designated_other2_number = 160 | designated_other2_num_position = bottom | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} Notice that with ''designated_other1_num_position = top'', the CHISL# is only displayed in the title bar, not the information section. ''designated_other2_num_position'' is set to "bottom", so it does the opposite. If there were a third local designation, and its num_position parameter was left blank, it would display in the default manner – both top and bottom. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | designated_other1 = California Historical Landmark | designated_other1_date = 1972 | designated_other1_number = 850 | designated_other1_num_position = top | designated_other2 = LAHCM | designated_other2_date = September 15, 1976 | designated_other2_number = 160 | designated_other2_num_position = bottom | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} </syntaxhighlight> {{clear}} === Only image – no map === {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} Notice the Coordinates are still displayed even though the map is not. <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | image = Manzanar Flag.jpg | alt = Small buildings in rows in a dusty flat area. A tattered U.S. flag flies from a pole in the foreground, and tall mountains dominate the background below a sky with clouds. | caption = A hot windstorm brings dust from the surrounding desert July 3, 1942 | nearest_city = [[Independence, California|Independence]], [[California]] | coordinates = {{coord|36|43|42|N|118|9|16|W}} | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} </syntaxhighlight> {{clear}} === Only map – no image === {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | nearest_city = [[Independence, California|Independence]], [[California]] | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | coordinates = {{coord|36|43|42|N|118|9|16|W}} | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} <syntaxhighlight lang="wikitext" style="width:50%; overflow:scroll;"> {{Infobox NRHP | name = Manzanar War Relocation Center | nrhp_type = nhl | nrhp_type2 = nhs | nearest_city = [[Independence, California|Independence]], [[California]] | locmapin = USA California | map_alt = Located in California, close to the midpoint of the diagonal border between California and Nevada | coordinates = {{coord|36|43|42|N|118|9|16|W}} | area = {{convert|814|acre|ha}} | built = {{Start date|1942}} | added = July 30, 1976 | designated_nrhp_type = February 4, 1985 | designated_nrhp_type2 = March 3, 1992 | visitation_num = 81,344 | visitation_year = 2007 | refnum = 76000484 }} </syntaxhighlight> {{clear}} ==ၶေႃႈမုၼ်းထႅမ်းပလဵတ်ႉ== {{Collapse top|title=[[Wikipedia:TemplateData|TemplateData]] documentation used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools}} {{TemplateData header|noheader=1}} <templatedata> { "description": "Infobox about sites listed on the United States National Register of Historic Places.", "params": { "name": { "required": false, "label": "Name", "type": "string", "description": "Name of historic place." }, "nrhp_type": { "required": false, "label": "NRHP Type", "type": "string", "description": "Type of the Historic Place" }, "image": { "required": false, "label": "Image", "type": "wiki-file-name", "description": "Image of the place" }, "alt": { "required": false, "label": "Image alternative text", "type": "string", "description": "Alt text to display if the image does not display for whatever reason" }, "caption": { "required": false, "label": "Image caption", "type": "string", "description": "Caption for the image." }, "location": { "required": false, "label": "Location", "type": "line", "description": "Location of the place" }, "coordinates": { "required": false, "label": "Coordinates", "type": "string", "description": "Geographical coordinates, in {{Coord}} format" }, "locmapin": { "required": false, "label": "Location of map", "type": "string", "description": "City in which the historic place is" }, "map_alt": { "required": false, "label": "Map Alternative Text", "type": "string", "description": "Alternative text if the map is not displayed for whatever reason" }, "area": { "required": false, "label": "area", "type": "string", "description": "Area of the listing, in acres or square miles depending on size, using {{convert}} to produce metric equivalents in hectares (must add '|ha' after number) or square kilometers" }, "built": { "required": false, "label": "Built", "type": "number", "description": "Year in which the place is built" }, "architect": { "required": false, "label": "Architect", "type": "string", "description": "Name of the architect of the place" }, "architecture": { "required": false, "label": "Architecture Style", "type": "string", "description": "Style of architecture on which the place is built" }, "added": { "required": false, "label": "Date Added", "type": "line", "description": "Date on which the place was registered in NRHP" }, "refnum": { "required": false, "label": "Reference Number", "type": "number", "description": "Reference number in NRHP" }, "increase_refnum": { "required": false, "label": "Increase Reference Number", "type": "number", "description": "Increase reference number in NRHP" }, "increase1_refnum": { "required": false, "label": "Increase Reference Number 1", "type": "number", "description": "Increase Reference number 1 in NRHP" }, "increase2_refnum": { "required": false, "label": "Increase Reference Number 2", "type": "number", "description": "Increase Reference number 2 in NRHP" }, "increase3_refnum": { "required": false, "label": "Increase Reference Number 3", "type": "number", "description": "Increase Reference number 3 in NRHP" }, "increase4_refnum": { "required": false, "label": "Increase Reference Number 4", "type": "number", "description": "Increase Reference number 4 in NRHP" }, "decrease_refnum": { "required": false, "label": "Decrease Reference Number", "type": "number", "description": "Decrease Reference number in NRHP" }, "decrease1_refnum": { "required": false, "label": "Decrease Reference Number 1", "type": "number", "description": "Decrease Reference number 1 in NRHP" }, "decrease2_refnum": { "required": false, "label": "Decrease Reference Number 2", "type": "number", "description": "Decrease Reference number 2 in NRHP" }, "decrease3_refnum": { "required": false, "label": "Decrease Reference Number 3", "type": "number", "description": "Decrease Reference number 3 in NRHP" }, "decrease4_refnum": { "required": false, "label": "Decrease Reference Number 4", "type": "number", "description": "Decrease Reference number 4 in NRHP" }, "delisted": { "required": false, "label": "Delisted", "type": "line", "description": "Date on which the place was delisted from NRHP" }, "increase": { "required": false, "label": "Date of Increase", "type": "line", "description": "Date of Increase in NRHP" }, "increase1": { "required": false, "label": "Date of Increase 1", "type": "line", "description": "Date of Increase 1 in NRHP" }, "increase2": { "required": false, "label": "Date of Increase 2", "type": "line", "description": "Date of Increase 2 in NRHP" }, "increase3": { "required": false, "label": "Date of Increase 3", "type": "line", "description": "Date of Increase 3 in NRHP" }, "increase4": { "required": false, "label": "Date of Increase 4", "type": "line", "description": "Date of Increase 4 in NRHP" }, "decrease": { "required": false, "label": "Date of Decrease", "type": "line", "description": "Date of Decrease in NRHP" }, "decrease1": { "required": false, "label": "Date of Decrease 1", "type": "line", "description": "Date of Decrease 1 in NRHP" }, "decrease2": { "required": false, "label": "Date of Decrease 2", "type": "line", "description": "Date of Decrease 2 in NRHP" }, "decrease3": { "required": false, "label": "Date of Decrease 3", "type": "line", "description": "Date of Decrease 3 in NRHP" }, "decrease4": { "required": false, "label": "Date of Decrease 4", "type": "line", "description": "Date of Decrease 4 in NRHP" }, "nocat": {}, "designated_other1_name": {}, "designated_other1": {}, "designated_other1_color": {}, "designated_other1_textcolor": {}, "designated_other1_link": {}, "designated_other1_num_position": {}, "designated_other1_number": {}, "designated_other2_name": {}, "designated_other2": {}, "designated_other2_color": {}, "designated_other2_textcolor": {}, "designated_other2_link": {}, "designated_other2_num_position": {}, "designated_other2_number": {}, "image_size": {}, "district_map": {}, "map_width": {}, "map_caption": {}, "locmap_relief": {}, "map_label": {}, "locmap_label": {}, "label_size": {}, "label_position": {}, "locmap_label_position": {}, "label_background": {}, "nearest_city": {}, "builder": {}, "engineer": {}, "customarchitect_title": {}, "customarchitect": {}, "demolished": {}, "restored": {}, "restored_by": {}, "visitation_num": {}, "visitation_year": {}, "visitation_ref": {}, "partof": {}, "partof_refnum": {}, "partof2": {}, "partof2_refnum": {}, "mpsub": {}, "designated_other1_abbr": {}, "designated_other2_abbr": {}, "website": {}, "designated_other1_date": {}, "designated_other2_date": {}, "designated_nrhp_type": {}, "designated_nrhp_type2": {}, "delisted_nrhp_type": {}, "delisted_nrhp_type2": {}, "delisted_other1_date": {}, "delisted_other2_date": {}, "sigdate1_label": {}, "sigdate_label": {}, "sigdate1": {}, "sigdate": {}, "sigdate2_label": {}, "sigdate2": {} }, "format": "block" } </templatedata> {{Collapse bottom}} == မၢႆႇၶရူဝ်ႇၾွမ်းမႅတ်ႉ == {{UF-hcard-geo}} ==ပၼ်ႁႃလႄႈ လွင်ႈၽိတ်းပိူင်ႈ== *It is a feature/bug that, for many usages (probably for any infobox of type "hd" or "cp"), the code adds a historic district category which often does not exist or is not specific enough. The feature/bug (often erroneously) assumes that the argument of "|locmapin=" field corresponds to a suitable category to be added to the article. For an example discussed in [[Wikipedia:Village_pump_(technical)/Archive_144#Template_bug?]], it added "Category:Historic district contributing properties in USA Portland", where the article's infobox was set to show the location of the place within a background map of the [[Portland, Oregon]] area. ([[:Category:Historic district contributing properties in USA Portland]] does not and should not exist.) The feature/bug worked mostly okay when background map images were available for each U.S. state but not for smaller areas, and before "Category:Historic districts in STATE" and "Category:Historic district contributing properties in STATE" had been subdivided. :*A workaround is to put "|nocat=yes" into the infobox to turn off automatic categorizing, and "Category:Historic districts in STATE" or category for a narrower area should be manually added. :*FIX NEEDED: The code should be fixed to not put this in at all. For historic districts listed before some date in 2013, the "nrhp infobox generator" is still (in 2022) often used to generate draft infoboxes filled out with relevant info, and that generator should be modified to put in "Category:Historic districts in STATE", which will be a valid category and can be modified to be a more specific, narrower one. :--[[User:Doncram|Doncram]] ([[User talk:Doncram|talk]]) 00:18, 22 October 2022 (UTC) == ၵၢၼ်ၸွမ်းႁွႆး ပိူင်ထၢၼ်ႈ == * {{clc|NRHP infobox needing cleanup}} * {{clc|Pages using infobox NRHP with unknown parameters}} * {{clc|Articles using Template:Designation with invalid designation}}: Invalid {{para|nrhp_type}} parameter values will place articles in this category. The categorization is done by {{tl|Infobox NRHP/conv}}. == တူၺ်းပႃး == * {{tl|National Register of Historic Places}} <includeonly>{{Sandbox other|| <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:National Register of Historic Places templates| ]] [[Category:United States government infobox templates|NRHP]] [[Category:Embeddable templates]] [[Category:Templates that add a tracking category]] }}</includeonly> 2b7zhutjlg1ryja707s34lj3fs8r8u6 ထႅမ်းပလဵတ်ႉ:Infobox NRHP/conv 10 34202 112343 2025-06-26T07:35:32Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{#ifeq:{{{1}}}|color |{{Designation/color|{{{2|}}}}} }}{{#ifeq:{{{1}}}|text |{{#ifeq:{{Designation/text|{{{2}}}}}|Invalid designation|<span style="color:red">Error: Invalid designation</span>{{main other|[[Category:Articles using Template:Designation with invalid designation]]}}|{{Designation/text|{{{2}}}}} }}{{#ifeq:{{{3|}}}|nocat| |{{#switch:{{{2}}} |indcp = {{main other|Category:Individually listed..." 112343 wikitext text/x-wiki {{#ifeq:{{{1}}}|color |{{Designation/color|{{{2|}}}}} }}{{#ifeq:{{{1}}}|text |{{#ifeq:{{Designation/text|{{{2}}}}}|Invalid designation|<span style="color:red">Error: Invalid designation</span>{{main other|[[Category:Articles using Template:Designation with invalid designation]]}}|{{Designation/text|{{{2}}}}} }}{{#ifeq:{{{3|}}}|nocat| |{{#switch:{{{2}}} |indcp = {{main other|[[Category:Individually listed contributing properties to historic districts on the National Register]]}} |cp |nhldcp = {{main other|[[Category:Historic district contributing properties {{#ifeq:{{{3}}}|the United States||in {{{3}}}}}]]}} |#default = }} }} }}{{#ifeq:{{{1}}}|link |{{#switch:{{{2}}} |nrhp = National Register of Historic Places |formernhl |nhl = National Historic Landmark |formernhld |nhld = National Historic Landmark District |formerhd |hd = Historic district (United States) |cp |indcp |nhldcp = Contributing property |formernmon |nmon = U.S. National Monument |formernhs |nhs = National Historic Site (United States) |formernmem |nmem = National Memorial |formernhp |nhp = National Historical Park |formernb |nb = National Battlefield |formernmp |nmp = National Military Park |formernbp |nbp = National Battlefield Park |formernbs |nbs = National Battlefield Site |formernhr |nhr = List of areas in the United States National Park System#National Reserves |formerihs |ihs = List of areas in the United States National Park System#International Historic Site |#default = {{{2}}} }} }}{{#ifeq:{{{1}}}|abbr |{{#switch:{{{2}}} |formernhl = NHL |formernhld = NHLD |formerhd = HD |formernmon = NMON |formernhs = NHS |formernmem = NMEM |formernhp = NHP |formernb = NB |formernmp = NMP |formernbp = NBP |formernbs = NBS |formernhr = NHR |formerihs = IHS |indcp = CP |#default = {{uc:{{{2}}}}} }} }}<noinclude> {{doc|content= {{NODOC}} }} </noinclude> khuxkjqvos6dabs1sm0adhbox9o8qj4 ထႅမ်းပလဵတ်ႉ:Designation/abbreviation 10 34203 112344 2025-06-26T07:36:33Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{#switch:{{uc:{{{1}}}}} <!------------Global designations---------------------> |WORLD HERITAGE SITE|WHS = WHS |IUCN CATEGORY IA|IUCN IA|CATEGORY IA|NATURE RESERVE = IUCN Ia |IUCN CATEGORY IB|IUCN IB|CATEGORY IB|WILDERNESS AREA = IUCN Ib |IUCN CATEGORY II|IUCN II|CATEGORY II|NATIONAL PARK = IUCN II |IUCN CATEGORY III..." 112344 wikitext text/x-wiki {{#switch:{{uc:{{{1}}}}} <!------------Global designations---------------------> |WORLD HERITAGE SITE|WHS = WHS |IUCN CATEGORY IA|IUCN IA|CATEGORY IA|NATURE RESERVE = IUCN Ia |IUCN CATEGORY IB|IUCN IB|CATEGORY IB|WILDERNESS AREA = IUCN Ib |IUCN CATEGORY II|IUCN II|CATEGORY II|NATIONAL PARK = IUCN II |IUCN CATEGORY III|IUCN III|CATEGORY III|NATURAL MONUMENT = IUCN III |IUCN CATEGORY IV|IUCN IV|CATEGORY IV|HABITAT MANAGEMENT |SPECIES MANAGEMENT = IUCN IV |IUCN CATEGORY V|IUCN V|CATEGORY V|PROTECTED LANDSCAPE |PROTECTED SEASCAPE = IUCN V |IUCN CATEGORY VI|IUCN VI|CATEGORY VI|MANAGED RESOURCE PROTECTED AREA = IUCN VI <!------------National/Regional designations----------> |CULTURAL MONUMENT OF ALBANIA|ALBANIAN CULTURAL MONUMENT|ALBANIA |MONUMENT KULTURE = CMOA |NATIONAL HISTORIC MONUMENT OF ARGENTINA|ARGENTINA HISTORIC MONUMENT |ARGENTINA|NHMA = NHMA |NATIONAL HISTORIC SITE OF CANADA|CANADIAN NATIONAL HISTORIC SITE |CANADA|NHSC = NHSC |PROTECTED NATURAL VALUE OF CROATIA|CROATIAN PROTECTED NATURAL VALUE |PROTECTED AREA OF CROATIA|CROATIAN PROTECTED AREA|CROATIA NATURAL |SPOMENIK PRIRODE = PNVC |CULTURAL GOOD OF CROATIA|CROATIAN CULTURAL GOOD|CROATIA CULTURAL |SPOMENIK KULTURE = CGOC |NATIONAL REGISTER OF HISTORIC PARKS AND GARDENS|ENGLAND HISTORIC PARK |ENGLAND HISTORIC GARDEN|ENGLISH HISTORIC PARK|ENGLISH HISTORIC GARDEN |REGISTER OF HISTORIC PARKS AND GARDENS|HISTORIC PARKS AND GARDENS = NRHPG |MONUMENT HISTORIQUE|FRANCE|FRENCH = MH |IRISH NATIONAL MONUMENT|NATIONAL MONUMENT OF IRELAND|IRELAND|IRISH |IRELAND MONUMENT IN STATE CARE|IRISH MONUMENT IN STATE CARE = INMON |NATIONAL TREASURE OF JAPAN|JAPANESE NATIONAL TREASURE|JAPAN = NTOJ |RIJKSMONUMENT|DUTCH NATIONAL MONUMENT|NETHERLANDS NATIONAL MONUMENT |NATIONAL MONUMENT OF THE NETHERLANDS|NETHERLANDS|DUTCH = RIJKS |NEW ZEALAND HISTORIC PLACES TRUST CATEGORY I|NEW ZEALAND CATEGORY I |NZ CATEGORY I = NZHPT I |NEW ZEALAND HISTORIC PLACES TRUST CATEGORY II|NEW ZEALAND CATEGORY II |NZ CATEGORY II = NZHPT II |NATIONAL MONUMENT OF PORTUGAL|PORTUGUESE NATIONAL MONUMENT|PORTUGAL |MONUMENTO NACIONAL DO PORTUGAL|IPPAR = IPPAR |SERBIAN CULTURAL PROPERTY OF GREAT IMPORTANCE|SERBIA|SERBIAN |CULTURAL PROPERTY OF GREAT IMPORTANCES = CPGI |NATIONAL MONUMENT OF SINGAPORE|SINGAPORE NATIONAL MONUMENT|SINGAPORE = NMS |INVENTORY OF GARDENS AND DESIGNED LANDSCAPES IN SCOTLAND |GARDENS AND DESIGNED LANDSCAPES IN SCOTLAND |INVENTORY OF GARDENS AND DESIGNED LANDSCAPES = GDLS |SPANISH PROPERTY OF CULTURAL INTEREST|BIEN DE INTERES CULTURAL |SPANISH|SPAIN = BDIC |SWISS CULTURAL PROPERTY OF NATIONAL SIGNIFICANCE|SWISS|SWITZERLAND |SWISS CULTURAL PROPERTY = CPNS |LISTED BUILDING|UNITED KINGDOM LISTED BUILDING|UK LISTED BUILDING = LISTED |CATEGORY A LISTED BUILDING|CATEGORY A|SCOTLAND CATEGORY A = LIST A |GRADE A LISTED BUILDING|GRADE A|NORTHERN IRELAND GRADE A = LIST A |GRADE I LISTED BUILDING|GRADE I|UNITED KINGDOM GRADE I|UK GRADE I = LIST I |CATEGORY B LISTED BUILDING|CATEGORY B|SCOTLAND CATEGORY B = LIST B |GRADE B+ LISTED BUILDING|GRADE B+|NORTHERN IRELAND GRADE B+ = LIST B+ |GRADE II LISTED BUILDING|GRADE II|UNITED KINGDOM GRADE II|UK GRADE II = LIST II |CATEGORY C LISTED BUILDING|CATEGORY C|SCOTLAND CATEGORY C = LIST C |GRADE B1 LISTED BUILDING|GRADE B1|NORTHERN IRELAND GRADE B1 = LIST B1 |GRADE II* LISTED BUILDING|GRADE II*|UNITED KINGDOM GRADE II* |UK GRADE II* = LIST II* |GRADE B2 LISTED BUILDING|GRADE B2|NORTHERN IRELAND GRADE B2 = LIST B2 |SCHEDULED MONUMENT|SCHEDULED ANCIENT MONUMENT|ANCIENT MONUMENT |UK SCHEDULED MONUMENT|UK ANCIENT MONUMENT|SCHEDULED HISTORIC MONUMENT |MONUMENT IN STATE CARE|UK SCHEDULED ANCIENT MONUMENT |UK SCHEDULED HISTORIC MONUMENT = SM |NATIONAL REGISTER OF HISTORIC PLACES|NRHP = NRHP |UNITED STATES HISTORIC DISTRICT|U.S. HISTORIC DISTRICT|NRHP-HD|HD |US HISTORIC DISTRICT|HISTORIC DISTRICT = HD |UNITED STATES CONTRIBUTING PROPERTY|US CONTRIBUTING PROPERTY |CONTRIBUTING PROPERTY|NRHP-CP|CP|U.S. CONTRIBUTING PROPERTY = CP |UNITED STATES NATIONAL HISTORIC LANDMARK DISTRICT CONTRIBUTING PROPERTY |US NATIONAL HISTORIC LANDMARK DISTRICT CONTRIBUTING PROPERTY |NATIONAL HISTORIC LANDMARK DISTRICT CONTRIBUTING PROPERTY|NRHP-NHLDCP |NHLDCP|U.S. NATIONAL HISTORIC LANDMARK DISTRICT CONTRIBUTING PROPERTY = NHLDCP |U.S. NATIONAL BATTLEFIELD|US NATIONAL BATTLEFIELD |NATIONAL BATTLEFIELD|NRHP-NB|NB = NB |U.S. NATIONAL BATTLEFIELD PARK|US NATIONAL BATTLEFIELD PARK |NATIONAL BATTLEFIELD PARK|NRHP-NBP|NBP = NBP |U.S. NATIONAL BATTLEFIELD SITE|US NATIONAL BATTLEFIELD SITE |NATIONAL BATTLEFIELD SITE|NRHP-NBS|NBS = NBS |U.S. NATIONAL HISTORIC LANDMARK|US NATIONAL HISTORIC LANDMARK |NATIONAL HISTORIC LANDMARK|NRHP-NHL|NHL = NHL |U.S. NATIONAL HISTORIC LANDMARK DISTRICT |US NATIONAL HISTORIC LANDMARK DISTRICT |NATIONAL HISTORIC LANDMARK DISTRICT|NRHP-NHLD|NHLD = NHLD |U.S. NATIONAL HISTORICAL PARK|US NATIONAL HISTORICAL PARK |NATIONAL HISTORICAL PARK|NRHP-NHP|NHP = NHP |U.S. NATIONAL HISTORIC RESERVE|US NATIONAL HISTORIC RESERVE |NATIONAL HISTORIC RESERVE|NRHP-NHR|NHR = NHR |U.S. NATIONAL HISTORIC SITE|US NATIONAL HISTORIC SITE |NATIONAL HISTORIC SITE|NRHP-NHS|NHS = NHS |U.S. NATIONAL MEMORIAL|US NATIONAL MEMORIAL|NATIONAL MEMORIAL |NRHP-NMEM|NMEM = NMEM |U.S. NATIONAL MONUMENT|US NATIONAL MONUMENT|NATIONAL MONUMENT |NRHP-NMON|NMON = NMON |U.S. NATIONAL MILITARY PARK|US NATIONAL MILITARY PARK |NATIONAL MILITARY PARK|NRHP-NMP|NMP = NMP |NATIONAL MONUMENT OF ZAMBIA|ZAMBIAN NATIONAL MONUMENT|ZAMBIA = NMZ <!------------State/Provincial designations-----------> |ONTARIO HERITAGE ACT|ONTARIO = OHA |REPERTOIRE DU PATRIMOINE CULTUREL DU QUEBEC|QUEBEC |CULTURAL HERITAGE REGISTER OF QUEBEC = RPCQ |DECLARED MONUMENT OF HONG KONG|HONG KONG DECLARED MONUMENT |HK DECLARED MONUMENT = HKDM |HONG KONG GRADED BUILDING|HK GRADED BUILDING|GRADED BUILDING = GBHK |HONG KONG GRADE I HISTORIC BUILDING|HONG KONG GRADE I|HK GRADE I = GBHK I |HONG KONG GRADE II HISTORIC BUILDING|HONG KONG GRADE II|HK GRADE II = GBHK II |HONG KONG GRADE III HISTORIC BUILDING|HONG KONG GRADE III|HK GRADE III= GBHK III |ALABAMA REGISTER|ALABAMA LANDMARK|ALABAMA|USAL|ARLH = ARLH |CALIFORNIA HISTORICAL LANDMARK|CALIFORNIA|CHISL = CHISL |COLORADO STATE REGISTER OF HISTORIC PROPERTIES|COLORADO|CSRHP|USCO = CSRHP |INDIANA REGISTER OF HISTORIC SITES AND STRUCTURES|INDIANA|IRHSS|USIN = IRHSS |MICHIGAN STATE HISTORIC SITE|MICHIGAN|MSHS = MSHS |MISSISSIPPI LANDMARK|MISSISSIPPI|USMS = USMS |NEW HAMPSHIRE STATE REGISTER OF HISTORIC PLACES |NEW HAMPSHIRE STATE REGISTER|NEW HAMPSHIRE|NHSR|NHSRHP|USNH = NHSRHP |NEW JERSEY REGISTER OF HISTORIC PLACES|NEW JERSEY|NJRHP|USNJ = NJRHP |N.M. STATE REGISTER OF CULTURAL PROPERTIES|NEW MEXICO STATE REGISTER |NEW MEXICO|NMSRCP|NMSR|USNM = NMSRCP |NEVADA HISTORICAL MARKER|NEVADA MARKER|NEVADA|USNV = USNV |RECORDED TEXAS HISTORIC LANDMARK|TEXAS|RTHL|USTX = RTHL |TEXAS STATE ANTIQUITIES LANDMARK|TEXAS|TSAL|USTX = TSAL |VIRGINIA LANDMARKS REGISTER|VIRGINIA|VLR|USVA = VLR <!------------Local designations----------------------> |YANGON CITY HERITAGE LIST|YANGON LANDMARK|YANGON CITY LANDMARK |YANGON CITY|YANGON = YCL |ALBUQUERQUE HISTORIC LANDMARK|ALBUQUERQUE|ALBHL = ALBHL |BERKELEY LANDMARK|BERKELEY|BERKL = BERKL |CHICAGO LANDMARK|CHICAGO|CHICL = CHICL |DALLAS LANDMARK|DALLAS = DLMK |DAVENPORT REGISTER OF HISTORIC PROPERTIES|DAVENPORT|DRHP = DRHP |LONG BEACH HISTORIC LANDMARK|LONG BEACH|LBHL = LBHL |LOS ANGELES HISTORIC-CULTURAL MONUMENT |LOS ANGELES HISTORIC CULTURAL MONUMENT|LOS ANGELES|LAHCM = LAHCM |NEW YORK CITY LANDMARK|NYC LANDMARK|NEW YORK CITY|NYC|NYCL = NYCL |OAKLAND|OAKLAND DESIGNATED|ODL = ODL |OMAHA LANDMARK|OMAHA = OMAL |OYSTER BAY LANDMARK|OYSTER BAY, NEW YORK|OYSTER BAY, NY|OYSTER BAY = OBL |PHILADELPHIA REGISTER OF HISTORIC PLACES|PHILADELPHIA|PRHP = PRHP |PITTSBURGH HISTORIC LANDMARK|PITTSBURGH LANDMARK|PITTSBURGH|PHLF = PHLF |RIVERSIDE LANDMARK|RIVERSIDE|RIVL = RIVL |ST. LOUIS LANDMARK|ST LOUIS LANDMARK|ST. LOUIS|ST LOUIS = SLL |SAN DIEGO HISTORIC LANDMARK|SAN DIEGO|SDHL = SDHL |SAN FRANCISCO LANDMARK|SAN FRANCISCO DESIGNATED LANDMARK |SAN FRANCISCO|SFDL = SFDL |SANTA MONICA HISTORIC LANDMARK|SANTA MONICA|SMHL = SMHL |SEATTLE LANDMARK|SEATTLE = SEATL <!------------Invalid designation---------------------> |#default = ??? }}<noinclude> {{doc}} </noinclude> cmds1rxcpg4ofx2ncveehnm2qnyfttc ထႅမ်းပလဵတ်ႉ:Infobox NRHP/locmapin2region 10 34204 112345 2025-06-26T07:37:28Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{MultiReplace|plain=false|{{MultiReplace|plain=false|{{MultiReplace|plain=false|>{{{1|}}}|(#)|>}}|>USA%s*|>|>United States%s*|>}}<!-- -->|^.*>(Alabama).*$|%1 |^.*>(Alaska).*$|%1 |^.*>(Arizona).*$|%1 |^.*>(Arkansas).*$|%1 |^.*>(California).*$|%1 |^.*>(Colorado).*$|%1 |^.*>(Connecticut).*$|%1 |^.*>(Delaware).*$|%1 |^.*>(Florida).*$|%1 |^.*>(Georgia).*$|%1 |^.*>(Hawaii).*$|%1 |^.*>(Idaho).*$|%1 |^.*>(Illinois).*$|%1 |..." 112345 wikitext text/x-wiki {{MultiReplace|plain=false|{{MultiReplace|plain=false|{{MultiReplace|plain=false|>{{{1|}}}|(#)|>}}|>USA%s*|>|>United States%s*|>}}<!-- -->|^.*>(Alabama).*$|%1 |^.*>(Alaska).*$|%1 |^.*>(Arizona).*$|%1 |^.*>(Arkansas).*$|%1 |^.*>(California).*$|%1 |^.*>(Colorado).*$|%1 |^.*>(Connecticut).*$|%1 |^.*>(Delaware).*$|%1 |^.*>(Florida).*$|%1 |^.*>(Georgia).*$|%1 |^.*>(Hawaii).*$|%1 |^.*>(Idaho).*$|%1 |^.*>(Illinois).*$|%1 |^.*>(Indiana).*$|%1 |^.*>(Iowa).*$|%1 |^.*>(Kansas).*$|%1 |^.*>(Kentucky).*$|%1 |^.*>(Louisiana).*$|%1 |^.*>(Maine).*$|%1 |^.*>(Maryland).*$|%1 |^.*>(Massachusetts).*$|%1 |^.*>(Michigan).*$|%1 |^.*>(Minnesota).*$|%1 |^.*>(Mississippi).*$|%1 |^.*>(Missouri).*$|%1 |^.*>(Montana).*$|%1 |^.*>(Nebraska).*$|%1 |^.*>(Nevada).*$|%1 |^.*>(New Hampshire).*$|%1 |^.*>(New Jersey).*$|%1 |^.*>(New Mexico).*$|%1 |^.*>(New York).*$|%1 |^.*>(North Carolina).*$|%1 |^.*>(North Dakota).*$|%1 |^.*>(Ohio).*$|%1 |^.*>(Oklahoma).*$|%1 |^.*>(Oregon).*$|%1 |^.*>(Pennsylvania).*$|%1 |^.*>(Rhode Island).*$|%1 |^.*>(South Carolina).*$|%1 |^.*>(South Dakota).*$|%1 |^.*>(Tennessee).*$|%1 |^.*>(Texas).*$|%1 |^.*>(Utah).*$|%1 |^.*>(Vermont).*$|%1 |^.*>(Virginia).*$|%1 |^.*>(District of Columbia).*$|%1 |^.*>(Washington[, ]*D[%.]*C[%.]*).*$|%1 |^.*>(West Virginia).*$|%1 |^.*>(Wisconsin).*$|%1 |^.*>(Wyoming).*$|%1 |^.*>(American Samoa).*$|%1 |^.*>(Guam).*$|%1 |^.*>(Northern Mariana Islands).*$|%1 |^.*>(Puerto Rico).*$|%1 |^.*>(Minor Outlying Islands).*$|%1 |^.*>(Virgin Islands).*$|%1 |^.*>(Washington).*$|%1 |^.*>Seattle.*$|Washington |^.*>Chicago.*$|Illinois|^>|}}<noinclude>{{documentation|content= == Examples == * <code><nowiki>{{Infobox NRHP/locmapin2region|USA Oregon Portland}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|USA Oregon Portland}} * <code><nowiki>{{Infobox NRHP/locmapin2region|United States San Francisco#USA California#USA}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|United States San Francisco#USA California#USA}} * <code><nowiki>{{Infobox NRHP/locmapin2region|USA Minneapolis–Saint Paul#USA Minnesota#USA}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|USA Minneapolis–Saint Paul#USA Minnesota#USA}} * <code><nowiki>{{Infobox NRHP/locmapin2region|United States Manhattan#New York}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|United States Manhattan#New York}} * <code><nowiki>{{Infobox NRHP/locmapin2region|USA Alaska Juneau#USA Alaska}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|USA Alaska Juneau#USA Alaska}} * <code><nowiki>{{Infobox NRHP/locmapin2region|United States Washington, D.C.#USA}}</nowiki></code> &rarr; {{Infobox NRHP/locmapin2region|United States Washington, D.C.#USA}} }}</noinclude> 0dn82682omgbic51nby5eaxcr2f3zjv ထႅမ်းပလဵတ်ႉ:Auto link 10 34205 112346 2025-06-26T07:38:05Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "<includeonly>{{{{{|safesubst:}}}#ifexist:{{{1|}}} |[[{{{1}}}|{{{2|{{{1}}}}}}]] |{{{2|{{{1}}}}}} }}</includeonly><noinclude> {{Documentation}} </noinclude>" 112346 wikitext text/x-wiki <includeonly>{{{{{|safesubst:}}}#ifexist:{{{1|}}} |[[{{{1}}}|{{{2|{{{1}}}}}}]] |{{{2|{{{1}}}}}} }}</includeonly><noinclude> {{Documentation}} </noinclude> myon1gzob9e9brpxka4gk82o32tssrw ထႅမ်းပလဵတ်ႉ:Auto link/doc 10 34206 112347 2025-06-26T07:38:33Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Documentation subpage}} {{High-use}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> === လွင်ႈၸႂ်ႉတိုဝ်း === To use this template, put {{tlf|auto link|target|word}} (if there is no word parameter, then the template will function in the same way as if it were the target). If the link location exists a link will be created, if not it will not. This template ex..." 112347 wikitext text/x-wiki {{Documentation subpage}} {{High-use}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> === လွင်ႈၸႂ်ႉတိုဝ်း === To use this template, put {{tlf|auto link|target|word}} (if there is no word parameter, then the template will function in the same way as if it were the target). If the link location exists a link will be created, if not it will not. This template exists to avoid redlinks being created. If the page is created, the link will be formed. This template also exists to allow templates to accept either plain text or wikitext for parameters, automatically linkifying the value if it is plain text, and an article exists there (see {{tl|Infobox Australian place}}). This template should not be used in the mainspace, as [[Wikipedia:Red link|red links]] are good. ==တူဝ်ယၢင်ႇ== * {{tld|auto link|a|_show_result=y}} * {{tld|auto link|aqrp|_show_result=y}} * {{tld|auto link|a|letter a|_show_result=y}} * {{tld|auto link|aqrp|,asmd|_show_result=y}} <includeonly>{{Sandbox other|| [[Category:Internal link templates|{{PAGENAME}}]] }}</includeonly> 8wls9qq8ycztoref94a86166qk1g9zb မေႃႇၵျူး:Location map/data/USA California 828 34207 112348 2025-06-26T07:41:11Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "return { name = 'ၵႄႇလီႇၾူဝ်းၼီးယႃး', top = 42.2, bottom = 32.3, left = -124.7, right = -113.9, image = 'USA California location map.svg', image1 = 'Relief map of California.png' }" 112348 Scribunto text/plain return { name = 'ၵႄႇလီႇၾူဝ်းၼီးယႃး', top = 42.2, bottom = 32.3, left = -124.7, right = -113.9, image = 'USA California location map.svg', image1 = 'Relief map of California.png' } m19hl2bg2e3m9sjvgo4fazvnbx33zpa မေႃႇၵျူး:Location map/data/USA California/doc 828 34208 112349 2025-06-26T07:41:42Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{High-use}} {{Module:Location map/data/doc|image=[[File:Map of California NA.png|thumb|400px|Map of California (click on map to see larger image)]] |name=the [[U.S. state]] of [[California]] |examples= === Location map === {{Location map | USA California | width = 250 | label = Sacramento | lat_deg = 38 | lat_min = 33 | lat_sec = | lat_dir = N | lon_deg = 121 | lon_min = 28 | lon_sec = | lon_dir = W }} <pre st..." 112349 wikitext text/x-wiki {{High-use}} {{Module:Location map/data/doc|image=[[File:Map of California NA.png|thumb|400px|Map of California (click on map to see larger image)]] |name=the [[U.S. state]] of [[California]] |examples= === Location map === {{Location map | USA California | width = 250 | label = Sacramento | lat_deg = 38 | lat_min = 33 | lat_sec = | lat_dir = N | lon_deg = 121 | lon_min = 28 | lon_sec = | lon_dir = W }} <pre style="width:40em"> {{Location map | USA California | width = 250 | label = Sacramento | lat_deg = 38 | lat_min = 33 | lat_sec = | lat_dir = N | lon_deg = 121 | lon_min = 28 | lon_sec = | lon_dir = W }} </pre> {{clear}} === Location map many, using relief map (image1) === {{Location map many | USA California | relief = yes | width = 250 | caption = Locations in California | lat1 = 41.99 | long1 = -120.29 | label1 = New Pine Creek | lat2 = 32.68 | long2 = -115.49 | label2 = Calexico | lat3 = 39.45 | long3 = -123.81 | label3 = Fort Bragg | lat4 = 33.61 | long4 = -114.59 | label4 = Blythe }} <pre style="width:40em"> {{Location map many | USA California | relief = yes | width = 250 | caption = Locations in California | lat1 = 41.99 | long1 = -120.29 | label1 = New Pine Creek | lat2 = 32.68 | long2 = -115.49 | label2 = Calexico | lat3 = 39.45 | long3 = -123.81 | label3 = Fort Bragg | lat4 = 33.61 | long4 = -114.59 | label4 = Blythe }} </pre> {{clear}} === Location map+, using AlternativeMap === {{Location map+ | USA California | AlternativeMap = Relief map of California.png | width = 250 | caption = Locations in California | places = {{Location map~ | USA California | lat = 41.99 | long = -120.29 | label = New Pine Creek }} {{Location map~ | USA California | lat = 32.68 | long = -115.49 | label = Calexico }} {{Location map~ | USA California | lat = 39.45 | long = -123.81 | label = Fort Bragg }} {{Location map~ | USA California | lat = 33.61 | long = -114.59 | label = Blythe }} }} <pre style="width:40em"> {{Location map+ | USA California | AlternativeMap = Relief map of California.png | width = 250 | caption = Locations in California | places = {{Location map~ | USA California | lat = 41.99 | long = -120.29 | label = New Pine Creek }} {{Location map~ | USA California | lat = 32.68 | long = -115.49 | label = Calexico }} {{Location map~ | USA California | lat = 39.45 | long = -123.81 | label = Fort Bragg }} {{Location map~ | USA California | lat = 33.61 | long = -114.59 | label = Blythe }} }} </pre> |see also= * [[Module:Location map/data/USA]] }}<includeonly> <!-- Categories go here --> {{DEFAULTSORT:California, Location map USA}} [[Category:California location map modules| ]] </includeonly> hcvkqvia0w7obrwj968hfcs6jdmjvmd ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ 10 34209 112350 2025-06-26T07:52:22Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၶႃႇရီႇပီႇယႅၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ | flag alias = Flag of the Netherlands.svg | flag alias-coast guard = Dutch_Caribbean_Coast_Guard_racing_stripe.svg | link alias-coast guard = Dutch Caribbean Coast Guard | size = {{{size|}}} | name = {{{name|}}} | altlink = {{{altlink|}}} | variant = {{{variant|}}} <noinclude> |..." 112350 wikitext text/x-wiki {{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၶႃႇရီႇပီႇယႅၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ | flag alias = Flag of the Netherlands.svg | flag alias-coast guard = Dutch_Caribbean_Coast_Guard_racing_stripe.svg | link alias-coast guard = Dutch Caribbean Coast Guard | size = {{{size|}}} | name = {{{name|}}} | altlink = {{{altlink|}}} | variant = {{{variant|}}} <noinclude> | redir1 = BES | redir2 = Bonaire, Sint Eustatius and Saba </noinclude> }} nnrdr4ryln2t2oawl6dhuncf8w60wol 112355 112350 2025-06-26T07:58:27Z Saimawnkham 5 ဢမ်ႇဢွၵ်ႇယၢၼ် လွင်ႈပိၼ်ႇၽၢႆႇသေ Saimawnkham ၶၢႆႉဝႆႉ ၼႃႈလိၵ်ႈ [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရီႇပီႇယႅၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]] တေႃႇ [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]]: ဢၢပ်ႉတဵတ်ႉၸိုဝ်ႈ 112350 wikitext text/x-wiki {{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၶႃႇရီႇပီႇယႅၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ | flag alias = Flag of the Netherlands.svg | flag alias-coast guard = Dutch_Caribbean_Coast_Guard_racing_stripe.svg | link alias-coast guard = Dutch Caribbean Coast Guard | size = {{{size|}}} | name = {{{name|}}} | altlink = {{{altlink|}}} | variant = {{{variant|}}} <noinclude> | redir1 = BES | redir2 = Bonaire, Sint Eustatius and Saba </noinclude> }} nnrdr4ryln2t2oawl6dhuncf8w60wol 112356 112355 2025-06-26T07:58:55Z Saimawnkham 5 112356 wikitext text/x-wiki {{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ | flag alias = Flag of the Netherlands.svg | flag alias-coast guard = Dutch_Caribbean_Coast_Guard_racing_stripe.svg | link alias-coast guard = Dutch Caribbean Coast Guard | size = {{{size|}}} | name = {{{name|}}} | altlink = {{{altlink|}}} | variant = {{{variant|}}} <noinclude> | redir1 = BES | redir2 = Bonaire, Sint Eustatius and Saba </noinclude> }} mh3cwascuvxd1w6znlbtrqlnrrcw1bp ၼႄႇတႃႇလႅၼ်ႇ တီႈ ၶႃႇရိပ်ႈပီႇယၼ်ႇ 0 34210 112352 2025-06-26T07:55:59Z Saimawnkham 5 Saimawnkham ၶၢႆႉယဝ်ႉ ၼႃႈလိၵ်ႈ [[ၼႄႇတႃႇလႅၼ်ႇ တီႈ ၶႃႇရိပ်ႈပီႇယၼ်ႇ]] တေႃႇ [[ၶႃႇရိပ်ႈပီႇယၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]]: ဢၢပ်ႉတဵတ်ႉၸိုဝ်ႈ 112352 wikitext text/x-wiki #REDIRECT [[ၶႃႇရိပ်ႈပီႇယၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]] cv1vz3sqls1bf2mnzt691ze1ot479er 112378 112352 2025-06-26T08:13:11Z Saimawnkham 5 Changed redirect target from [[ၶႃႇရိပ်ႈပီႇယၼ်ႇ ၼႄႇတႃႇလႅၼ်ႇ]] to [[ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 112378 wikitext text/x-wiki #REDIRECT [[ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 3qej1o1lxrr6svxq654pbphe7scqwpu ထႅမ်းပလဵတ်ႉ:Cite Q 10 34211 112357 2025-06-26T07:59:17Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "<includeonly>{{#invoke:Cite Q|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude> {{documentation}} </noinclude>" 112357 wikitext text/x-wiki <includeonly>{{#invoke:Cite Q|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude> {{documentation}} </noinclude> 31r8c6dbxzs4zvgqeap88a2j8vlm85g ထႅမ်းပလဵတ်ႉ:Cite Q/doc 10 34212 112358 2025-06-26T07:59:58Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Documentation subpage}} {{high use}} {{warning|From the [[Wikipedia:Templates for discussion/Log/2017 September 15#Template:Cite Q|TfD closure]]: "Until the matter of transcluding Wikidata on Wikipedia is resolved (most likely with a huge and contentious RFC) usage of this template should be extremely vetted to ensure that all of the transcluded information is accurate."}} <!-- Please place categories where indica..." 112358 wikitext text/x-wiki {{Documentation subpage}} {{high use}} {{warning|From the [[Wikipedia:Templates for discussion/Log/2017 September 15#Template:Cite Q|TfD closure]]: "Until the matter of transcluding Wikidata on Wikipedia is resolved (most likely with a huge and contentious RFC) usage of this template should be extremely vetted to ensure that all of the transcluded information is accurate."}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{Lua|Module:Cite Q}} {{Uses Wikidata|section=Parameter / entity map}} This template, a wrapper for {{Tl|Citation}}, returns a formatted citation from statements stored on a [[Wikidata]] item (referred to by its ''Q identifier'' or ''QID'') describing a citable source such as a scholarly article. You can read about the template in: :{{cite Q|Q104831003}} '''Note:''' While Wikipedia [[Wikipedia:Citing sources#Wikidata|does not regard Wikidata as a reliable source]], citations using Cite Q are ''not'' citing Wikidata; they cite the individual work stated, using metadata about that work, which is held on Wikidata for convenience. == လွင်ႈၸႂ်ႉတိုဝ်း == For example, Wikidata item {{Q|Q15625490}} is a scholarly item. To cite this as a source: :<code><nowiki>{{Cite Q|Q15625490}}</nowiki></code> → ::{{Cite Q|Q15625490|doi-access=free}} An example of an article using this template for ''all'' of its references is [[South Pole Telescope]]; an example using Harvard style citations is [[Suffix automaton]]. By default, if there are more than eight author names, the template displays three, followed by "et al". This can be changed using {{para|display-authors}}; setting that parameter to <code>all</code> displays them all. The same applies to multiple editors – see the test-case pages. Citations of papers which have been retracted ({{WDP|P5824}}) will appear in [[:Category:Cite Q - cites a retracted work]]. Citations of papers which have been replaced ({{WDP|P1366}}) will appear in [[:Category:Cite Q - cites a replaced work]]. You can also use {{tl|Cite Q bulleted}} if you want to have a bullet returned before the citation (useful for automatic lists) ===Parameters === * {{para|1}} = Wikidata QID for the article Additionally, any named parameter used in {{tl|citation}} may be entered and will overwrite the value in Wikidata. Using such parameters, with a value of <code>unset</code>, will suppress display of data from Wikidata. === Blank === :<code><nowiki><ref name="">{{Cite Q|Q00000000}}</ref></nowiki></code> === Reference naming === For ease of use, you may wish to name your references to reflect the cited work, for example: :<code><nowiki><ref name="Williams-2010">{{Cite Q|Q15625490}}</ref></nowiki></code> ===Parameter / entity map=== This section lists where each of the template's supported parameters gets its data. {{Columns-start}} ====Bibliographic parameters==== *{{para|at}} = {{WDP|P958}} *{{para|author''n''}} = {{WDP|P50}}; {{WDP|P2093}} *{{para|chapter}} = {{WDP|P792}} <!-- *{{para|contributor''n''}} = {{WDP|P2680}}, {{WDP|P1891}} --> *{{para|edition}} = {{WDP|P393}} *{{para|editor''n''}} = {{WDP|P98}}; {{WDP|P5769}} *{{para|issue}} = {{WDP|P433}} *{{para|journal}} = {{WDP|P1433}} *{{para|language}} = {{WDP|P407}} *{{para|pages}} = {{WDP|P304}} *{{para|place}} = {{WDP|P1071}} (for written-at place) *{{para|publication-date}} = {{WDP|P577}} (treated like {{para|date}} unless both are given) *{{para|publication-place}} = {{WDP|P291}} (for publication place, treated like {{para|place}} unless both are given) *{{para|publisher}} = {{WDP|P123}} *{{para|series}} = {{WDP|P179}} *{{para|title}} = {{WDP|P1476}} (Wikidata label) *{{para|translator''n''}} = {{WDP|P655}} *{{para|url}} = {{WDP|P953}}, {{WDP|P856}}, {{WDP|P2699}} *{{para|version}} = {{WDP|P348}} *{{para|volume}} = {{WDP|P478}} *{{para|others}} = {{WDP|P86}}, {{WDP|P110}}, {{WDP|P2679}}, {{WDP|P371}}, {{WDP|P175}} {{column}} ====Identifier parameters==== *{{para|asin}} = {{WDP|P5749}} (add {{para|asin-tld}} for some locales) *{{para|arxiv}} = {{WDP|P818}} *{{para|bibcode}} = {{WDP|P819}} (add {{para|bibcode-access}} to indicate free) *{{para|biorxiv}} = {{WDP|P3951}} *{{para|citeseerx}} = {{WDP|P3784}} *{{para|doi}} = {{WDP|P356}} (add {{para|doi-access}} to indicate free; add {{para|doi-broken-date}} if deprecated) *{{para|hdl}} = {{WDP|P1184}} (add {{para|hdl-access}} to indicate free) *{{para|isbn}} = {{WDP|P212}} (falls back to {{WDP|P957}}) *{{para|ismn}} = {{WDP|P1208}} *{{para|issn}} = {{WDP|P236}} *{{para|jstor}} = {{WDP|P888}} (add {{para|jstor-access}} to indicate free) *{{para|lccn}} = {{WDP|P1144}} *{{para|mr}} = {{WDP|P889}} *{{para|oclc}} = {{WDP|P243}} *{{para|ol}} = {{WDP|P648}} (add {{para|ol-access}} to indicate free) *{{para|osti}} = {{WDP|P3894}} (add {{para|osti-access}} to indicate free) *{{para|pmc}} = {{WDP|P932}} (add {{para|pmc-embargo-date}} if embargoed) *{{para|pmid}} = {{WDP|P698}} *{{para|rfc}} = {{WDP|P892}} *{{para|ssrn}} = {{WDP|P893}} *{{para|s2cid}} = {{WDP|P8299}} (add {{para|s2cid-access}} to indicate free) *{{para|zbl}} = {{WDP|P894}} {{Columns-end}} {{Columns-start}} ====Archival parameters==== *{{para|archive-url}} = {{WDP|P1065}} (the long URL with a date is needed; see [[WP:WEBARCHIVES]] for e.g. Archive Today) {{Columns-end}} === Examples === ;<code><nowiki>{{Cite Q|Q15625490}}</nowiki></code> :{{Cite Q|Q15625490|doi-access=free}} ;<code><nowiki>{{Cite Q|Q15625490|page=42}}</nowiki></code> :{{Cite Q|Q15625490|page=42|doi-access=free}} ;<code><nowiki>{{Cite Q|Q15625490|access-date=18 May 2017}}</nowiki></code> :{{Cite Q|Q15625490|access-date=18 May 2017|doi-access=free}} ;<code><nowiki>{{Cite Q|Q15625490|quote=lorem ipsum}}</nowiki></code> :{{Cite Q|Q15625490|quote=lorem ipsum|doi-access=free}} ;<code><nowiki>{{Cite Q|Q25766745}}</nowiki></code> :{{Cite Q|Q25766745}} ;<code><nowiki>{{Cite Q|Q25766745 |chapter=The Final Cut}}</nowiki></code> (with chapter specified) :{{Cite Q|Q25766745 |chapter=The Final Cut}} ;<code><nowiki>{{Cite Q|Q25766745 |pages=48-52}}</nowiki></code> (with pages) :{{Cite Q|Q25766745 |pages=48-52}} ;<code><nowiki>{{Cite Q|Q15625490|access-date=18 May 2017}}</nowiki></code> :{{Cite Q|Q15625490|access-date=18 May 2017|doi-access=free}} ;<code><nowiki>{{Cite Q|Q25766745|mode=cs1}}</nowiki></code> :{{Cite Q|Q25766745|mode=cs1}} ;<code><nowiki>{{Cite Q|Q25766745|mode=cs2}}</nowiki></code> :{{Cite Q|Q25766745|mode=cs2}} ;<code><nowiki>{{Cite Q|Q25766745|author-mask=1}}</nowiki></code> :{{Cite Q|Q25766745|author-mask=1}} ;<code><nowiki>{{Cite Q|Q25766745|editor=unset}}</nowiki></code> :{{Cite Q|Q25766745|editor=unset}} For an example of a bibliography, updated periodically by [https://listeria.toolforge.org/ Listeriabot], see [[User:Mike Peel/publications]]. For additional examples, see [[Template:Cite Q/testcases|testcases]] and [[Template:Cite Q/testcases/many names|testcases/many names]]. == Workflow == The template used with a single parameter, the Q-number of the article on Wikidata, will produce a citation using the default display parameters from [[Template:Citation]] and the styling of the author and editor names as they are stored on Wikidata. This is rarely the same as required by the citation formatting in any given article. The guidance at [[WP:CITEVAR]] requires that editors match the formatting of citations that they add to that of the article where it is added. At present, {{tl|Cite Q}} does not know what style the formatting in an article requires (although it is possible that common styles could be marked or recognised automatically as is done for date formatting). The result is that editors using {{tl|Cite Q}} must take care to preview their edits and ensure that the formatting rendered matches that of the rest of the article. The commonest formatting issues are: # Order of first and last names of authors and editors: #: A typical output might be: #* <code><nowiki>{{Cite Q |Q15625490}}</nowiki></code> → #* {{Cite Q |Q15625490|doi-access=free}} #: If that were used in an article that used "Last, First" format for author names, then the editor would have to find a way to format the Cite Q author names correctly. The best option, which will apply to all articles using Cite Q with a given ID, is to modify the Wikidata property for each author and editor, adding "object named as" with the author's name in "Last, First" format. See [[:d:Q45922947#P98]] for an example. #: Editors can also supply those author names manually in the desired format within the Cite Q template. It's often worth previewing the citation in expanded form to show what is being passed to the actual citation template: #* <code><nowiki>{{Cite Q |Q15625490 |expand=yes}}</nowiki></code> → #* {{Cite Q |Q15625490 |expand=yes}} #: That would make the author names (and author-links) easily available for copy and paste, followed by tweaking into the desired format: #* <code><nowiki>{{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E.}}</nowiki></code> → #* {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E.|doi-access=free}} # Punctuation: #: The separators between elements in the above citation is a comma, which is the default for a CS2-style format produced by {{tl|Citation}}. Careful examination in a particular article will often show the separator punctuation to be a full stop (period). That may be selected by setting {{para|mode|cs1}}: #* <code><nowiki>{{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1}}</nowiki></code> → #* {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1|doi-access=free}} #* Sometimes, the article will have author names with initials, and those initials are terminated with a full stop (period). It may be necessary to manually add or remove the punctuation in the author names to match the style of the target article (note: this does not apply to author-links, which match the title of the author's article): #* <code><nowiki>{{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1}}</nowiki></code> → #* {{Cite Q |Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1|doi-access=free}} # Italicisation in titles: #: Titles drawn from Wikidata cannot contain formatting, so editors using {{tl|Cite Q}} may have to add appropriate formatting. #: {{tl|Citation}} will automatically apply italicisation to titles of books, etc. so that does not need to be added: #* <code><nowiki>{{Cite Q |Q25766745}}</nowiki></code> → #* {{Cite Q |Q25766745}} #: However, some titles require partial italicisation, and that has to be done manually when the whole title is not italicised, although that is rare. Titles of chapters may also need to be checked: #* For example (from {{isbn|978-0-521-32115-0}}): <code><nowiki>|chapter= ''Porphyra'' as food: cultivation and economic</nowiki></code> == Searching == Citations for specific a work (for example {{Q|Q106612012}}) can be searched using the string <code>insource:Q106612012</code>, resulting in [https://en.wikipedia.org/w/index.php?search=insource%3AQ106612012]. To avoid most extraneous results (such as this documentation page), use <code>insource:Q|Q106612012 OR insource:Q |Q106612012</code> (again, without quotes), and limit the namespaces: [https://en.wikipedia.org/w/index.php?search=insource%3AQ|Q106612012+OR+insource%3AQ+|Q106612012&title=Special%3ASearch&profile=advanced&fulltext=1&ns0=1&ns118=1]. == Module:Wd == [[Module:Wd]] can automatically cause this template to be invoked, e.g., ;<code><nowiki>{{Wikidata|references|raw|Q2978|P2046|P585=1987-05-25}}</nowiki></code> :{{Wikidata|references|raw|Q2978|P2046|P585=1987-05-25}} currently causes the following to be invoked: ;<code><nowiki>{{Cite Q|Q15707237|pages=242}}</nowiki></code> :{{Cite Q|Q15707237|pages=242}} because an {{wikidata entity link|P2046}} statement on {{wikidata entity link|Q2978}} is referenced to be {{wikidata entity link|P248}} {{wikidata entity link|Q15707237}} with {{wikidata entity link|P304}} = 242. {{hatnote|See [[d:Q2978#P2046]]}} == Issues == === Future developments === * Once robust the functionality should be merged into {{Tl|Citation}} * Eventually, each signed-in reader should be able to set, under their "Preferences", the style in which they wish to see citations rendered. No more [[WP:CITEVAR|CiteVar]] wars! * We should have a [[:mw:Global templates|global template repository]], so the code can be used by multiple wikis, without having to manually copy it after every update. === To do list === * Properties ** More properties/ parameters to add ** Parameters with no equivalent property? * Internationalisation * Check/resolve handling of redirected QID * Order of precedence for rendering author names: *# <s>{{Wikidata entity link|P1932}} qualifier on {{Wikidata entity link|P50}}</s> *# <s>{{Wikidata entity link|P1810}} qualifier on {{Wikidata entity link|P50}}</s> *# <s>{{Wikidata entity link|P2093}}</s> *# <s>{{Wikidata entity link|P50}} label in English</s> *# {{Wikidata entity link|P50}} label in any other language ** <s>Regardless of which of the above is used, link to the author biography article if available, via {{Wikidata entity link|P50}} (matched via {{Wikidata entity link|P1545}} if applicable)</s> * Add tracking categories for each parameter where the local value differs from the corresponding WD value so that either the WD entry can be updated/corrected or the local override can be corrected/removed ** Other tracking categories? * Links to sister projects: Wikisource, if a transcription project exists; Wikibooks; Wikiversity (esp. the WikiJournals there); perhaps more **Avoid <code><nowiki><ref name="dicc">{{Cite Q|Q100160262}} {{cite wikisource|wslanguage=pt|wslink=Diccionario Bibliographico Brazileiro/Francisco Antonio de Almeida|title=Transcription}}</ref></nowiki></code>! **Also add links to authors who have pages on Wikisource but not on Wikipedia. Related query: [https://w.wiki/qTu Authors on Wikisource but not other projects, who are linked to by an item which is a subclass of Q47461344 (written work)] * Link to Wikisource should take priority over all URL properties, but only if accompanied by {{WDP|P996}}. If not, {{WDP|P996}} should take precedence over URLs.<!-- The rationale is that Wikisource books with the originals are both verifiable and can link to Wikipedia, Wiktionary etc. Wikisource books without the originals are not as trustworthy as the original files on Commons, so Commons files should be preferred --> * <s>Where there is a Wikipedia article about the work cited, link the title to that, overriding the URL if necessary (example: [[:d:Q25766745]])</s> ** Ditto for editions of works * At present a WD pages entry of "1" will result in |pages=1–1 (and metadata &rft.pages=1-1) rather than |page=1 (and metadata &rft.pages=1). * Implement evaluation of generic keyword for all parameters to denote that a WD value should be accepted by framing its value in accept-this-as-written markup ((..)). See talk thread for possible keyword names. * Check all parameter aliases when scanning for override parameters (at present some alias parameter names are ignored, possibly leading to inconsistent behaviour if they are set as well). * Consider including a link to [[Special:EntityUsage]], in the form, say, [[Special:EntityUsage/Q101607488|Other cites]] or with a small icon. * Take possible template parameter usage as hint which parameter to use in the generated output. F.e. if the journal/magazine/newspaper parameter is used, the template should use the same in the output. The underlying template {citation} will switch the output format accordingly. * Try to utilize given parameter values as filter for retrieved WD data. If an editor specifies |edition=2 or |volume=3, cite Q should select correlating data (f.e. page ranges, identifiers etc.) while retrieving data from WD (in cases where more than one entry is available for a particular parameter) * When the author is cited as {{Q|2818964}}, the label should start with an upper case letter **Quick and dirty workaround: <code><nowiki>{{ucfirst:{{Cite Q|xxxx}}</nowiki></code> * Make [https://species.wikimedia.org/w/index.php?title=Module:Cite_Q&diff=8090723&oldid=8090081 this fix] unnecessary. * Add indication alongside citations of retracted/ replaced works * Consider cases where citing a retracted/ replaced work is deliberate * Make use of {{para|archive-url}}, {{para|archive-date}}, and consider how to use {{para|url-status}} ** Partially implemented for the cases where {{WDP|P1065}} is a qualifier of {{WDP|P953}} and is a URL showing the date in a recognised format (per a regex) * Use {{WDP|P6833}}, where present. * Ability to cite chapters, per [[Template talk:Cite Q#Cite Q chapter broken]] * Use something like {{WDP|P2441}} so that {{para|trans-title}} [[Template talk:Cite Q#Reminder for title-trans|is used to provide the English translated title, if present]], in addition to the non-English original title. === Deferred === Feel free to tackle these; the core team working on Cite Q sees them as low priority, or too complex. * Resolve special case of newspaper articles ** Is the following topic of "hint parameters" related to this? * Author names (Western-style, at least) should display as "Last, First Middle" to match Wikipedia house style ** How to deal with [[Tussenvoegsel]]s etc. ***In Romance languages, it should be, e.g., "Quental, Antero de" instead of "de Quental, Antero" * Handle volume in a serial ** '''Clarification needed:''' What is meant by this? |part=, or output format differences journal vs. magazine? * Is there a Pxxxx code for book series editors to add them to the list of "normal" editors? ** resolve at Wikidata first ===Done=== * <s>Multiple author names treated as one blob</s> * <s>Linking author name(s)</s> * <s>Title for a book uses <code><nowiki>{{ #invoke:WikidataIB |getLink |{{{1}}} }}</nowiki></code> and may be expensive</s> * <s>Fix {{para|ol}} values</s> * <s>Need to add manual date for newspaper articles/ website articles.</s> * <s>Make publisher a link, where appropriate</s> * <s>Improve handing of unexpected multiple values</s> ** <s>e.g. Handle multiple DOIs</s> * <s>Author name string ({{Wikidata entity link|P2093}}) values (e.g. on [[d:Q38000000|Q38000000]])</s> * <s>Pseudonymous author personas such as [[P. D. Q. Bach]] or [[Mark Twain]]</s> * <s>Title not in English</s> * <s>Handle volume, issue and page(s) as qualifiers of {{Wikidata entity link|P1433}}</s> * <s>Wider variety of examples/ test cases</s> * <s>If language of work or name is set (and not the local language); pass that; if not but language of title is set (and not the local language), use that</s> * <s>The <code>url</code> parameter should also pick up data from the properties {{Wikidata property link|953}} and {{Wikidata property link|2699}}</s> * <s>Linking title to Wikipedia article, if any</s> * <s>Fetch ISSN etc. from item about journal</s> * <s>Move Wikidata link before {{para|quote}} (and after other IDs like {{Para|pmid}})</s> ** <s>Also fixes postscript character issues in conjunction with {{para|mode|cs1}} and with {{para|quote}}</s> * <s>Fix page evaluation code to accept comma- and semicolon-separated lists</s> * <s>Use canonical parameter names when calling down to {citation} (f.e. |page= rather than |p=)</s> * <s>Is there a Pxxxx code for SBNs ([[Standard Book Number]] to support |sbn= parameter?</s> **<s>Apparently not</s> -> Add SBN property to WD. (Also add [[Serial Item and Contribution Identifier|SICI]] and [[Book Item and Component Identifier|BICI]] properties corresponding with COinS &rft.sici and &rft.bici.) * <s>Is there a Pxxxx code for JFM ([[Jahrbuch über die Fortschritte der Mathematik]]) to support |jfm= parameter?</s> **<s>{{WDP|P894}}? No, Zbl uses the same resolving link, but it is a different ID.</s> * Are there values of {{para||others}} which are not illustrators? Possibly: ** <s>{{WDP|P2679}}</s> ** <s>{{WDP|1891}}</s> *** <s>Fails for very high numbers</s> ** <s>{{WDP|P371}}</s> ** <s>{{WDP|P175}}</s> * <s>Add a tracking category for references with a {{WDP|P1366}} statement</s> * <s>Add a tracking category for references with a {{WDP|P5824}} statement</s> * <s>Render {{Wikidata entity link|P1680}}, following the title with a <code>:</code></s> * <s>Convert WikiData's edition number (e.g., ''1'') into the ordinal (''1st'') expected by {{tl|citation}}.</s> === Won't fix === * Improve date formatting options ** This is done in {{tl|Citation}} * Fix unnecessary piping of author/editor and journal links if link and label are the same, f.e. <nowiki>[[Author|Author]]</nowiki> -> <nowiki>[[Author]]</nowiki>, <nowiki>[[Journal|Journal]]</nowiki> -> <nowiki>[[Journal]]</nowiki> for improved reusability, cleaniness of output, reduced size of resulting page code, and to avoid potential future extra text errors thrown by the underlying {citation} template ** See talk * Fix invocation with {{para|qid|}} instead of unnamed parameter. At present <nowiki>{{cite Q|qid=Q12345}}</nowiki> instead of <nowiki>{{cite Q|Q12345}}</nowiki> gives an error. ** This is intended; please discuss on talk ** Fix ready for test in template sandbox: <nowiki>{{cite Q/sandbox|qid=Q15625490}}</nowiki> gives {{cite Q/sandbox|qid=Q15625490|doi-access=free}} * Replace the QID with a pen icon ** The QID is valid metadata about the cited work. * Consider case where author is given as {{Q|Q311624}} ** If last author/editor is named "et al." (and variants), mute this entry and set display-authors/editors=etal instead before passing down to {citation} *** Disputed; see [[Template talk:Citation#Et al]] * Improve rendering when both {{WDP|P50}} and {{WDP|2093}} are present. ** Example: ''<nowiki>{{Cite Q|Q108740476}}</nowiki>'' → {{Cite Q|Q108740476}} ** Current rendering of author name uses semicolon: “Camelia-Manuela Lățăianu; Manuela Lataianu” ** Suggested improved rendering of author name: “Manuela Lataianu [= Camelia-Manuela Lățăianu]” ** Such instances should be fixed on Wikidata, [https://www.wikidata.org/w/index.php?title=Q108740476&type=revision&diff=1630505802&oldid=1505280341 as done here] == တူၺ်းပႃး == * [[:meta:WikiCite]] and [[:d:Wikidata:WikiProject Source Metadata]] - goals of those projects include the management of citations across Wikimedia projects and better insight into research resources through Wikimedia projects. * [[Wikipedia:How to add sources to Wikidata]] – if you want to add citations directly to Wikidata == ၶေႃးမုၼ်းထႅမ်းပလဵတ်ႉ == <templatedata> { "description": "Generate citations from Wikidata by passing the QID to this template", "params": { "1": { "label": "QID", "description": "The Wikidata QID of the cited source", "type": "string", "suggested": true, "required": true }, "author": { "label": "Author", "description": "Use for Last, First format", "example": "Prymachenko, Maria", "type": "string" }, "authorlink": { "label": "Author Link", "description": "Wikipedia article title, use with Author", "example": "Maria Prymachenko", "type": "string" } }, "paramOrder": [ "1", "author", "authorlink" ] } </templatedata> <includeonly>{{sandbox other|| <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Templates that wrap Citation]] [[Category:Templates using data from Wikidata]] }}</includeonly> 6be1iewkynzvbobkla66hl2xjco6xzs မေႃႇၵျူး:Cite Q 828 34213 112359 2025-06-26T08:00:15Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "-- Version: 2021-10-19 local p = {} require('strict') local wdib = require('Module:WikidataIB') local getValue = wdib._getValue local getPropOfProp = wdib._getPropOfProp local followQid = wdib._followQid local getPropertyIDs = wdib._getPropertyIDs local i18n = { ["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper), ["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author..." 112359 Scribunto text/plain -- Version: 2021-10-19 local p = {} require('strict') local wdib = require('Module:WikidataIB') local getValue = wdib._getValue local getPropOfProp = wdib._getPropOfProp local followQid = wdib._followQid local getPropertyIDs = wdib._getPropertyIDs local i18n = { ["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper), ["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author unknown]] removed as misplaced; someone is welcome to restore it if it is placed outside of the template parameter value ["ordinal"] = { [1] = "st", [2] = "nd", [3] = "rd", ["default"] = "th" }, ["months"] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }, } ------------------------------------------------------------------------------- -- makeOrdinal needs to be internationalised along with the above i18n -- takes cardinal number as a numeric and returns the ordinal as a string -- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc. ------------------------------------------------------------------------------- p.makeOrdinal = function(cardinal) local card = tonumber(cardinal) if not card then return cardinal end local ordsuffix = i18n.ordinal.default if card % 10 == 1 then ordsuffix = i18n.ordinal[1] elseif card % 10 == 2 then ordsuffix = i18n.ordinal[2] elseif card % 10 == 3 then ordsuffix = i18n.ordinal[3] end -- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th' -- similarly for 12 and 13, etc. if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then ordsuffix = i18n.ordinal.default end return card .. ordsuffix end -- Table of simple properties that can be fetched in roughly the same way: -- id = PXXX -- maxvals = maximum number of multiple values (0 for all) -- linked = "no" suppresses linking -- populate_from_journal = true/false determines whether to look in a journal where the source is published -- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated -- others = true - the value for the property goes to "others" section local simple_properties = { publisher = {id = "P123", maxvals = 1}, oclc = {id = "P243", maxvals = 1}, ['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given) doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")? issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future) pmid = {id = "P698", maxvals = 1}, -- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}} -- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}} arxiv = {id = "P818", maxvals = 1}, bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=? jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=? mr = {id = "P889", maxvals = 1}, rfc = {id = "P892", maxvals = 1}, zbl = {id = "P894", maxvals = 1}, ssrn = {id = "P893", maxvals = 1}, place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place -- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages= -- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden= s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=? pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")? lccn = {id = "P1144", maxvals = 1}, hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=? ismn = {id = "P1208", maxvals = 1}, journal = {id = "P1433", maxvals = 1}, citeseerx = {id = "P3784", maxvals = 1}, osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=? biorxiv = {id = "P3951", maxvals = 1}, asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change) -- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum= isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13 issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues? -- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl) -- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU) -- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID chapter = {id = "P792", maxvals = 1}, ['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.) series = {id = "P179", maxvals = 1, populate_from_journal = true}, version = {id = "P348", maxvals = 0}, edition = {id = "P393", maxvals = 0}, volume = {id = "P478", maxvals = 0, populate_from_journal = true}, -- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part= title = {id = "P1476", rank="p n"}, -- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url pages = {id = "P304", maxvals = 0, populate_from_journal = true}, at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=) -- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true}, -- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section -- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=; -- the writer's name goes in |contributor=; requires |title= and |author= -- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others -- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section -- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section } --[[--------------------------< I S _ S E T >-------------------------------------------------------------- Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string. ]] local function is_set( var ) return not (var == nil or var == '') end --[[--------------------------< I N _ A R R A Y >-------------------------------------------------------------- Whether needle is in haystack (taken from Module:Citation/CS1/Utilities) ]] local function in_array( needle, haystack ) if needle == nil then return false end for n, v in ipairs( haystack ) do if v == needle then return n end end return false end --[[--------------------------< A C C E P T _ V A L U E >------------------------------------------------------- Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is. ]] local function accept_value( param_val, wd_val ) local val = param_val if val then if in_array (val, {'accept', '))((', ':d:'}) then val = '((' .. wd_val .. '))' elseif '((accept))' == val then val = 'accept' elseif '(())(())' == val then val = '))((' elseif '((:d:))' == val then val = ':d:' else val = wd_val end end return val end -- function to fetch a value to display local function makelink(v, out, link, maxpos, wdl) local label if v.mainsnak.snaktype == "value" then if v.mainsnak.datatype == "wikibase-item" then local qnumber = v.mainsnak.datavalue.value.id local sitelink = mw.wikibase.getSitelink(qnumber) if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors" if v.qualifiers and v.qualifiers.P1932 then label = v.qualifiers.P1932[1].datavalue.value else label = mw.wikibase.getLabel(qnumber) if label then label = mw.text.nowiki(label) else label = qnumber -- should add tracking category end end local position = maxpos + 1 -- Default to 'next' author. -- use P1545 (series ordinal) instead of default position. if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then position = tonumber(v.qualifiers["P1545"][1].datavalue.value) end maxpos = math.max(maxpos, position) if sitelink then -- just the plain name, -- but keep a record of the links, using the same index out[position] = label link[position] = sitelink else if wdl then -- show that there's a Wikidata entry available out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]]&nbsp;<span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>" else -- no Wikidata links wanted, so just give the plain label out[position] = label end end elseif v.mainsnak.datatype == "string" then local position = maxpos + 1 -- Default to 'next' author. -- use P1545 (series ordinal) instead of default position. if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then position = tonumber(v.qualifiers["P1545"][1].datavalue.value) end maxpos = math.max(maxpos, position) out[position] = v.mainsnak.datavalue.value else -- not a wikibase-item or a string! end else -- code here if we want to return something when author is "unknown" if v.qualifiers and v.qualifiers.P1932 then label = v.qualifiers.P1932[1].datavalue.value else label = i18n["unknown-author"] .. (i18n["unknown-author-trackingcat"] or "") end maxpos = maxpos + 1 out[maxpos] = label end return maxpos end --[=[-------------------------< G E T _ N A M E _ L I S T >---------------------------------------------------- get_name_list -- adapted from getAuthors code taken from Module:RexxS arguments: nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators args - pointer to the parameter arguments table from the template call qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists returns nothing; modifies the args table ]=] local function get_name_list (nl_type, args, qid, wdl) local propertyID = "P50" local fallbackID = "P2093" -- author name string if nl_type =="author" then propertyID = 'P50' -- for authors fallbackID = 'P2093' -- author-string elseif nl_type =="editor" then propertyID = 'P5769' -- "editor-in-chief" fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed -- TBD. Take book series editors into account as well (if they have a separate P code as well)? elseif nl_type == "translator" then propertyID = 'P655' -- for translators fallbackID = nil -- elseif 'contributor' == nl_type then -- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author= -- propertyID = 'P' -- for contributors -- fallbackID = nil else return -- not specified so return end -- wdl is a Boolean passed to enable links to Wikidata when no article exists -- if "false" or "no" or "0" is passed set it false -- if nothing or an empty string is passed set it false if wdl and (#wdl > 0) then wdl = wdl:lower() wdl = in_array (wdl, {"false", "no", "0"}) else -- wdl is empty, so wdl = false end local props = nil local fallback = nil if mw.wikibase.entityExists(qid) then props = mw.wikibase.getAllStatements(qid, propertyID) if props and fallbackID then fallback = mw.wikibase.getAllStatements(qid, fallbackID) end end -- Make sure it actually has at least one of the properties requested if not (props and props[1]) and not (fallback and fallback[1]) then return nil end -- So now we have something to return: -- table 'out' is going to store the names(s): -- and table 'link' will store any links to the name's article local out = {} local link = {} local maxpos = 0 if props and props[1] then for k, v in pairs(props) do maxpos = makelink(v, out, link, maxpos, wdl) end end if fallback and fallback[1] then -- second properties for k, v in pairs(fallback) do maxpos = makelink(v, out, link, maxpos, wdl) end end -- if there's anything to return, then insert the additions in the template arguments table -- in the form |author1=firstname secondname |author2= ... -- Renumber, in case we have inconsistent numbering local keys = {} for k, v in pairs(out) do keys[#keys + 1] = k end table.sort(keys) -- as they might be out of order for i, k in ipairs(keys) do out[k] = out[k]:gsub ('&#39;', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character mw.log(i .. " " .. k .. " " .. (out[k])) if args[nl_type .. i] then -- name gets overwritten -- pull corresponding -link only if overwritten name is same as WD name if link[k] and (args[nl_type .. i] == out[k]) then args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn end else -- name does not get overwritten, so pull name from WD args[nl_type .. i] = out[k] if link[k] then args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn end end end end -- gets language codes used for a monolingual text property as a table function p._getLangOfProp(qid, pid) if not pid then return {} end local out = {} local props = mw.wikibase.getAllStatements(qid, pid) for i, v in ipairs(props) do if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then out[#out + 1] = v.mainsnak.datavalue.value.language end end return out end function p.getLangOfProp(frame) local pid = frame.args.pid or mw.text.trim(frame.args[1] or "") if pid == "" then return end local qid = frame.args.qid if qid == "" then qid = nil end return table.concat(p._getLangOfProp(qid, pid), ", ") end -- gets the language codes of a Wikidata entry as a table local function _lang_code(qid) local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} ) if lc then return mw.text.split( lc, "[, ]+" ) end lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} ) if lc then return mw.text.split( lc, "[, ]+" ) end return p._getLangOfProp(qid, "P1476") end function p.lang_code(frame) return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ") end -- export for debug function p.getPropOfProp(frame) return getPropOfProp(frame.args) end -- wraps a string in nowiki unless disable flag is set local function wrap_nowiki(str, disable) if disable then return str or '' end return mw.text.nowiki(str or '') end -- sort sequence table whose values are key-value pairs by key local function comp_key(a, b) return a[1] < b[1] end -- sort sequence table whose values are key-value pairs by value local function comp_val(a, b) return a[2] < b[2] end --[[-------------------------< C I T E _ Q >------------------------------------------------------------------ Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1= are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to {{citation}} for rendering. --]] function p._cite_q (citeq_args) local frame = mw.getCurrentFrame() -- parameters that don't get passed to Citation local expand = citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code> local qid = citeq_args.qid or citeq_args[1] local wdl = citeq_args.wdl local template = citeq_args.template citeq_args.expand = nil citeq_args[1] = nil citeq_args.qid = nil citeq_args.wdl = nil citeq_args.template = nil -- if title supplied, flag to not read html title local titleforced = (citeq_args.title ~= nil) local oth = {} -- put the language codes into a sequential table langcodes[] local langcodes = {} if citeq_args.language then -- check these are a supported language codes for lc in mw.text.gsplit( citeq_args.language, "[, ]+", false ) do langcodes[#langcodes+1] = mw.language.isSupportedLanguage(citeq_args.language) and citeq_args.language end end if not langcodes[1] then -- try to find language of work langcodes = _lang_code(qid) end if not langcodes[1] then -- try fallback to journal's language local journal_qid = followQid({qid = qid, props = "P1433"}) langcodes = journal_qid and _lang_code(journal_qid) end citeq_args.language = citeq_args.language or table.concat(langcodes, ", ") -- loop through list of simple properties and get their values in citeq_args for name, data in pairs(simple_properties) do citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", citeq_args[name] } ) if data.populate_from_journal then local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, citeq_args[name], qual = data.id, qualsonly = 'yes'} ) citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, maxvals = data.maxvals, ps = 1}) end if citeq_args[name] and citeq_args[name]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then -- try fallback to work's native language citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = langcodes[1] } ) if citeq_args[name]:find('^Q%d+$') then -- qid was returned -- try fallback to qid's native language local qid_languages = _lang_code(citeq_args[name]) citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = qid_languages[1] } ) if citeq_args[name]:find('^Q%d+$') then -- qid was returned again citeq_args[name] = nil else -- record the language found if no lang specified citeq_args.language = citeq_args.language or qid_languages[1] end end end if data.others then oth[#oth + 1] = citeq_args[name] and (name:gsub("^%l", string.upper) .. ": " .. citeq_args[name]) citeq_args[name] = nil end end citeq_args.others = citeq_args.others or table.concat(oth, ". ") if citeq_args.others == "" then citeq_args.others = nil end citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]") citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1") if citeq_args.ol == "" then citeq_args.ol = nil end -- TBD. Take care of |ol-access=? citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv) citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", citeq_args.isbn } ) -- try ISBN 10 (only one value accepted) -- if url then see if there's an archive: citeq_args.url local url if not citeq_args.url then for i, pr in ipairs( {"P953", "P856", "P2699"} ) do url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, qual="P1065" } ) if url then citeq_args.url = mw.text.split( url, " (", true )[1] local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present if arcurl then local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)") if arcy and arcm and arcd then citeq_args["archive-url"] = arcurl citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy end end break end end end if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932) local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} ) if stated_as then citeq_args.publisher = stated_as end end if not titleforced then -- Handle subtitle. if citeq_args.title then local subtitle = mw.wikibase.getBestStatements (qid, 'P1680'); if 0 ~= #subtitle then subtitle = subtitle[1].mainsnak.datavalue.value.text; citeq_args.title = citeq_args.title .. ": " .. subtitle end end local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, maxvals = 1, qo = "y"} ) if htmltitle then citeq_args.title = htmltitle:gsub("</?i>", "''") else local title_display = citeq_args.title or mw.wikibase.getLabel(qid) or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1])) or ("No label or title -- debug: " .. qid) if citeq_args.url then citeq_args.title = wrap_nowiki(title_display) else local slink = mw.wikibase.getSitelink(qid) local slink_flag = false local wrap_title = '' local wslink = false if not slink then -- See if we have wikisource if not citeq_args.url then local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil if wikisource_sitelink then slink = ':s:'..wikisource_sitelink wslink = true end end end if citeq_args.title then if slink then wrap_title = wrap_nowiki(citeq_args.title) slink_flag = true else citeq_args.title = wrap_nowiki(citeq_args.title) end else if slink and not wslink then if slink:lower() == title_display:lower() then citeq_args.title = '[[' .. slink .. ']]' else wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")) slink_flag = true end elseif wslink then wrap_title = wrap_nowiki(title_display) slink_flag = true else citeq_args.title = wrap_nowiki(title_display) end end if slink_flag then if slink == wrap_title and not wslink then -- direct link citeq_args.title = '[[' .. slink .. ']]' else -- piped link citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]' end end end end end -- TBD: incorporate |at, |sheets= and |sheet= here as well -- Sort out what should happen if several of them are given at the same time if citeq_args.page or citeq_args.p then -- let single take precedence over multiple citeq_args.pages = nil citeq_args.pp = nil end if citeq_args.pages then local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "") if count == 1 then citeq_args.page = citeq_args.pages citeq_args.pages = nil end end if is_set (qid) then if not is_set (citeq_args.author) and not is_set (citeq_args.author1) and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1) and not is_set (citeq_args.host) and not is_set (citeq_args.host1) and not is_set (citeq_args.last) and not is_set (citeq_args.last1) and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1) and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last']) and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata get_name_list ('author', citeq_args, qid, wdl) -- modify citeq_args table with authors from Wikidata end if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1) and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last']) and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata get_name_list ('editor', citeq_args, qid, wdl) -- modify citeq_args table with editors from Wikidata end if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1) and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last']) and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata get_name_list ('translator', citeq_args, qid, wdl) -- modify citeq_args table with translators from Wikidata end end for k, v in pairs(citeq_args) do if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}} citeq_args[k] = nil elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords citeq_args[k] = 'unset' end end local author_count = 0 for k, v in pairs(citeq_args) do if k:find("^author%d+$") then author_count = author_count + 1 end end if author_count > 8 then -- convention in astronomy journals, optional mode for this? if 'all' == citeq_args['display-authors'] then citeq_args['display-authors'] = nil; -- unset because no longer needed else citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names end end local editor_count = 0 for k, v in pairs(citeq_args) do if k:find("^editor%d+$") then editor_count = editor_count + 1 end end if editor_count > 8 then -- convention in astronomy journals, optional mode for this? if 'all' == citeq_args['display-editors'] then citeq_args['display-editors'] = nil; -- unset because no longer needed else citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names end end -- change edition to ordinal if it's set and numeric citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition) -- code to make a guess what template to use from the supplied parameters -- (first draft for proof-of-concept) if citeq_args.isbn then template = template or "book" citeq_args.asin = nil -- suppress ASIN if ISBN exists elseif citeq_args.journal then template = template or "journal" elseif citeq_args.website then template = template or "web" end -- template is CS1 designator: journal, web, news, etc. if template then -- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous template = "Cite " .. template else -- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous template = "Citation" end -- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list local list_sep = '. ' if citeq_args.mode ~= 'cs1' then list_sep = ', ' end local id = '[[WDQ (identifier)|Wikidata]]&nbsp;[[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}. local old_id = citeq_args.id if wdl then -- show WD logo id = id .. '[[File:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon? end if is_set (old_id) then citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents else citeq_args.id = id end -- clean up any blank parameters for k, v in pairs(citeq_args) do if v == "" then citeq_args[k] = nil end end -- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like if expand then local expand_args = { "{{" .. template } -- init with citation template if expand == "self" then citeq_args.id = old_id -- restore original |id= parameter expand_args = { "{{cite Q|" .. qid } -- expand to itself end -- make a sortable table and sort it by param name local sorttable = {} for param, val in pairs (citeq_args) do table.insert(sorttable, {param, val}) end table.sort(sorttable, comp_key) -- add contents to expand_args for idx, val in ipairs(sorttable) do table.insert(expand_args, val[1] .. '=' .. val[2]) end -- make the nowiki'd string and done return frame:preprocess (table.concat ({'<syntaxhighlight lang="wikitext" inline="1">', table.concat (expand_args, ' |') .. '}}', '</syntaxhighlight>'})); end local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } ) if erratumid then erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[Category:Cite Q - cites a work with an erratum]]" else erratumid = "" end local opt_cat = '' if getValue( {"P5824", ps = 1, qid = qid} ) then opt_cat = '[[Category:Cite Q - cites a retracted work]]<!-- retracted -->' end if getValue( {"P1366", ps = 1, qid = qid} ) then opt_cat = opt_cat .. '[[Category:Cite Q - cites a replaced work]]<!-- replaced -->' end return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template end function p.cite_q (frame) local args = {} for k, v in pairs(frame:getParent().args) do if v ~= "" then args[k] = v end end for k, v in pairs(frame.args) do if v ~= "" then args[k] = v end end args.qid = args.qid or args[1] or "" if args.qid == "" then return nil end args[1] = nil local citesep = (args.citesep or "") if citesep == "" then citesep = ", " end citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator args.citesep = nil local tag = args.tag or "" if tag == "" then tag = nil end args.tag = nil local list = args.list or "" if list == "" then list = nil end args.list = nil args.language = args.language or args.lang args.lang = nil local cites = {} for q in args.qid:gmatch("Q%d+") do -- make a new copy of the arguments local newargs = {} for k, v in pairs(args) do if k ~= "qid" then newargs[k] = v end end newargs.qid = q if tag == "ref" then cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } } -- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' } else cites[#cites + 1] = p._cite_q(newargs) end end if list then return frame:expandTemplate{ title = list, args = cites } else return table.concat(cites, citesep) end end return p duvnr23l5pfblcugtfmi5cnkp219s96 မေႃႇၵျူး:Cite Q/doc 828 34214 112360 2025-06-26T08:00:38Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{High-use}} Implements {{tl|Cite Q}} Test cases at: * [[Template:Cite Q/testcases]] * [[Template:Cite Q/testcases/many names]] <noinclude> [[Category:Module documentation pages]] </noinclude>" 112360 wikitext text/x-wiki {{High-use}} Implements {{tl|Cite Q}} Test cases at: * [[Template:Cite Q/testcases]] * [[Template:Cite Q/testcases/many names]] <noinclude> [[Category:Module documentation pages]] </noinclude> k5nc4i1a81ybh94m1fgk64q77t6pe08 မေႃႇၵျူး:Side box/doc 828 34215 112363 2025-06-26T08:02:41Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Module rating|protected}} {{High-use}} {{Lua|Module:Yesno}} {{Uses TemplateStyles|Module:Side box/styles.css|Template:Plainlist/styles.css}} This module implements the {{tl|side box}} template. == Usage from wikitext == This module cannot be used directly from wikitext. It can only be used through the {{tl|side box}} template. Please see the template page for documentation. == Usage from Lua modules == To use..." 112363 wikitext text/x-wiki {{Module rating|protected}} {{High-use}} {{Lua|Module:Yesno}} {{Uses TemplateStyles|Module:Side box/styles.css|Template:Plainlist/styles.css}} This module implements the {{tl|side box}} template. == Usage from wikitext == This module cannot be used directly from wikitext. It can only be used through the {{tl|side box}} template. Please see the template page for documentation. == Usage from Lua modules == To use this module from other Lua modules, first load the module. <syntaxhighlight lang="lua"> local mSideBox = require('Module:Side box') </syntaxhighlight> You can then generate a side box using the _main function. <syntaxhighlight lang="lua"> mSideBox._main(args) </syntaxhighlight> The <var>args</var> variable should be a table containing the arguments to pass to the module. To see the different arguments that can be specified and how they affect the module output, please refer to the {{tl|side box}} template documentation. <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox|| <!-- Categories go here and interwikis go in Wikidata. --> }}</includeonly> ocu64az470qhjsyf6nf4ppfsdifq2el မေႃႇၵျူး:Side box/styles.css 828 34216 112364 2025-06-26T08:02:55Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "/* {{pp|small=y}} */ .side-box { margin: 4px 0; box-sizing: border-box; border: 1px solid #aaa; font-size: 88%; line-height: 1.25em; background-color: var(--background-color-interactive-subtle, #f8f9fa); display: flow-root; } /* embedded side boxes need larger font */ .infobox .side-box { font-size: 100%; } .side-box-abovebelow, .side-box-text { padding: 0.25em 0.9em; } .side-box-image { /* @noflip */..." 112364 sanitized-css text/css /* {{pp|small=y}} */ .side-box { margin: 4px 0; box-sizing: border-box; border: 1px solid #aaa; font-size: 88%; line-height: 1.25em; background-color: var(--background-color-interactive-subtle, #f8f9fa); display: flow-root; } /* embedded side boxes need larger font */ .infobox .side-box { font-size: 100%; } .side-box-abovebelow, .side-box-text { padding: 0.25em 0.9em; } .side-box-image { /* @noflip */ padding: 2px 0 2px 0.9em; text-align: center; } .side-box-imageright { /* @noflip */ padding: 2px 0.9em 2px 0; text-align: center; } /* roughly the skin's sidebar + size of side box */ @media (min-width: 500px) { .side-box-flex { display: flex; align-items: center; } .side-box-text { flex: 1; min-width: 0; } } @media (min-width: 720px) { .side-box { width: 238px; } .side-box-right { /* @noflip */ clear: right; /* @noflip */ float: right; /* @noflip */ margin-left: 1em; } /* derives from mbox classes, which do not float left in mbox-small-left * so far as I can tell, that was a deliberate decision, since only .ambox * supports mbox-left */ .side-box-left { /* @noflip */ margin-right: 1em; } } a8iddu42qgjj6mffnouwiq1k3qb6388 မေႃႇၵျူး:WikidataIB/doc 828 34217 112366 2025-06-26T08:05:03Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Module rating |protected}} {{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}} {{ombox|text=For a more user-friendly wrapper of this module see {{t|wdib}}.}} This module is intended to be used inside {{t|infobox}} (letters Wikidata'''IB''' stand for ''Info Box'', hence the name) or other templates and designed specifically to allow editors of an article (as opposed to editors of the infobox the article uses) to cont..." 112366 wikitext text/x-wiki {{Module rating |protected}} {{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}} {{ombox|text=For a more user-friendly wrapper of this module see {{t|wdib}}.}} This module is intended to be used inside {{t|infobox}} (letters Wikidata'''IB''' stand for ''Info Box'', hence the name) or other templates and designed specifically to allow editors of an article (as opposed to editors of the infobox the article uses) to control whether Wikidata values are displayed. One of the two sandboxes should be used for testing anything other than trivial amendments. Test examples for the main module and the two sandboxes are available. {| class="wikitable plainrowheaders |+ Modules and test cases |- ! ! scope="col" | Module ! scope="col" | Test cases |- ! scope="row" | Main | [[Module:WikidataIB]] | [[Module talk:WikidataIB/testing]] |- ! scope="row" | sandbox | [[Module:WikidataIB/sandbox]] ({{Compare pages|Module:WikidataIB|Module:WikidataIB/sandbox|diff}}) | [[Module talk:WikidataIB/sandbox/testing]] ({{Compare pages|Module talk:WikidataIB/testing|Module talk:WikidataIB/sandbox/testing|diff}}) |- ! scope="row" | sandbox1 | [[Module:WikidataIB/sandbox1]] ({{Compare pages|Module:WikidataIB|Module:WikidataIB/sandbox1|diff}}) | [[Module talk:WikidataIB/sandbox1/testing]] ({{Compare pages|Module talk:WikidataIB/testing|Module talk:WikidataIB/sandbox1/testing|diff}}) |} == Overview == The module provides these calls specifically for use in infoboxes at present: # <code>getValue</code> - main call, used to get the value(s) of a given property # <code>getQualifierValue</code> - given: (1) a property; (2) its value; (3) a qualifier's propertyID, returns values which match # <code>getValueByQual</code> gets the value of a property which has a qualifier with a given entity value # <code>getValueByLang</code> gets the value of a property which has a qualifier P407("language of work or name") whose value has the given language code # <code>getValueByRefSource</code> gets the value of a property which has a reference "stated in" (P248) whose value has the given entity-ID # <code>getPropOfProp</code> if the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2 of each of those wikibase-items # <code>getAwardCat</code> if the item has values of P166 (award received), then it examines each of those awards for P2517 (category for recipients of this award) and it returns the corresponding category, with the item's P734 (family name) as sort key, or no sort key if there is no family name # <code>getIntersectCat</code> for each value of the prop1 it fetches the value's main category and then each value of prop2, then it returns all of the categories representing the intersection of those properties # <code>getSumOfParts</code> scans the property 'has part' (P527) for values matching a list. If the matched values have a qualifier 'quantity' (P1114), those quantities are summed and returned (but zero returns nil) # <code>getCoords</code> gets coordinates and passes them through {{t|Coord}} # <code>getPreferredValue</code> - {{color|red|'''Deprecated'''}} but retained for backward compatibility. Use the <code>|getValue|rank=best</code> parameters instead The obsolete call getSourcedValue has now been removed as it is redundant to getValue which can do the same job using the {{para|onlysourced|true}} parameter (which is set by default). ===Utilities functions=== # <code>getLink</code> if there is a sitelink to an article on the local Wiki, it returns a link to the article with the Wikidata label as the displayed text. If there is no sitelink, it returns the label as plain text. If there is no label in the local language, it returns the entity-ID # <code>getAT</code> (Article Title) If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text, otherwise nothing # <code>getSiteLink</code> gets the plain text link to an article on a given wiki # <code>getLabel</code> returns the Wikidata label for the local language as plain text. If there is no label in the local language, it returns the entity-ID # <code>getAllLabels</code> fetches the set of labels and formats it for display as wikitext # <code>labelorid</code> returns the label with all wikitext removed, or the entity-ID if no label # <code>getDescription</code> returns the article description for the Wikidata entity if the local parameter is "Wikidata" # <code>getAllDescriptions</code> fetches the set of descriptions and formats it for display as wikitext # <code>getAliases</code> returns the aliases for the entity in the current or given language # <code>getAllAliases</code> fetches the set of aliases and formats it for display as wikitext # <code>pageId</code> returns the connected Wikidata page id (entity-ID, Q-number) of the current page # <code>formatDate</code> takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues and formats it according to the df (date format) and bc parameters # <code>formatNumber</code> formats a number according to the supplied language code # <code>checkBlacklist</code> returns true if the field is ''not'' blacklisted (i.e. allowed) # <code>emptyor</code> returns nil if the parameter is just punctuation, whitespace or html tags, otherwise returns the argument unchanged # <code>getLang</code> returns the MediaWiki language code or the full language name of the current content # <code>getItemLangCode</code> looks for country (P17), then for that country's official language (P37), and returns its language code (P424) # <code>findLanguage</code> returns (1) supplied language if valid; or (2) the user's set language; or (3) the language of the current wiki # <code>getQid</code> returns (1) the entity-ID, if supplied; or (2) the entity ID of the "category's main topic (P301)"; or (3) the entity ID associated with the current page; or (4) nothing # <code>followQid</code> given a list of properties, looks for each property in turn and returns the entity-ID of the first value that matches (optionally, returns all entity-IDs that match) # <code>getGlobe</code> returns the entity-ID of the globe used in P625 (coordinate location), or nil if there isn't one # <code>getCommonsLink</code> returns one of the following in order of preference: the Commons sitelink of the linked Wikidata item; the Commons sitelink of the topic's main category of the linked Wikidata item # <code>siteID</code> returns the root of the globalSiteID, e.g. "en" for "enwiki", "enwikisource", "en-gb", etc. # <code>projID</code> same as siteID # <code>location</code> scans from the current location upwards along the chain of higher-level locations, returning each one until it reaches a country # <code>examine</code> returns a formatted dump of the given property # <code>url2</code> takes a parameter that is a proper url and formats it for use in an infobox; it accepts its own output as input # <code>getWebsite</code> fetches the Official website (P856) and formats it for use in an infobox # <code>checkvalue</code> looks through a property for a given entity-ID as its value and returns that entity-ID if found; otherwise nil # <code>checkValidity</code> returns whether the first unnamed parameter represents a valid entity-id # <code>showNoLinks</code> displays the article titles that should not be linked ===Examples of calls=== <nowiki>{{#invoke:WikidataIB |getValue |<PropertyID> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no> |noicon=<yes/no> |df=<dmy/mdy/y> |bc=<BC/BCE> |qual=<ALL/DATES/P999> |list=<ubl/hlist/prose> |linked=<yes/no> |<local parameter>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getCoords |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |<local parameter>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getQualifierValue |<PropertyID> |pval=<ID of target value for the property> |qual=<qualifier ID for that target value> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getValueByQual |<PropertyID> |qualID=<qualifier property ID to match> |qvalue=<QID of target value for the qualifier property> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getValueByLang |<PropertyID> |lang=<language code to match> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki> == Function getValue == === Parameters to getValue === {| class ="wikitable sortable" |- ! scope="col" | Name ! scope="col" | Alias ! scope="col" | Function ! scope="col" | Default |- | (first unnamed) | 1 | The property-ID whose values are returned. Required. | |- |- | (second unnamed) | 2 | A locally supplied value that, if it is not empty, will be returned in preference to the value on Wikidata. | empty |- | qid | | The Q-number (entity-ID) of the entity that the property belongs to. If not supplied or empty, defaults to the associated Wikidata entry of the current page – uses [[:mw:Extension:Wikibase Client/Lua #mw.wikibase.getEntityIdForCurrentPage|mw.wikibase.getEntityIdForCurrentPage()]]. | Item id for current&nbsp;page |- | eid | | An alternative to qid. Except for <code>eid</code>, all parameters to getValue treat nil and the empty string the same. So, setting {{para|x}} gives the same result as omitting the parameter. However, to provide some compatibility with other modules, using {{para|eid}} always returns an empty string, while omitting <code>eid</code> allows <code>qid</code> to work as normal. | Item id for current&nbsp;page |- | rank | | [Case insensitive] When set to <code>best</code>, returns preferred values if present, otherwise returns normal values. When set to <code>preferred</code> returns preferred values. When set to <code>normal</code>, returns normal values. When set to <code>deprecated</code> returns deprecated values. Any parameter value beginning with "b" is "best"; beginning with "p" is "preferred"; beginning with "n" is "normal"; beginning with "d" is deprecated. Multiple values are allowed: "p n d" would return all ranks. "Best" overrides the other flags. Other values are ignored and if no ranks are requested, preferred and normal are returned. | preferred and normal |- | qual | | A punctuation-separated list of property-IDs of qualifiers that are to be returned in parentheses after the property. Setting <code>qual=ALL</code> returns all qualifiers. Setting <code>qual=DATES</code> returns {{q|P580}} and {{q|P582}} with a date separator. | none |- | qualsonly | qo | A boolean which enables the display of just the qualifier(s), without the property value or parentheses. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | fetchwikidata | fwd | List of fields to fetch values from. <code>ALL</code> fetches all fields. A value of <code>NONE</code> or blank or omitting the parameter fetches no fields. | none |- | suppressfields | spf | List of fields which will never display. This will even force a local value in the field not to display. | none |- | name | | Name of the field. When encoding an infobox, this is the name that fetchwikidata and suppressfields will recognise. Required if fetchwikidata or suppressfields is specified (except when <code>fetchwikidata=ALL</code>). | nil |- | onlysourced | osd | A boolean which will filter out Wikidata values that are unsourced or only sourced to Wikipedia. [[Wikipedia:Wikidata/2018_Infobox_RfC#Discussion|This 2018 RFC]] requires that Wikidata values displayed in article infoboxes must be sourced. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | true |- | df | | Date format: may be <code>dmy</code> (day before month) or <code>mdy</code> (month before day) or <code>y</code> (year alone). | dmy |- | qdf | | Date format of qualifiers. If omitted, defaults to parameter <code>df</code>, or "y" if <code>df</code> is also omitted. | value of df or "y" |- | bc | | Format of the BC/BCE suffix for dates. | BCE |- | plaindate | pd | String to modify formatting of dates. Setting "true"/"yes"/"1" disables adding "sourcing cirumstances" (P1480) and any links. Setting "adj" does the same but uses the adjectival form of the date. | false |- | linked | | A boolean that enables the link to a local page via its sitelink on Wikidata. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | true |- | displaytext | dt | A string that overrides the displayed text of a linked item if it is non-empty. | empty |- | shortname | sn | A boolean that enables the use of shortname (P1813) instead of label for a linked item. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | uselabel | uselbl | A boolean that forces the display of the label instead of the disambiguated sitelink for a linked item. Labels are much more prone to vandalism that sitelinks. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | wdlinks | wdl | A boolean that enables the display of links to Wikidata when no local article exists. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | unitabbr | uabbr | A boolean that enables unit abbreviations for common units. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | convert | conv | A boolean that enables passing of quantities to Template:Cvt. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | showunits | su | A boolean that enables showing units for quantities. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | true |- | scale | | A string that sets scaling for format of quantities. Values are: "a"=automatic; "0"=no scaling; "3"=thousand; "6"=million; "9"=billion; "12"=trillion. | 0 |- | maxvals | | Sets the maximum number of values to be returned when multiple values are available. Setting it to 1 is useful where the returned string is used within another call, e.g. image. Values <code>0</code> and empty return all values. | 0 (all) |- | collapse | | Sets the maximum number of values to be returned before the content is auto-collapsed. Values <code>0</code> and empty allow all content to be displayed uncollapsed. | 0 (all) |- | linkprefix | lp | A link prefix that is prepended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed. | empty |- | linkpostfix | | A link postfix that is appended to the linked value when linked. Applies only to items that have articles and to strings (e.g. url). It triggers linking of strings. Any double-quotes " are stripped out, so that spaces may be passed. | empty |- | prefix | | A prefix that is prepended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed. | empty |- | postfix | | A postfix that is appended to the displayed value of strings (e.g. url). Any double-quotes " are stripped out, so that spaces may be passed. | empty |- | qlinkprefix | qlp | Qualifier link prefix (see linkprefix). | empty |- | qlinkpostfix | | Qualifier link postfix (see linkpostfix). | empty |- | qprefix | | Qualifier prefix (see prefix). | empty |- | qpostfix | | Qualifier postfix (see postfix). | empty |- | sorted | | A boolean which enables sorting of the values returned. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | qsorted | | A boolean which enables sorting of the qualifier values within each item returned. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |- | noicon | | A boolean which will suppress the trailing "edit at Wikidata" pen-icon. Useful for when the returned value is to be further processed. Values <code>no</code>, <code>false</code> and <code>0</code> are all false (i.e. shows the icon); anything else is true (i.e. suppresses the icon). | false |- | list | | The name of a template that the list of multiple values is then passed through. Examples include "cslist", "hlist", "ubl", "blist", "olist", "p-1". A special value, <code>prose</code>, produces "1, 2, 3 and 4". | none |- | sep | | Customises the string that is used to separate multiple returned values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English). | ", " |- | qsep | | Customises the string that is used to separate multiple returned qualifier values. Any double-quotes " are stripped out, so that spaces may be passed. If nothing or an empty string is passed it is set to the default list separator (", " in English). | ", " |- | format | | Determines whether global coordinates should be rendered as degree/minute/second or as decimal degrees. Any value beginning "dec" (case insensitive) will render as decimal. Anything else will render as DMS. | dms |- | show | | Determines how global coordinates should be returned. The value "longlat" will return <code>longitude, latitude</code>. Any other value beginning "lon" (case insensitive) will return just longitude. Any value beginning "lat" (case insensitive) will return just latitude. When used with {{para|noicon|true}}, all of these will be pure numbers in decimal degrees (signed: N and E as positive), which are intended for use in mapping templates, etc. Anything other value (or nothing) will render the usual coordinate values as DMS or decimal with "NSEW" qualifiers, etc. | empty |- | lang | | Allows an unlinked value to be returned in the chosen language. Takes a standard ISO language code recognised by MediaWiki. If not supplied or blank, the local language (or set language for multi-lingual wikis) is used as normal. | local language |- | parameterset | ps | Convenience parameter to allow commonly used sets of parameters to be specified with a single parameter: ps=1 gets a simple linked value wherever possible; ps=2 represents a plain text value. See [[#Parameter sets|Parameter sets]]. | |- | linkredir | | Boolean to switch on or off the check for a redirect with the same name as the label when there is no sitelink on Wikidata for the value. Values <code>no</code>, <code>false</code> and <code>0</code> are all false; anything else is true. | false |} === Base parameters === * getValue can also take a named parameter {{para|qid}} which is the Wikidata ID for an article. This will not normally be used as omitting it defaults to the current article. * The property whose value is to be returned is passed in the first unnamed property and is required. * The second unnamed parameter, if supplied, will become the returned value and no call to Wikidata will be made. === Whitelist and blacklist === * The name of the field that this function is called from is passed in the named parameter {{para|name}}, which is first checked against a blacklist of fields that are never to be displayed, (i.e. the call must return nil in all circumstances). If the field is not on the blacklist, it is then checked against a whitelist. If the name of the field matches, the call will return any locally supplied value if it is supplied as the second unnamed parameter, or the Wikidata value otherwise. * Specifying {{para|fetchwikidata|ALL}} is a shortcut to return all fields that are not blacklisted. * The name is compulsory when the blacklist or whitelist is used, so the module returns nil if it is not supplied, other than when {{para|fetchwikidata|ALL}}. * The blacklist is passed in the named parameter {{para|suppressfields}} * The whitelist is passed in the named parameter {{para|fetchwikidata}} === Sourcing === The getValue function will accept a boolean parameter <code>onlysourced</code> which will suppress return of Wikidata values that are unsourced or only sourced to a Wikimedia project. The absence of the parameter, an empty parameter ({{para|onlysourced}}) and the empty string (<code>""</code>) all default to true (i.e. only referenced values are returned). The values <code>no</code>, <code>false</code> and <code>0</code> are treated as false (i.e. all values are returned); any other value is true (although {{para|onlysourced|yes/no}} is recommended for readability). === Link to Wikidata === The getValue function will accept a boolean parameter <code>noicon</code> which will suppress the trailing "edit at Wikidata" icon and link for cases when the returned value is to be further processed by the infobox (e.g. a url). The absence of the parameter or an empty parameter ({{para|noicon}}) default to false (i.e. the icon is added). The empty string (<code>""</code>) and the values <code>no</code>, <code>false</code> and <code>0</code> are treated as false; any other value is true (although {{para|noicon|true}} is recommended for readability). Following a discussion at [[Module talk:WikidataIB #Visibility of pen icon]], the pen icon is hidden from users who are not autoconfirmed. This means that most readers don't see the pen icon, and represents a balance between aesthetics and vandalism at Wikidata on the one hand, and the desire to encourage editing Wikidata on the other. === Dates === In order to handle the requirement for dates in mdy, dmy or just year formats, getValue accepts a named parameter {{para|df}} that may take the values "dmy", "mdy", or "y" - default is "dmy". As an article may require either of suffixes BC and BCE, getValue accepts a named parameter {{para|bc}} that may take the values "BC", or "BCE" - default is "BCE". Some test cases are shown at [[Module talk:WikidataIB/testing #Calls to getValue for dates]]. === Ranks === The {{para|rank}} parameter, when set to preferred, returns only preferred values; when set to normal, returns only normal values; when set to deprecated, returns only deprecated values. If the parameter is set to best, it returns preferred values if present, otherwise normal values. Any parameter value beginning with "p" is "preferred"; any parameter value beginning with "n" is "normal"; any parameter value beginning with "d" is "deprecated"; any parameter value beginning with "b" is "best". Combinations of values are allowed, e.g. {{para|rank|p n}} returns all the preferred and normal values (which is the default), although "best" overrides any other parameters. ==== Specific value-type handlers ==== The module has specific handlers for the following data types: # Items that correspond to an article in some Wikipedia, called "wikibase-items". These will be linked to the corresponding (and disambiguated) article on English Wikipedia where possible. # Items that represent dates. These may be centuries, years, years and months, or years, months and days. # Items that represent Commons media, urls, external ids, or other sorts of plain text. # Items that represent quantities. All of these may have an associated unit, or be dimensionless, and may have a range. # Items that represent global coordinates. These will be in degrees of latitude and longitude and will have an associated precision. Items that represent other types of data are not handled at present. The third class of data types may be used with the parameters: * {{para|prefix}}, {{para|postfix}}, {{para|linkprefix}}, {{para|linkpostfix}} If you don't supply at least one of {{para|linkprefix}} or {{para|linkpostfix}}, then just {{para|prefix}} and {{para|postfix}} are used. For example, when getting the {{Q|P717}} in {{Q|Q532127|}}: * <code><nowiki>{{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix="before " |postfix=" after" |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB/sandbox |getValue |P717 |fetchwikidata=ALL|onlysourced=no |prefix="before " |postfix=" after" |qid=Q532127}} Use double-quotes to enclose the parameter value if it has leading or trailing spaces (otherwise they are stripped out). If you supply {{para|linkprefix}} or {{para|linkpostfix}}, then all four parameters are used and a link is made for each value like this: * <code><nowiki>[[ linkprefix WikidataValue1 linkpostfix | prefix WikidataValue1 postfix]], [[ linkprefix WikidataValue2 linkpostfix | prefix WikidataValue2 postfix]], etc.</nowiki></code> That allows multiple links to be made to different sections of a list article, such as [[List of observatory codes]]. For example, when getting the {{Q|P717}} in {{Q|Q532127|}} we can make the links: *<code><nowiki>{{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix="List of observatory codes#" |linkpostfix= |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB/sandbox|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix="List of observatory codes#" |linkpostfix= |qid=Q532127}} The parameters {{para|prefix}}, {{para|postfix}}, {{para|linkprefix}}, {{para|linkpostfix}} are also applied to wikibase-items if they are linked. ==== Formatting multiple returned values ==== * {{para|sorted|<yes{{!}}no>}} is a boolean passed to enable sorting of the values returned. No parameter, or an empty string, or "false", or "no", or "0" disables sorting. It's only a very dumb alphabetical sort and sorts linked values as "[[ ..." * {{para|sep|<separator characters>}} allows the separator between multiple returned values to be defined. The default is <code>", "</code> (comma plus normal space). If the separator has leading or trailing spaces, enclose it in double quotes (e.g. {{para|sep|" - "}}). Any double quotes are stripped from the separator. The pipe character (<code>|</code>) must be escaped as <code><nowiki>{{!}}</nowiki></code>. For reasons of accessibility (see [[MOS:PLIST]]), do not use {{para|sep|&lt;br>}} for vertical unbulleted lists; use {{para|list|ubl}} instead. * {{para|list|<prose{{!}}cslist{{!}}hlist{{!}}ubl{{!}}blist{{!}}olist>}} allows multiple returned values to be displayed as a sentence with last two values separated by "and" ({{para|list|prose}}), a horizontal comma-separated list ({{para|list|cslist}}, not to be used in prose), a horizontal list ({{para|list|hlist}}), a vertical unbulleted list ({{para|list|ubl}}), a vertical bulleted list ({{para|list|blist}}), or a vertical ordered list ({{para|list|olist}}). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata". * {{para|list|p-1}} displays the last value. Combine with {{para|maxvals|''n''}} to display the ''n''th value. === Limiting the returned values === Sometimes a property is expected to have a single value, such as {{q|P18}}, but may have multiple values on Wikidata. Setting {{para|maxvals|1}} will limit the number of values returned to 1. Any other value is possible and functions as expected, but zero is treated as "no limit". === Unlinking === A returned value that represents an article on the local wiki will be linked by default. This includes redirects, but not dab pages. Sometimes there is a need not to link that returned values and this may be accomplished by setting {{para|linked|no}}. === Unit abbreviations === When the returned value is a quantity, the name of the units in which it is expressed is appended. Infoboxes may wish to use abbreviations instead for common units. This can be done by setting {{para|unitabbr|true}}. === Qualifiers === A parameter {{para|qual}} may be supplied, which will return qualifiers of the required property, if they exist. If the value is set to a punctuation-separated list of property-IDs (e.g. P123, P456), then only the values of qualifiers with that property will be returned. If the value is set to {{para|qual|ALL}}, then all of the qualifier values are returned. If the value is set to {{para|qual|DATES}} then the {{q|P580}} and the {{q|P582}} of the property are returned with a date separator. In each case, any qualifier values returned follow the property value, and are enclosed in parentheses. If multiple qualifier values are returned, they will be separated by commas by default, although the separator can be changed by specifying {{para|qsep}} (which may be enclosed in double-quotes, which are stripped out, so that spaces can be included). Setting the parameter {{para|qsorted|yes}} will sort the returned qualifier values alphanumerically. === Short form of parameters === Some of the longer parameters may be abbreviated to make infobox designs more compact: * <code>fwd → fetchwikidata</code> * <code>osd → onlysourced</code> * <code>spf → suppressfields</code> * <code>wdl → wdlinks</code> === Parameter sets === Generally, <code>getValue</code> has a set of defaults for its parameters that represent consensus decisions by editors. For example, {{para|onlysourced}} defaults to <code>true</code> so only Wikidata values that are sourced to something better than "Wikipedia" will be returned, and {{para|fetchwikidata}} defaults to <code>none</code> so nothing is returned until it is enabled by setting some field names or "ALL". This represents the fail-safe condition and allows infoboxes to be made Wikidata-capable without changing any article until enabled ''for that article''. To simplify the use of <code>getValue</code> in other circumstances, common combinations of parameters can be specified with {{para|parameterset}} or its alias {{para|ps}} for convenience. Two combinations are implemented at present and these are: ;ps=1 : a common set of overrides to get a simple value, linked where possible: <pre> |rank ="best" |fetchwikidata="ALL" |onlysourced ="no" |noicon ="true" </pre> ;ps=2 : a sort of raw value in plain text: <pre> |rank = "best" |fetchwikidata = "ALL" |onlysourced = "no" |noicon = "true" |linked = "no" |plaindate = "true" </pre> Other sets could be created if there is a demand. === Wrapper template === The template {{tl|wdib}} can be used as a convenient wrapper for <code><nowiki>{{#invoke:WikidataIB |getValue}}</nowiki></code>. == Other main functions == === Function getPreferredValue === The getPreferredValue function works exactly like getValue, taking the same parameters, but if any values for a property have the preferred rank set, it will only return those values. This is now deprecated in favour of <code>getValue|rank=best</code>. === Function getCoords === * getCoords can also take a named parameter {{para|qid}} which is the Wikidata ID for an article. This will not normally be used as omitting it defaults to the current article. * The first unnamed parameter, if supplied, will become the returned value and no call to Wikidata will be made. * The coordinates from Wikidata are parsed and passed to [[Template:Coord]] which returns the display as if it were called manually. * The blacklist of fields that are never to be displayed, and the whitelist are implemented in the same way as for getValue using {{para|suppressfields}} and {{para|fetchwikidata}} * The <code>format</code> parameter sets the display format to decimal or dms. Any value beginning with "dec" sets decimal; anything else sets dms. * The <code>display</code> parameter sets the display position to "inline", "title" or "inline, title". Default is nothing (so uses default for {{tl|Coord}}, currently "inline"). === Function getQualifierValue === The getQualifierValue function is for use when we want to fetch the value of a qualifier. We need to know the property and the value of the property that the qualifier relates to. The parameters are: * The property ID passed in the unnamed parameter (or {{para|1}}) * The target value for that property in {{para|pval}} * The qualifier ID for that target value in {{para|qual}} * The same parameters to implement whitelisting and blacklisting of the property as in getValue * Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}} * Optional item ID for arbitrary access in {{para|qid}} * The same parameters to format output as in getValue ==== Example of getQualifierValue ==== In {{Q|Q1513315}} there is a property {{Q|P793}}, which has a value {{Q|Q385378}}. That has two qualifiers, {{Q|P580}} and {{Q|P582}}. To get the start date: * <code><nowiki>{{#invoke:WikidataIB |getQualifierValue |qid=Q1513315 |P793 |pval=Q385378 |qual=P580 |name=xyz |fetchwikidata=ALL }}</nowiki></code> In [[South Pole Telescope]] it returns: * {{#invoke:WikidataIB |getQualifierValue |P793 |pval=Q385378 |qual=P580 |name=xyz |fetchwikidata=ALL |qid=Q1513315}} === Function getValueByQual === The getValueByQual function returns the value of a property which has a qualifier with a given entity value. The parameters are: * The property ID passed in the unnamed parameter (or {{para|1}}) * The property ID for a qualifier (or "ALL" or "DATES") in {{para|qualID}} * The Wikibase-entity ID of a value for that qualifier in {{para|qvalue}} * The same parameters to implement whitelisting and blacklisting of the property as in getValue * Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}} * Optional item ID for arbitrary access in {{para|qid}} * The same parameters to format output as in getValue ==== Example of getValueByQual ==== In {{Q|Q10990}} there is a property {{Q|P443}} that has multiple values, each of which has a qualifier {{Q|P407}}. We can return the property value whose qualifier has the value {{Q|13955}} * <code><nowiki>{{#invoke:WikidataIB |getValueByQual |qid=Q10990 |P443 |qualID=P407 |qvalue=Q13955 |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB |getValueByQual |qid=Q10990 |P443 |qualID=P407 |qvalue=Q13955 |fwd=ALL |osd=no |noicon=true}} === Function getValueByLang === The getValueByLang function returns the value of a property which has a qualifier {{Q|P407}} whose value has the given language code. The parameters are: * The property ID passed in the unnamed parameter (or {{para|1}}) * The {{Q|P424}} to match the language whose code is given by {{para|lang|xx[-yy]}}. If no code is supplied, it uses the default language. * The same parameters to implement whitelisting and blacklisting of the property as in getValue * Optional boolean to specify whether only sourced values of the property are returned (defaults to "no") in {{para|onlysourced}} * Optional item ID for arbitrary access in {{para|qid}} * The same parameters to format output as in getValue ==== Example of getValueByLang ==== In {{Q|Q7565108}} there is a property {{Q|P856}} that has multiple values, each of which has a qualifier {{Q|P407}}. We can return the property value whose {{Q|P407}} qualifier value (a WD item) itself has the {{Q|P424}} property that is "ja", i.e, {{Q|Q5287}} * <code><nowiki>{{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |lang=ja |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |lang=ja |fwd=ALL |osd=no |noicon=true}} If {{para|lang}} is unspecified, we can obtain the same value with the default language (here that is the {{Q|Q1860}} and its {{Q|P424}} is "en") * <code><nowiki>{{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |fwd=ALL |osd=no |noicon=true}}</nowiki></code> → {{#invoke:WikidataIB |getValueByLang |qid=Q7565108 |P856 |fwd=ALL |osd=no |noicon=true}} == Utility functions == === Function getLink === getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= If there is a sitelink to an article on the local Wiki, it returns a link to the article with the Wikidata label as the displayed text. If there is no sitelink, it returns the label as plain text. If there is no label in the local language, it displays the qid instead. : Wikidata: {{q|Q29016906}} and {{q|Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |getLink |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getLink |Q29016906}} * <code><nowiki>{{#invoke:WikidataIB |getLink |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getLink |Q3621491}} === Function getLabel === getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as {{para|qid}} It returns the Wikidata label in the local language for an item by the given qid. If there is no label in the local language, it returns the qid instead. Note that this is the label given to the Wikidata entry in the same language as the current Wiki, if the label exists. : Wikidata: {{q|Q29016906}} and {{q|Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |getLabel |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q29016906}} * <code><nowiki>{{#invoke:WikidataIB |getLabel |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |getLabel |Q19805408}}</nowiki></code> → {{#invoke:WikidataIB |getLabel |Q19805408}} === Function label === label has the qid of a Wikidata entity passed as the first unnamed parameter or as {{para|qid}} It returns the Wikidata label in the local language for an item by the given qid or linked to the current page. If there is no label in the local language, it returns an empty string. Note that this is the label given to the Wikidata entry in the same language as the current Wiki, if the label exists. : Wikidata: {{q|Q29016906}} and {{q|Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |label |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |label |Q29016906}} * <code><nowiki>{{#invoke:WikidataIB |label |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |label |Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |label |Q19805408}}</nowiki></code> → {{#invoke:WikidataIB |label |Q19805408}} === Function getAT === getAT has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid= If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text, i.e. the article title. If there is no sitelink, it returns nothing. Note that this is the title of the article in the current Wikipedia, if the interlanguage link exists in the Wikidata entry. : Wikidata: {{q|Q29016906}} and {{q|Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |getAT |Q29016906}}</nowiki></code> → {{#invoke:WikidataIB |getAT |Q29016906}} * <code><nowiki>{{#invoke:WikidataIB |getAT |Q3621491}}</nowiki></code> → {{#invoke:WikidataIB |getAT |Q3621491}} === Function getDescription === getDescription has the qid of a Wikidata entity passed as |qid= (it defaults to the associated qid of the current article if omitted). It has a local parameter passed as the first unnamed parameter. Any local parameter passed (other than "Wikidata" or "none") becomes the return value. It returns the article description for the Wikidata entity in plain text if the local parameter is "Wikidata". Nothing is returned if the description doesn't exist or "none" is passed as the local parameter. : Wikidata: {{q|Q29016906}} and {{q|Q3621491}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |wikidata}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |wikidata}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |A painting}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |A painting}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q29016906 |none}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q29016906 |none}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |wikidata}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |wikidata}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |A profession}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |A profession}} * <code><nowiki>{{#invoke:WikidataIB |getDescription |qid=Q3621491 |none}}</nowiki></code> → {{#invoke:WikidataIB |getDescription |qid=Q3621491 |none}} === Function formatDate === formatDate accepts a datetime of the usual format from mw.wikibase.entity:formatPropertyValues, like "1 August 30 BCE" as parameter 1 and formats it according to the df (date format) and bc parameters. * <code><nowiki>{{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}}</nowiki></code> → {{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BCE |df=dmy}} * <code><nowiki>{{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BC |df=mdy}}</nowiki></code> → {{#invoke:WikidataIB |formatDate | 1 August 30 BCE |bc=BC |df=mdy}} * df = "dmy" / "mdy" / "y" - default is "dmy" * bc = "BC" / "BCE" - default is "BCE" === Function checkBlacklist === checkBlacklist allows a test to check whether a named field is allowed. It returns true if the field is not blacklisted (i.e. allowed) It returns false if the field is blacklisted (i.e. disallowed) Example: * <code><nowiki>{{#if:{{#invoke:WikidataIB |checkBlacklist |name=nationality |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}</nowiki></code> → {{#if:{{#invoke:WikidataIB |checkBlacklist |name=nationality |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}} * <code><nowiki>{{#if:{{#invoke:WikidataIB |checkBlacklist |name=birth_place |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}}</nowiki></code> → {{#if:{{#invoke:WikidataIB |checkBlacklist |name=birth_place |suppressfields=residence; nationality; citizenship}} | not blacklisted | blacklisted}} === Function emptyor === emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags otherwise it returns the argument unchanged (including leading/trailing space). If the argument could contain "=", then it must be called explicitly: * <code><nowiki>| 1 = whatever-the-argument-is</nowiki></code> In that case, leading and trailing spaces are trimmed. It finds use in infoboxes where it can replace tests like: * <code><nowiki>{{#if: {{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> | }}</nowiki></code> with a form that uses just a single call to Wikidata: * <code><nowiki>{{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}</nowiki></code> === Function labelorid === labelorid is a public function to expose the output of labelOrId(). The Q-number (entity ID) is passed as |qid= or as an unnamed parameter. It returns the Wikidata label for that entity or the qid if no label exists. === Function getQid === * getQid works with the current page and its associated Wikidata entry. * It returns qid, if supplied as the first unnamed parameter or as {{para|qid}}; * failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists; * failing that, the Wikidata entity ID associated with the current page, if it exists; * otherwise, nothing === Function examine === examine provides a dump of the entire property given in the first unnamed parameter (or in {{para|pid}} as a named alias) from the item given by the parameter 'qid', or from the item corresponding to the current page if qid is not supplied. Both parameters may be unnamed and given in any order. It works in a similar manner to the [[Module:Wikidata|Dump]] function, but only loads a single claim, rather than the whole Wikidata entry. * Example: <code><nowiki>{{#invoke:WikidataIB |examine |qid=Q1396889 |P50}}</nowiki></code> There is a [[Template:Examine]] which acts as a wrapper for the call. * Example: <code><nowiki>{{examine |Q4048254 |P31}}</nowiki></code> → {{examine |Q4048254 |P31}} === Function url2 === url2 takes a parameter url= that is a proper url and formats it for use in an infobox. Examples: {{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= http://www.example.com/ }}</nowiki> }}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= http://www.example.com/path/ }}</nowiki> }}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= {{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}</nowiki> }}{{nowiki template demo|prefix=#:|format=inline|output=nowiki+|code=<nowiki>{{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}}</nowiki> }}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{#invoke:WikidataIB |url2 |url= {{url|http://www.example.com/}} }}</nowiki> }} Comparison with output of {{tl|URL}}: {{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | http://www.example.com/ }}</nowiki> }}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | http://www.example.com/path/ }}</nowiki> }}{{nowiki template demo|prefix=#|format=inline|output=nowiki+|code=<nowiki>{{URL | {{wikidata|property|Q23317|P856}} }}</nowiki> }}{{nowiki template demo|prefix=#:|format=inline|output=nowiki+|code=<nowiki>{{wikidata|property|Q23317|P856}}</nowiki>}} ==== See also ==== * {{ml|URL|url}} & {{ml|URL|url2}} == Coding into an infobox == Typically, the getValue call will be invoked in an infobox definition, using appropriate template parameters. One simple implementation is given as an example in [[:Template:Infobox book/Wikidata/Sandbox]]. As an illustration, the 'author' field in the infobox is coded like this: <pre style="line-height:1.2em;"> | label2 = Author{{#if:{{{authors|}}}|s}} | data2 = {{#invoke:WikidataIB |getValue |P50 |name=author |fetchwikidata={{{fetchwikidata|}}} |suppressfields={{{suppressfields|}}} |{{{authors|{{{author|}}}}}} }} </pre> The property to be fetched is the first unnamed parameter. In this case it is {{Q|P50}}. The name of the field is passed in {{para|name}} and that name is checked against the blacklist and the whitelist. To always suppress the author field in a particular article, an editor will set {{para|suppressfields|author}} in the infobox. The author field will then never be displayed. If the field is not blacklisted, then the infobox can be set to display a locally supplied value for author simply by setting {{para|author|[[George Orwell]]}}, for example, in the infobox. It also accepts {{para|authors}}. If the name of the field is on the whitelist, e.g. {{para|fetchwikidata|author; genre; pub_date; pages; dewey; congress}}, ''and'' the local value is not supplied, then the infobox will display the value retrieved from Wikidata. Any separators can be used, except | and {}. As a shorthand, {{para|fetchwikidata|ALL}} will fetch all of the fields that are not blacklisted, as long as no local value is already provided in the article for a given field. Since Wikidata labels are normally lower case, the ucfirst function from [[Module:String2]] can be used to capitalise the first letter of the returned text, e.g. * <code><nowiki>{{#invoke:String2 | ucfirst | {{#invoke:WikidataIB |getValue |P136 |name=genre |fetchwikidata=ALL |onlysourced=false}} }}</nowiki></code> in {{Q|Q1396889}} produces: * {{#invoke:String2 | ucfirst | {{#invoke:WikidataIB |getValue |P136 |name=genre |fetchwikidata=ALL |onlysourced=false |qid=Q1396889}} }} === Example of calls in an infobox === Basic use of getValue: *<code><nowiki>{{#invoke:WikidataIB |getValue |P000 |name=fieldname |qid={{{qid|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|}}} |{{{localparameter|}}} }}</nowiki></code> Full collection of parameters: *<code><nowiki>{{#invoke:WikidataIB |getValue |P000 |name=fieldname |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}} |wdl={{{wikidatalink|}}} |df={{dateformat|}} |bc={{{bc|}}} |prefix= |postfix= |linkprefix= |linkpostfix= |sorted={{{sorted|}}} |sep={{{separator|}}} |list={{listtype|}}} |{{{localparameter|}}} }}</nowiki></code> Any of the parameters can, of course, be fixed for a given field in an infobox, rather than taking the parameter supplied to the infobox, which will affect all fields. For example, one field may set {{para|list|hlist}} where a series of short words is expected; whereas another field could use {{para|list|ubl}} where an unbulleted vertical list of several words on each line is required. === Coordinates === The getCoords call will display the output of [[Template:Coord]] when supplied with the coordinates returned from Wikidata. It can be coded like this: <pre style="line-height:1.2em;"> |label20 = Coordinates | data20 = {{#invoke:WikidataIB |getCoords |name=coordinates |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|}}} |{{{coordinates|}}} }} </pre> An example is [[Template:Infobox biosphere reserve]] <pre style="line-height:1.2em;"> {{Infobox biosphere reserve | fetchwikidata = ALL }} </pre> Displays coordinates in the usual positions when used in an article where Wikidata has coordinates. === Upgrading existing infoboxes === Since the parameter {{para|fetchwikidata}} is needed for any Wikidata functionality, an existing infobox may be replaced by an infobox incorporating these calls without any change whatsoever to any article. Each article using the new infobox can later be enabled by supplying {{para|fetchwikidata|ALL}}, or a list of required fields for that article. At that point, the onus is on the editor enabling the functionality to check that no unwanted fields are now being displayed. If so, they can be added to a blacklist for the article by setting {{para|suppressfields}} to the list of unwanted fields. === Verifiability === Where it will always be essential for a particular field to only contain values that are referenced, use <code>getValue</code>, making sure that {{para|onlysourced}} is ''not'' set to 'false', '0' or 'no'. By default it will exclude values that are unsourced or only sourced to a Wikipedia, thus making the job of checking easier at the article level. If unsourced data is acceptable (!), set {{para|onlysourced|no}}. As it is beyond my wit to produce an automated mechanism that knows whether an existing source is reliable or not in a given context, that job must still be performed at the article level by an editor familiar with the subject. It should always be done when first enabling Wikidata for that article. === Helper templates === ; [[Template:If then show]] : tests whether the first unnamed parameter is not an empty string and returns it if it isn't. Otherwise it returns the second unnamed parameter. Optional third and fourth unnamed parameters provide a prefix and a suffix for the first parameter when returned. Useful when the first parameter is a call to Wikidata. ; [[Template:Ifnoteq then show]] : tests whether the first unnamed parameter is equal to the second unnamed parameter and returns the third unnamed parameter if it does. Otherwise it returns the first unnamed parameter. This is useful when the first parameter is a <code><nowiki>{{#invoke:</nowiki></code> of a Lua module that returns a value for which a specific exception is required. ; [[Template:If then wikilink]] : tests whether the first unnamed parameter is not an empty string and if it isn't, it returns the parameter formatted as piped wiki-link using an optional namespace prefix. ; [[Template:Formatter link]] : takes an external identifier code as {{para|code}} and uses a formatter url as {{para|url}} to construct a link to the external resource, which uses the code as display. ; [[Template:Emptyor]] : tests a piece of text to ascertain whether it's effectively empty or contains some text. If the unnamed parameter consists only of html tags, punctuation (e.g. wiki markup) and whitespace, then Emptyor returns nothing; otherwise it returns the parameter unchanged. Wrapper for p.emptyor function. == Example of use: Infobox book == This section is taken from [[Template:Infobox book/Wikidata/Sandbox/doc]]. === No Wikidata === <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | suppressfields = | fetchwikidata = | name = Animal Farm | title_orig = Animal Farm: A Fairy Story | image = Animal Farm - 1st edition.jpg | image_size = 200px | caption = First edition cover | author = [[George Orwell]] | country = United Kingdom | language = English | genre = Political satire }} </pre> Works as a non-aware infobox: only locally supplied parameters are displayed. <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | name = Animal Farm | title_orig = Animal Farm: A Fairy Story | image = Animal Farm - 1st edition.jpg | image_size = 200px | caption = First edition cover | author = [[George Orwell]] | country = United Kingdom | language = English | genre = Political satire }} </pre> The blacklist and whitelist can be omitted if unused === All Wikidata === <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | fetchwikidata = author; genre; pub_date; pages; dewey; congress }} </pre> Fetches the author, publication date, number of pages, Dewey index, and Library of Congress catalogue number values from Wikidata. <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | fetchwikidata = ALL }} </pre> As shorthand, the {{para|fetchwikidata}} parameter can be set to ALL to fetch all available fields. Any field can be suppressed by naming it in {{para|suppressfields}}, or overridden by supplying a local value. === Never display genre === <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | suppressfields = genre | fetchwikidata = author; genre; pub_date; pages; dewey; congress }} </pre> The genre field will always be suppressed, even if a local value is supplied. <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | suppressfields = genre | fetchwikidata = author; genre; pub_date; pages; dewey; congress | genre = Political satire }} </pre> === Local override === <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | fetchwikidata = author; genre; pub_date; pages; dewey; congress | genre = Political satire }} </pre> The genre field is set to display "Political satire", no matter what is stored in Wikidata. <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | fetchwikidata = ALL | genre = Novel }} </pre> The genre field is set to display "Novel", no matter what is stored in Wikidata. === Don't fetch genre === <pre style="line-height:1.2em;"> {{Infobox book/Wikidata/Sandbox | suppressfields = | fetchwikidata = author; pub_date; pages; dewey; congress }} </pre> The genre field will not be fetched from Wikidata. Only the author, publication date, number of pages, Dewey index, and Library of Congress catalogue number are imported. A local value for genre will display. == Exporting the module == WikidataIB has been developed to run on any language wiki (or Wikimedia project) with a minimum of modification. An optional sub-module [[Module:WikidataIB/i18n]] may be created to replace the values for error messages, ordinal suffixes etc. as shown in the local i18n definitions in the module. Although the same result can be arrived at by directly editing those values in WikidataIB, using the sub-module will allow an updated version of WikidataIB to directly replace the older module without having to re-edit the i18n definitions. === Linked items === If the target Wiki has a convention that certain items are not normally linked (see [[:en:Wikipedia:Manual of Style/Linking #What generally should not be linked]] for an example), then a sub-module [[Module:WikidataIB/nolinks]] can be created to list items that should not be linked, using the English Wikipedia sub-module as an exemplar. === Italic titles === If the target Wiki has a convention that certain works should be italicised or quoted (see [[:en:Wikipedia:Manual of Style/Text formatting #Names and titles]] for an example), then a sub-module [[Module:WikidataIB/titleformats]] can be created to list items that should be italicised or quoted, using the English Wikipedia sub-module as an exemplar. === Complex date === Most of the output from the module will use the local language (or any user-specified one on multi-lingual wikis) where the sitelink or label exists on Wikidata. However, dates are more complicated and not handled perfectly in all languages. To solve this, WikidataIB uses [[Module:Complex date]] – developed on Commons by {{u|Jarekt}} – which allows expansion to support a wider variety of languages. As a result, it is necessary to install Complex date and its dependencies alongside WikidataIB when installing on another Wikimedia project. ==== Complex date dependencies ==== [[Module:Complex_date]] relies on the following modules: * [[Module:ISOdate]] ** [[Module:DateI18n]] (no dependencies) * [[Module:i18n/complex date]] ** [[Module:Ordinal]] (lazy loading) *** [[Module:I18n/ordinal]] (no dependencies) *** [[Module:Yesno]] (from en.wikipedia) (no dependencies) *** [[Module:Formatnum]] (no dependencies) ** [[Module:Roman]] (lazy loading with no dependencies) Unless otherwise noted, the authoritative version of each module can be found on [https://commons.wikimedia.org/ Commons] although the versions on English Wikipedia are usually kept in sync. ==See also== * [[Module:Wikidata]], handling Wikidata more basically * [[Template:WikidataOI]], a template that uses [[Module:Wd]] but also has and "opt-in" options {{para|fetch}} and {{para|ifeq}} similar to this module's {{para|fetchwikidata}} or {{para|fwd}} ==Tracking categories== * {{clc|Articles with missing Wikidata information}} {{Wikidata infoboxes}} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> [[Category:Wikidata modules]] }}</includeonly> oh00ini2qw8wrwntb5h9vf7tfxettq6 မေႃႇၵျူး:WikidataIB/nolinks 828 34218 112367 2025-06-26T08:05:50Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "local p ={} --[[ The values here are the English sitelinks for items that should not be linked. These 36 are not definitive and may be altered to suit. --]] p.items = { "Australia", "Austria", "Belgium", "Canada", "China", "Denmark", "England", "France", "Germany", "Greece", "Hungary", "Iceland", "India", "Republic of Ireland", "Israel", "Italy", "Jamaica", "Japan", "Luxembourg", "Mexico", "Net..." 112367 Scribunto text/plain local p ={} --[[ The values here are the English sitelinks for items that should not be linked. These 36 are not definitive and may be altered to suit. --]] p.items = { "Australia", "Austria", "Belgium", "Canada", "China", "Denmark", "England", "France", "Germany", "Greece", "Hungary", "Iceland", "India", "Republic of Ireland", "Israel", "Italy", "Jamaica", "Japan", "Luxembourg", "Mexico", "Netherlands", "New Zealand", "Northern Ireland", "Norway", "Poland", "Portugal", "Russia", "Scotland", "South Africa", "Spain", "Sweden", "Switzerland", "Turkey", "United Kingdom", "UK", "United States", "USA", "Wales", } --[[ This provides a convenient way to create a test whether an item is on the list. --]] p.itemsindex = {} for i, v in ipairs(p.items) do p.itemsindex[v] = true end return p os706fxg7ivfr0wq2o2z1afni11n93q မေႃႇၵျူး:WikidataIB/titleformats 828 34219 112368 2025-06-26T08:06:20Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "--[[ To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted. This submodule lists the entity-ids used in 'instance of' (P31), which allows a module to identify the values that should be formatted. The table p.formats is indexed by entity-id, and contains the value " or '' --]] local p = {} p.italics = { "Q571", -- book "Q13593966", -- literary trilogy "Q27775..." 112368 Scribunto text/plain --[[ To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted. This submodule lists the entity-ids used in 'instance of' (P31), which allows a module to identify the values that should be formatted. The table p.formats is indexed by entity-id, and contains the value " or '' --]] local p = {} p.italics = { "Q571", -- book "Q13593966", -- literary trilogy "Q277759", -- book series "Q2188189", -- musical work "Q11424", -- film "Q13593818", -- film trilogy "Q24856", -- film series "Q5398426", -- television series "Q482994", -- album "Q169930", -- extended play "Q1760610", -- comic book "Q7889", -- video game "Q7058673", -- video game series "Q25379", -- play "Q2743", -- musical "Q37484", -- epic poem "Q41298", -- magazine } p.quotes = { "Q207628", -- musical composition } p.size = 0 p.formats = {} for i, v in ipairs(p.italics) do p.formats[v] = "''" p.size = p.size + 1 end for i, v in ipairs(p.quotes) do p.formats[v] = '"' p.size = p.size + 1 end return p kf27lmax414v7k61jzza3jomkstxn1m မေႃႇၵျူး:Complex date/doc 828 34220 112370 2025-06-26T08:08:49Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{Module rating|protected}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}} == Usage == This module is intended for processing of date strings. It is used by [[Module:WikidataIB]] ==Complex date== This function is the engine behind [[c:template:Complex date]]. Please see that templat..." 112370 wikitext text/x-wiki {{Module rating|protected}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> {{#ifeq:{{SUBPAGENAME}}|sandbox||{{High-use}}}} == Usage == This module is intended for processing of date strings. It is used by [[Module:WikidataIB]] ==Complex date== This function is the engine behind [[c:template:Complex date]]. Please see that template for full documentation ====Usage:==== :should not be used directly but only through [[c:Template:Other date]] and other templates :<code><nowiki>{{#invoke:Complex_date|complex_date|adj1=|date1=|era1=|precision1=|conj=-|adj2=|date2=|era2=|precision2=|lang=}}</nowiki></code> or :<code><nowiki>{{#invoke:Complex_date|complex_date|1=|2=|3=|era=|lang=}}</nowiki></code> ====Parameters (simple syntax):==== ;1 :option. See [[c:Template:Other date]] ;2 :date #1 ;3 :date #2 ====Parameters (advanced syntax):==== ;conj : in case the link between the two dates: "-" (from-until), between, or, and (see [[c:template:Complex date]]) ;adj1, adj2 : adjectives and prepositions used to describe single date. Possible values: ''early'', ''mid'', ''late'', ''spring, summer, fall, winter, 1st half, 2nd half, 1st quarter, 2nd quarter, 3rd quarter, 4th quarter'', etc. used for describing which part of date1 and date2 are involved (see [[c:template:Complex date]]) ;date1, date2 : the dates involved. Format: Number. ;precision1, precision1 : usually ''year'' or more precise (default), but can also be ''decade'', ''century'' or ''millennium'', then the dates involved are centuries or millennia rather than specific dates ;era1, era2 : the eras that those dates are from (see [[c:template:Complex date]]) If parameter <code>era</code> is present, it overrides these two parameters. The internationalization of the date formats can be found at [[Module:I18n/complex date]] ==Dependencies== [[Module:Complex_date]] relies on the following modules: * [[Module:ISOdate]] ** [[Module:DateI18n]] (no dependencies) * [[Module:i18n/complex date]] ** [[Module:Ordinal-cd]] (lazy loading) *** [[Module:I18n/ordinal]] (no dependencies) *** [[Module:Yesno]] (from en.wikipedia) (no dependencies) *** [[Module:Formatnum]] (no dependencies) ** [[Module:Roman-cd]] (lazy loading with no dependencies) Several of the lazy-loaded dependencies do not exist locally since none of the code that calls them ever ends up used on the English Wikipedia. Unless otherwise noted, the authoritative version of each module can be found on [https://commons.wikimedia.org/ Commons]. ; Commons : [[c:Module:Complex_date]] : [[c:Module:Calendar]] : [[c:Module:ISOdate]] : [[c:Module:DateI18n]] : [[c:Module:i18n/complex date]] : [[c:Module:Ordinal]] : [[c:Module:I18n/ordinal]] : [[c:Module:Formatnum]] : [[c:Module:Roman]] : [[c:Module:Linguistic]] ; English Wikipedia : [[en:Module:Yesno]] <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly> <noinclude> [[Category:Module documentation pages]] </noinclude> tp82tk36n1t2h0jxbeeu2gfdk6tc2hu မေႃႇၵျူး:Ordinal-cd 828 34221 112371 2025-06-26T08:09:26Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "--[[ This template will add the appropriate ordinal suffix to a given integer. Please do not modify this code without applying the changes first at Module:Ordinal/sandbox and testing at Module:Ordinal/sandbox/testcases and Module talk:Ordinal/sandbox/testcases. Authors and maintainers: * User:RP88 ]] -- ======================================= -- === Dependencies ====================== -- ===============..." 112371 Scribunto text/plain --[[ This template will add the appropriate ordinal suffix to a given integer. Please do not modify this code without applying the changes first at Module:Ordinal/sandbox and testing at Module:Ordinal/sandbox/testcases and Module talk:Ordinal/sandbox/testcases. Authors and maintainers: * User:RP88 ]] -- ======================================= -- === Dependencies ====================== -- ======================================= local i18n = require('Module:I18n/ordinal') -- get localized translations of ordinals local LangSwitch = require('Module:LangSwitch') -- get LangSwitch function local yesno = require('Module:Yesno') -- boolean value interpretation local formatnum = require('Module:Formatnum') -- number formatting -- ======================================= -- === Private Functions ================= -- ======================================= --[[ Helper function to generate superscripted content ]] local function Superscript( str, superscript, nosup, period ) if superscript and (not nosup) and (str ~= '') then return period .. '<sup>' .. str .. '</sup>' else return str end end --[[ Helper function to call Formatnum. ]] local function FormatNum( value, lang ) if lang == 'roman' then return require("Module:Roman-cd")._Numeral(value) else return formatnum.formatNum(value, lang) end end --[[ Helper function to add append a category to a message. ]] local function output_cat( message, category ) return message .. '[[Category:' .. category .. ']]' end --[[ Helper function to handle error messages. ]] local function output_error( error_str, value ) error_str = '<strong class="error"><span title="Error: ' .. error_str .. '">' .. value .. '</span></strong>' return output_cat(error_str, 'Errors reported by Module Ordinal'); end --[[ This function is the core functionality for adding the appropriate ordinal suffix to a given integer. ]] local function OrdinalCore( value, lang, style, gender, nosup ) -- Just in case someone breaks the internationalization code, fix the english scheme if i18n.SchemeFromLang['en'] == nil then i18n.SchemeFromLang['en'] = 'en-scheme' end if i18n.Scheme['en-scheme'] == nil then i18n.Scheme['en-scheme'] = {rules = 'skip-tens', superscript = true, suffix = 'th', suffix_1 = 'st', suffix_2 = 'nd', suffix_3 = 'rd'} end -- Add the default scheme (i.e. "<value>.") if i18n.SchemeFromLang['default'] == nil then i18n.SchemeFromLang['default'] = 'period-scheme' end if i18n.Scheme['period-scheme'] == nil then i18n.Scheme['period-scheme'] = {rules = 'suffix', suffix = '.'} end -- which scheme should we use to format the ordinal value? -- Use Fallback module to handle languages groups that map to a supported language local schemeSpecifier = LangSwitch._langSwitch(i18n.SchemeFromLang, lang) -- Look up scheme based on scheme specifier (and possibly style) local scheme = i18n.Scheme[schemeSpecifier .. '/' .. style] or i18n.Scheme[schemeSpecifier] -- process scheme by applying rules identified by Scheme local output = '' local period = (scheme.period and '.') or '' local rules = scheme.rules if rules == 'skip-tens' then local suffix local mod100 = math.floor(math.abs(value)) % 100 if (mod100 >= 10) and (mod100 <= 19) then suffix = scheme.suffix or '' else local mod10 = math.floor(math.abs(value)) % 10 suffix = scheme['suffix_'..mod10] or scheme.suffix or '' end output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'suffix' then output = FormatNum(value, scheme.formatlang or lang) .. Superscript( scheme.suffix or '', scheme.superscript, nosup, period) elseif rules == 'prefix' then output = (scheme.prefix or '') .. FormatNum(value, scheme.formatlang or lang) elseif rules == 'mod10-suffix' then local index = math.floor(math.abs(value)) % 10 local suffix = scheme['suffix_'..index] or scheme.suffix or '' output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'gendered-suffix' then local suffix = scheme['suffix_'..gender] or scheme.suffix or '' output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'gendered-suffix-one' then local suffix if value == 1 then suffix = scheme['suffix_1_'..gender] or scheme['suffix_1'] or scheme.suffix or '' else suffix = scheme['suffix_'..gender] or scheme.suffix or '' end output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'gendered-suffix-n' then local suffix if value <= 9 then suffix = scheme['suffix_'..value..'_'..gender] or scheme['suffix_'..value] or scheme['suffix_'..gender] or scheme.suffix or '' else suffix = scheme['suffix_'..gender] or scheme.suffix or '' end output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'suffix-one' then local prefix, suffix if value == 1 then prefix = scheme['prefix_1'] or scheme.prefix or '' suffix = scheme['suffix_1'] or scheme.suffix or '' else prefix = scheme.prefix or '' suffix = scheme.suffix or '' end output = prefix .. FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'mod10-gendered-suffix-skip-tens' then local suffix local mod100 = math.floor(math.abs(value)) % 100 if (mod100 >= 10) and (mod100 <= 19) then suffix = scheme['suffix_'..gender] or scheme.suffix or '' else local mod10 = math.floor(math.abs(value)) % 10 suffix = scheme['suffix_'..mod10..'_'..gender] or scheme['suffix_'..mod10] or scheme['suffix_'..gender] or scheme.suffix or '' end output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) elseif rules == 'uk-rules' then local suffix local mod100 = math.floor(math.abs(value)) % 100 local mod1000 = math.floor(math.abs(value)) % 1000 if (mod1000 == 0) then suffix = scheme['suffix_1000_'..gender] or scheme.suffix or '' elseif (mod100 == 40) then suffix = scheme['suffix_40_'..gender] or scheme.suffix or '' elseif (mod100 >= 10) and (mod100 <= 19) then suffix = scheme['suffix_'..gender] or scheme.suffix or '' else local mod10 = math.floor(math.abs(value)) % 10 suffix = scheme['suffix_'..mod10..'_'..gender] or scheme['suffix_'..mod10] or scheme['suffix_'..gender] or scheme.suffix or '' end output = FormatNum(value, scheme.formatlang or lang) .. Superscript( suffix, scheme.superscript, nosup, period) else output = FormatNum(value, lang) end return output end -- ======================================= -- === Public Functions ================== -- ======================================= local p = {} --[[ Ordinal This function converts an integer value into a numeral followed by ordinal indicator. The output string might contain HTML tags unless you set nosup=y. Usage: {{#invoke:Ordinal|Ordinal|1=|lang=|style=|gender=|nosup=|debug=}} {{#invoke:Ordinal|Ordinal}} - uses the caller's parameters Parameters 1: Positive integer number. lang: language style: Presentation style. Different options for different languages. In English there is "style=d" adding -d suffixes to all numbers. gender: Gender is used in French and Polish language versions. Genders: m for male, f for female and n for neuter. nosup: Set nosup=y to display the ordinals without superscript. debug: Set debug=y to output error messages. Error Handling: Unless debug=y, any error results in parameter 1 being echoed to the output. This reproduces the behavior of the original Ordinal template. ]] function p.Ordinal( frame ) -- if no argument provided than check parent template/module args local args = frame.args if args[1]==nil then args = frame:getParent().args end -- if we don't have a specified language, attempt to use the user's language local lang = args.lang if not lang or lang == '' or not mw.language.isValidCode( lang ) then lang = frame:preprocess('{{int:lang}}') end local nosup = yesno(args["nosup"] or '', false) -- nosup can be true or false local debugging = yesno(args["debug"], false) -- debugging can be nil, true, or false -- also enable debugging if debug is unspecified, and "nosup" is false debugging = debugging or ((debugging == nil) and not nosup) local output = p._Ordinal( args[1], -- positive integer number lang, -- language args["style"], -- allows to set presentation style args["gender"], -- allows to specify gender (m, f, or n) nosup, -- set nosup to "y" to suppress superscripts debugging -- Set debug=y to output error messages ) -- Add maintenance category if (i18n.SchemeFromLang[lang] == nil) and debugging then output = output_cat(output, 'Pages with calls to Module Ordinal using an unsupported language') end return output end --[[ This function will add the appropriate ordinal suffix to a given integer. Parameters input: Numeral as a positive integer or string. lang: Language code as a string (e.g. 'en', 'de', etc.). style: Presentation style as a string (e.g. 'd', 'roman', etc.). gender: Gender as a string ('m', 'f', 'n'). Use empty string '' to leave gender unspecified. nosup: Boolean, set to true to force the ordinals to display without superscript. debug: Boolean, set to true to output error messages. Error Handling: Unless debug is true, any error results in value being echoed to the output. ]] function p._Ordinal( input, lang, style, gender, nosup, debugging ) local output = input if input then local value = tonumber(input) if value and (value > 0) then -- Normalize style, the style 'roman year' is an alias for 'roman' style = string.lower(style or '') if style == 'roman year' then style = 'roman' end -- Normalize gender parameter gender = string.lower(gender or '') if (gender ~= 'm') and (gender ~= 'f') and (gender ~= 'n') then gender = '' end -- if no language is specified, default to english (caller might want to get user's language) if not lang or lang == '' then lang = 'en'; end output = OrdinalCore( value, lang, style, gender, nosup ) else if debugging then output = output_error( "not a number", input ) end end else if debugging then output = output_error( "not a number", '' ) end end return output end return p q4twjajzqvscij2t5rgdx103o1l8hxl မေႃႇၵျူး:Ordinal-cd/doc 828 34222 112372 2025-06-26T08:09:46Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{soft redirect|commons:Module:ordinal/doc}}" 112372 wikitext text/x-wiki {{soft redirect|commons:Module:ordinal/doc}} iizzvfk9veh6j63b4xklvqj0zoutnc8 မေႃႇၵျူး:I18n/ordinal 828 34223 112373 2025-06-26T08:10:21Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "local p = {} --[[ Different languages use different schemes for ordinals, and some of these schemes are shared between languages. "SchemeFromLang" picks an ordinal scheme based on a specified language. All unlisted languages default to the "period-scheme", i.e. "104." is the ordinal for the value "104". Languages will follow the regular language fallback chain. For example, "de-formal" would fallback to scheme f..." 112373 Scribunto text/plain local p = {} --[[ Different languages use different schemes for ordinals, and some of these schemes are shared between languages. "SchemeFromLang" picks an ordinal scheme based on a specified language. All unlisted languages default to the "period-scheme", i.e. "104." is the ordinal for the value "104". Languages will follow the regular language fallback chain. For example, "de-formal" would fallback to scheme for "de", and only if that does not exist would the "period-scheme" be used. ]] p.SchemeFromLang = { ['ast'] = 'ast-scheme', -- Asturian ['bn'] = 'bn-scheme', -- Bengali ['br'] = 'br-scheme', -- Breton ['cs'] = 'period-scheme', -- Czech ['da'] = 'period-scheme', -- Danish ['de'] = 'period-scheme', -- German ['el'] = 'el-scheme', -- Greek ['en'] = 'en-scheme', -- English ['eo'] = 'eo-scheme', -- Esperanto ['es'] = 'es-scheme', -- Spanish ['et'] = 'period-scheme', -- Estonian ['fa'] = 'fa-scheme', -- Persian ['fi'] = 'period-scheme', -- Finnish ['fr'] = 'fr-scheme', -- French ['hr'] = 'period-scheme', -- Croatian ['hu'] = 'period-scheme', -- Hungarian ['hy'] = 'hy-scheme', -- Armenian ['ia'] = 'ia-scheme', -- Interlingua ['it'] = 'romance-scheme', -- Italian ['ja'] = 'ja-scheme', -- Japanese ['km'] = 'km-scheme', -- Khmer ['ko'] = 'ko-scheme', -- Korean ['la'] = 'la-scheme', -- Latin ['lo'] = 'lo-scheme', -- Laothian ['mk'] = 'mk-scheme', -- Macedonian ['ml'] = 'ml-scheme', -- Malayalam ['ms'] = 'ms-scheme', -- Malay ['nds'] = 'period-scheme', -- Low German ['nl'] = 'nl-scheme', -- Dutch ['no'] = 'no-scheme', -- Norwegian ['pl'] = 'pl-scheme', -- Polish ['pt'] = 'romance-scheme', -- Portuguese ['ru'] = 'ru-scheme', -- Russian ['sk'] = 'period-scheme', -- Slovak ['sl'] = 'period-scheme', -- Slovene ['sv'] = 'sv-scheme', -- Swedish ['th'] = 'th-scheme', -- Thai ['zh'] = 'zh-scheme', -- Chinese } --[[ Text used to internationalize the various schemes. Styles are supported by suffixing "/style" to key. Styles that are superscripted set "superscript" to true. Scheme set was developed to match the output of the pre-Lua {{Ordinal}} template, preserved as {{Ordinal/old}} ]] p.Scheme = { -- the null scheme, i.e. just the number ['null-scheme'] = { }, -- the period scheme, i.e. "<value>." used for at least: cs, de, fi, hu ['period-scheme'] = { rules = 'suffix', suffix = '.' }, -- the English scheme, i.e. "1st", "2nd", "3rd", "4th". ['en-scheme'] = { rules = 'skip-tens', superscript = true, suffix = 'th', suffix_1 = 'st', suffix_2 = 'nd', suffix_3 = 'rd', }, -- the English scheme using the "d" style, i.e. "23d". ['en-scheme/d'] = { rules = 'suffix', suffix = 'd' }, -- Asturian ['ast-scheme'] = { rules = 'gendered-suffix', superscript = true, period = false, suffix = 'u', suffix_m = 'u', suffix_f = 'a', suffix_n = 'o', }, -- Bengali ['bn-scheme'] = { rules = 'mod10-suffix', superscript = true, suffix_0 = 'ম', suffix_1 = 'ম', suffix_2 = 'য়', suffix_3 = 'য়', suffix_4 = 'র্থ়', suffix_5 = 'ম', suffix_6 = 'ষ্ঠ', suffix_7 = 'ম', suffix_8 = 'ম', suffix_9 = 'ম', }, -- Breton ['br-scheme'] = { rules = 'suffix', suffix = '-vet', formatlang = 'eo' -- pre-Lua {{Ordinal}} template used "eo" number formatting for "br" ordinals }, -- Greek -- not exact. see distinct declentions in: wiktionary:Category:Greek ordinal numbers ['el-scheme'] = { rules = 'gendered-suffix', suffix = 'ος', suffix_m = 'ος', suffix_f = 'η', suffix_n = 'ο', }, -- Esperanto ['eo-scheme'] = { rules = 'suffix', suffix = '-a', }, -- Romance (Italian, Portuguese) ['romance-scheme'] = { rules = 'gendered-suffix', superscript = true, period = false, suffix = 'o', suffix_m = 'o', suffix_f = 'a', suffix_n = 'o', }, -- Spanish ['es-scheme'] = { rules = 'gendered-suffix', superscript = true, period = true, suffix = 'o', suffix_m = 'o', suffix_f = 'a', suffix_n = 'o', }, -- Persian ['fa-scheme'] = { rules = 'suffix', suffix = 'م', }, -- French ['fr-scheme'] = { rules = 'gendered-suffix-one', superscript = true, suffix = 'e', suffix_1 = 'e', suffix_1_m = 'er', suffix_1_f = 're', suffix_1_n = 'e', }, -- the French scheme using the "roman" style ("roman year" is a supported alias for "roman") ['fr-scheme/roman'] = { rules = 'gendered-suffix-one', superscript = true, suffix = 'e', suffix_1 = 'e', suffix_1_m = 'er', suffix_1_f = 're', suffix_1_n = 'е', formatlang = 'roman' }, -- Armenian ['hy-scheme'] = { rules = 'suffix-one', suffix = '-րդ', suffix_1 = '-ին', }, -- Interlingua ['ia-scheme'] = { rules = 'mod10-suffix', superscript = true, suffix_0 = 'te', suffix_1 = 'me', suffix_2 = 'nde', suffix_3 = 'tie', suffix_4 = 'te', suffix_5 = 'te', suffix_6 = 'te', suffix_7 = 'me', suffix_8 = 've', suffix_9 = 'ne', }, -- Khmer ['km-scheme'] = { rules = 'prefix', prefix = 'ទ', }, -- Japanese -- this is for the adjective in undetermined order before noun; otherwise Japanese use: <cardinal number><noun>目 ['ja-scheme'] = { rules = 'prefix', prefix = '第', }, -- Latin ['la-scheme'] = { rules = 'suffix', superscript = true, suffix = 'o', formatlang = 'roman' }, -- Laothian ['lo-scheme'] = { rules = 'prefix', prefix = 'ທີ່', }, -- Korean ['ko-scheme'] = { rules = 'suffix', suffix = '째', }, -- Macedonian ['mk-scheme'] = { rules = 'mod10-suffix', suffix_0 = '-тиот', suffix_1 = '-виот', suffix_2 = '-риот', suffix_3 = '-иот', suffix_4 = '-иот', suffix_5 = '-тиот', suffix_6 = '-иот', suffix_7 = '-миот', suffix_8 = '-миот', suffix_9 = '-тиот', }, -- Malayalam ['ml-scheme'] = { rules = 'suffix', suffix = '-മത്തെ', }, -- Malay ['ms-scheme'] = { rules = 'prefix', prefix = 'ke-', }, -- Dutch ['nl-scheme'] = { rules = 'suffix', suffix = 'e', }, --Norwegian ['no-scheme'] = { rules = 'skip-tens', superscript = true, suffix = 'de', suffix_1 = 'ste', suffix_2 = 'dre', suffix_3 = 'dje', suffix_5 = 'te', suffix_6 = 'te', }, -- Polish ['pl-scheme'] = { rules = 'mod10-gendered-suffix-skip-tens', suffix = '-ty', suffix_f = '-ta', suffix_n = '-te', suffix_1 = '-szy', suffix_1_f = '-sza', suffix_1_n = '-sze', suffix_2 = '-gi', suffix_2_f = '-ga', suffix_2_n = '-gie', suffix_3 = '-ci', suffix_3_f = '-cia', suffix_3_n = '-cie', suffix_7 = '-my', suffix_7_f = '-ma', suffix_7_n = '-me', suffix_8 = '-my', suffix_8_f = '-ma', suffix_8_n = '-me', }, -- Russian ['ru-scheme'] = { rules = 'gendered-suffix', suffix = '-й', suffix_m = '-й', suffix_f = '-я', suffix_n = '-е', }, -- Swedish ['sv-scheme'] = { rules = 'skip-tens', suffix = ':e', suffix_1 = ':a', suffix_2 = ':a', }, ['th-scheme'] = { rules = 'prefix', prefix = 'ที่', }, ['zh-scheme'] = { rules = 'prefix', prefix = '第', }, } return p sxt20lf44aj0tliggsmgmexdttgulyn မေႃႇၵျူး:I18n/ordinal/doc 828 34224 112374 2025-06-26T08:10:42Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "This module is indirectly used by [[Module:I18n/complex date]] which in turn is indirectly used by [[Module:WikidataIB]] see [[Special:Permalink/918862640|this discussion]] for more information. <includeonly>{{Sandbox other|| <!-- Categories below this line, please --> }}</includeonly><noinclude> [[Category:Module documentation pages]] </noinclude>" 112374 wikitext text/x-wiki This module is indirectly used by [[Module:I18n/complex date]] which in turn is indirectly used by [[Module:WikidataIB]] see [[Special:Permalink/918862640|this discussion]] for more information. <includeonly>{{Sandbox other|| <!-- Categories below this line, please --> }}</includeonly><noinclude> [[Category:Module documentation pages]] </noinclude> 0qegn12z42q14xvpcik659klqvm3m9f မေႃႇၵျူး:Formatnum 828 34225 112375 2025-06-26T08:11:01Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "-- This module is intended to replace the functionality of Template:Formatnum and related templates. local p = {} function p.main(frame) local args = frame:getParent().args local prec = args.prec or '' local sep = args.sep or '' local number = args[1] or args.number or '' local lang = args[2] or args.lang or '' -- validate the language parameter within MediaWiki's caller frame..." 112375 Scribunto text/plain -- This module is intended to replace the functionality of Template:Formatnum and related templates. local p = {} function p.main(frame) local args = frame:getParent().args local prec = args.prec or '' local sep = args.sep or '' local number = args[1] or args.number or '' local lang = args[2] or args.lang or '' -- validate the language parameter within MediaWiki's caller frame if lang == "arabic-indic" then -- only for back-compatibility ("arabic-indic" is not a SupportedLanguage) lang = "fa" -- better support than "ks" elseif lang == '' or not mw.language.isSupportedLanguage(lang) then -- Note that 'SupportedLanguages' are not necessarily 'BuiltinValidCodes', and so they are not necessarily -- 'KnownLanguages' (with a language name defined at least in the default localisation of the local wiki). -- But they all are ValidLanguageCodes (suitable as Wiki subpages or identifiers: no slash, colon, HTML tags, or entities) -- In addition, they do not contain any capital letter in order to be unique in page titles (restriction inexistant in BCP47), -- but they may violate the standard format of BCP47 language tags for specific needs in MediaWiki. -- Empty/unspecified and unsupported languages are treated here in Commons using the user's language, -- instead of the local 'ContentLanguage' of the Wiki. lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language end return p.formatNum(number, lang, prec, sep ~= '') end local digit = { -- substitution of decimal digits for languages not supported by mw.language:formatNum() in core Lua libraries for MediaWiki ["ml-old"] = { '൦', '൧', '൨', '൩', '൪', '൫', '൬', '൭', '൮', '൯' }, ["mn"] = { '᠐', '᠑', '᠒', '᠓', '᠔', '᠕', '᠖', '᠗', '᠘', '᠙'}, ["ta"] = { '௦', '௧', '௨', '௩', '௪', '௫', '௬', '௭', '௮', '௯'}, ["te"] = { '౦', '౧', '౨', '౩', '౪', '౫', '౬', '౭', '౮', '౯'}, ["th"] = { '๐', '๑', '๒', '๓', '๔', '๕', '๖', '๗', '๘', '๙'} } function p.formatNum(number, lang, prec, compact) -- Do not alter the specified value when it is not a valid number, return it as is local value = tonumber(number) if value == nil then return number end -- Basic ASCII-only formatting (without paddings) number = tostring(value) -- Check the presence of an exponent (incorrectly managed in mw.language:FormatNum() and even forgotten due to an internal bug, e.g. in Hindi) local exponent local pos = string.find(number, '[Ee]') if pos ~= nil then exponent = string.sub(number, pos + 1, string.len(number)) number = string.sub(number, 1, pos - 1) else exponent = '' end -- Check the minimum precision requested prec = tonumber(prec) -- nil if not specified as a true number if prec ~= nil then prec = math.floor(prec) if prec < 0 then prec = nil -- discard an incorrect precision (not a positive integer) elseif prec > 14 then prec = 14 -- maximum precision supported by tostring(number) end end -- Preprocess the minimum precision in the ASCII string local dot if (prec or 0) > 0 then pos = string.find(number, '.', 1, true) -- plain search, no regexp if pos ~= nil then prec = pos + prec - string.len(number) -- effective number of trailing decimals to add or remove dot = '' -- already present else dot = '.' -- must be added end else dot = '' -- don't add dot prec = 0 -- don't alter the precision end if lang ~= nil and mw.language.isKnownLanguageTag(lang) == true then -- Convert number to localized digits, decimal separator, and group separators local language = mw.getLanguage(lang) if compact then number = language:formatNum(tonumber(number), { noCommafy = 'y' }) -- caveat: can load localized resources for up to 20 languages else number = language:formatNum(tonumber(number)) -- caveat: can load localized resources for up to 20 languages end -- Postprocessing the precision if prec > 0 then local zero = language:formatNum(0) number = number .. dot .. mw.ustring.rep(zero, prec) elseif prec < 0 then -- TODO: rounding of last decimal; here only truncate decimals in excess number = mw.ustring.sub(number, 1, mw.ustring.len(number) + prec) end -- Append the localized base-10 exponent without grouping separators (there's no reliable way to detect a localized leading symbol 'E') if exponent ~= '' then number = number .. 'E' .. language:formatNum(tonumber(exponent),{noCommafy=true}) end else -- not localized, ASCII only -- Postprocessing the precision if prec > 0 then number = number .. dot .. mw.string.rep('0', prec) elseif prec < 0 then -- TODO: rounding of last decimal; here only truncate decimals in excess number = mw.string.sub(number, 1, mw.string.len(number) + prec) end -- Append the base-10 exponent if exponent ~= '' then number = number .. 'E' .. exponent end end -- Special cases for substitution of ASCII digits (missing support in Lua core libraries for some languages) if digit[lang] then for i, v in ipairs(digit[lang]) do number = mw.ustring.gsub(number, tostring(i - 1), v) end end return number end return p ea5lmau3n3g443z268nz79espe8b4sj မေႃႇၵျူး:Formatnum/doc 828 34226 112376 2025-06-26T08:11:25Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "This module provides a number formatting function. This function can be used from #invoke or from other Lua modules. This module is used by [[Module:Complex date]] == Use from other Lua modules == To use the module from normal wiki pages, no special preparation is needed. If you are using the module from another Lua module, first you need to load it, like this: <syntaxhighlight lang="lua"> local mf = require('Mod..." 112376 wikitext text/x-wiki This module provides a number formatting function. This function can be used from #invoke or from other Lua modules. This module is used by [[Module:Complex date]] == Use from other Lua modules == To use the module from normal wiki pages, no special preparation is needed. If you are using the module from another Lua module, first you need to load it, like this: <syntaxhighlight lang="lua"> local mf = require('Module:Formatnum') </syntaxhighlight> (The <code>mf</code> variable stands for '''M'''odule '''F'''ormatnum; you can choose something more descriptive if you prefer.) Most functions in the module have a version for Lua and a version for #invoke. It is possible to use the #invoke functions from other Lua modules, but using the Lua functions has the advantage that you do not need to access a Lua [[mw:Extension:Scribunto/Lua reference manual#Frame object|frame object]]. Lua functions are preceded by <code>_</code>, whereas #invoke functions are not. == main == &#123;{#invoke:Formatnum|main|''x''|''lang=''|''prec=''|''sep=''}} <syntaxhighlight lang="lua"> mf.formatNum(x, lang, prec, sep) </syntaxhighlight> ==See also== {{Math templates}} <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | <!-- Categories below this line, please; interwikis at Wikidata --> }}</includeonly><noinclude> [[Category:Module documentation pages]] </noinclude> 0ml2eayajpjs3i3zouqtm30yjdtx2qs ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း Bonaire, Sint Eustatius and Saba 10 34227 112380 2025-06-26T08:14:08Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 112380 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] hjqucubhtan74awfbcu55o66bj09r50 ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း BES 10 34228 112381 2025-06-26T08:14:09Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 112381 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] hjqucubhtan74awfbcu55o66bj09r50 ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း Caribbean Netherlands 10 34229 112382 2025-06-26T08:14:22Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] 112382 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၶႃႇရိပ်ႈပီယႅၼ် ၼႄႇတႃႇလႅၼ်ႇ]] hjqucubhtan74awfbcu55o66bj09r50 ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၵႂႃးတီႇလုပ်ႈ 10 34230 112383 2025-06-26T09:12:14Z Saimawnkham 5 ၵေႃႇသၢင်ႈၼႃႈလိၵ်ႈဝႆႉ တင်း "{{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၵႂႃးတီႇလုပ်ႈ | flag alias = Flag of France.svg | flag alias-local = Flag of Guadeloupe (local).svg | flag alias-local2 = Flag of Guadeloupe (local) variant.svg | flag alias-football = Flag of Guadeloupe (local).svg | flag alias-beach soccer = Flag of Guadeloupe (local).svg | flag alias-futsal = Flag of Guadeloupe (local).svg | flag..." 112383 wikitext text/x-wiki {{ {{{1<noinclude>|country showdata</noinclude>}}} | alias = ၵႂႃးတီႇလုပ်ႈ | flag alias = Flag of France.svg | flag alias-local = Flag of Guadeloupe (local).svg | flag alias-local2 = Flag of Guadeloupe (local) variant.svg | flag alias-football = Flag of Guadeloupe (local).svg | flag alias-beach soccer = Flag of Guadeloupe (local).svg | flag alias-futsal = Flag of Guadeloupe (local).svg | flag alias-government = Flag of Guadeloupe (Local).svg | flag alias-french = Flag of France.svg | size = {{{size|}}} | name = {{{name|}}} | altlink = {{{altlink|}}} | altvar = {{{altvar|}}} | variant = {{{variant|}}} <noinclude> | var1 = local | var2 = local2 | var3 = french | redir1 = GLP </noinclude> }} 49yq7enm9q95l60x08ogysi9y8i5wl3 ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း Guadeloupe 10 34231 112384 2025-06-26T09:12:33Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၵႂႃးတီႇလုပ်ႈ]] 112384 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၵႂႃးတီႇလုပ်ႈ]] tf1gx3c7js59gm5sgoxxmaid0qvm3f6 ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း GLP 10 34232 112385 2025-06-26T09:12:39Z Saimawnkham 5 Redirected page to [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၵႂႃးတီႇလုပ်ႈ]] 112385 wikitext text/x-wiki #REDIRECT [[ထႅမ်းပလဵတ်ႉ:သဵၼ်ႈမၢႆ မိူင်း ၵႂႃးတီႇလုပ်ႈ]] tf1gx3c7js59gm5sgoxxmaid0qvm3f6