Wikipedia
gvwiki
https://gv.wikipedia.org/wiki/Ard-ghuillag
MediaWiki 1.47.0-wmf.24
first-letter
Meanyn
Er lheh
Resooney
Ymmydeyr
Resooney ymmydeyr
Wikipedia
Resooney Wikipedia
Coadan
Resooney coadan
MediaWiki
Resooney MediaWiki
Clowan
Resooney clowan
Cooney
Resooney cooney
Ronney
Resooney ronney
TimedText
TimedText talk
Module
Module talk
Event
Event talk
Ny h-Emmiraidyn Arabagh Unnaneysit
0
1890
394766
358534
2026-10-19T02:18:05Z
MacTire02
219
++
394766
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Ny h-Emmiraidyn Arabagh Unnaneysit
|ennym_foddey_cadjincliaghtagh= {{lang|ar|الإِمَارَات العَرَبِيَّة المُتَّحِدة}} {{small|([[Arabish]])}}<br/>{{small|{{transliteration|ar|al-Imārāt al-‘Arabīyah al-Muttaḥidah}}}}
|ennym_gienneydagh = ny h-Emmiraidyn Arabagh Unnaneysit
|jalloo_brattagh = Flag of the United Arab Emirates.svg
|jalloo_cleinney = Coat of arms of the United Arab Emirates.svg
|sorçh_cowrey = Cowrey
|jalloo_caslys = United_Arab_Emirates_(orthographic_projection).svg
|jarroo-raa =
|arrane_ashoonagh = {{lang|ar|[[Ishi Biladi|عيشي بلادي]]}}
|tessen-lettyraghey_arrane_ashoonagh={{transliteration|ar|Īshī Bilādī}}
|çhyndaa_arrane_ashoonagh = Dy Veayn My Heer
|coadan_arrane_ashoonagh = UAE national anthem.ogg
|çhengey_arrane_ashoonagh = Arabish
|çhengaghyn_oikoil = [[Arabish Chadjinit Noa-emshiragh|Arabish]]<ref>{{cite web |title=Fact sheet |url=https://u.ae/en/about-the-uae/fact-sheet |website=United Arab Emirates |publisher=U.ae |access-date=31 Luanistyn 2020 |archive-date=18 Mee Houney 2023 |archive-url=https://web.archive.org/web/20231118101755/https://u.ae/en/about-the-uae/fact-sheet |url-status=live }}</ref>
|çhengaghyn_ardjynagh = {{hlist|[[Arabish Emmiraidagh]]|[[Baarle]]{{efn|She Baarle y çhengey smoo loayrit 'syn EAU.<ref name="Siemund">{{cite journal |last1=Siemund |first1=Peter |last2=Al-Issa |first2=Ahmad |last3=Leimgruber |first3=Jakob R. E. |title=Multilingualism and the role of English in the United Arab Emirates |journal=World Englishes |date=June 2021 |volume=40 |issue=2 |pages=191–204 |doi=10.1111/weng.12507 |s2cid=219903631 |language=en |issn=0883-2919|doi-access=free }}</ref><ref name="visitdubai">{{cite web |title=What Languages are Spoken in Dubai? {{!}} Visit Dubai |url=https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |website=www.visitdubai.com |publisher=Rheynn Tarmaynys as Turrysid Dubai |access-date=15 Boaldyn 2023 |language=en |archive-date=15 Jerrey Geuree 2022 |archive-url=https://web.archive.org/web/20220115224604/https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |url-status=live }}</ref>}}}}
|craueeaght = {{tree list}}
* 74.5% [[Yn Islam ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam]] ([[craueeaght steat|oikoil]])
** 63.3% [[Yn Islam Sunni]]
** 6.7% [[Yn Islam Shia ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam Shia]]
* 12.9% [[Yn Chreestiaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Chreestiaght]]
* 6.2% [[Yn Hindughys ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Hindughys]]
* 3.2% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Buddhaghys]]
* 1.3% [[Meechraueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|meechraueeaght]]
* 1.9% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|elley]]
{{tree list/end}}
|blein_craueeaght = 2020
|possanyn_kynneeagh =
|preeu-valley = [[Abu Dhabi]]
|latd=41 |latm=43 |latNS=N |longd=44 |longm=47 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = [[Dubai]]
|sorçh_reiltys = [[Monarkaght lieh-vunraghtoil]] reihdagh [[lieh-eaghtyraneagh]] chonastagh<ref>{{cite book|last=Stewart|first=Dona J.|title=The Middle East Today: Political, Geographical and Cultural Perspectives|publisher=Routledge|date=2013|location=Lunnin as York Noa|isbn=978-0-415-78243-2|page=155}}</ref><ref>{{cite book|last=Day|first=Alan John|title=Political Parties of The World|publisher=Stockton|date=1996|isbn=1-56159-144-0|page=599}}</ref><ref>{{cite web|url=https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|title=United Arab Emirates Constitution|work=UAE Ministry of Justice|access-date=10 Jerrey Fouyir 2018|archive-date=11 Jerrey Fouyir 2018|archive-url=https://web.archive.org/web/20181011053637/https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|url-status=live}}</ref>
|blein_LTS_CCK = 2007
|LTS_CCK = $190.2 billoon
|LTS_CCK_yn_dooinney = $37,300
|sorçh_kiondeeaght = [[Shennaghys ny h-Emmiraidyn Arabagh Unnaneysit~Bunneeaght]]
|taghyrt_bunneeaght1 = [[Coadanys Goaldagh]] myr ayrn jeh ny [[Ny Steatyn Coardailagh~Steatyn Coardailagh]]
|date_bunneeaght1 = 1820 as 1892
|taghyrt_bunneeaght2 = [[Bunneeaght ny h-Emmiraidyn Arabagh Unnaneysit|Neuchrogheydys]] veih'n [[Yn Reeriaght Unnaneysit|Reeriaght Unnaneysit]]
|date_bunneeaght2 = 2 Mee ny Nollick 1971
|taghyrt_bunneeaght3 =Lhiggey stiagh [[Emmiraid Ras Al Khaimah|Ras Al Khaimah]]
|date_bunneeaght3 = 10 Toshiaght Arree 1972
|traa_ynnydagh = [[Traa ayns ny h-Emmiraidyn Arabagh Unnaneysit|GST]]
|ashchur_utc = +04:00
|cctld = {{Ubl|[[.ae]]|[[امارات.]]}}
|coad_çhellvane = 971
}}
She çheer ayns [[yn Aishey]] ad '''ny h-Emmiraidyn Arabagh Unnaneysit'''. T'ad çhemmit liorish [[yn Araab Saudi]] da'n sheear as da'n jiass, as liorish [[yn Omaan]] da'n shiar. She [[Abu Dhabi]] yn [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|24|N|54|E|display=title}}
{{DEFAULTSORT:Emmiraidyn Arabagh Unnaneysit}}
{{bun}}
[[Ronney:Ny h-Emmiraidyn Arabagh Unnaneysit| ]]
[[Ronney:Bunneeaghtyn ayns ny h-Emmiraidyn Arabagh Unnaneysit|*]]
[[Ronney:Lieh-innys yn Arabaght]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Monarkaghtyn conastagh]]
[[Ronney:Monarkaghtyn Islamagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey yn Choonseil Cho-obbraghey cour Steatyn Arabagh y Lhoob]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1971]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
kwfob5szeb3ekiavafms9xt880mqinw
394767
394766
2026-10-19T02:18:43Z
MacTire02
219
++
394767
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Ny h-Emmiraidyn Arabagh Unnaneysit
|ennym_foddey_cadjincliaghtagh= {{lang|ar|الإِمَارَات العَرَبِيَّة المُتَّحِدة}} {{small|([[Arabish]])}}<br/>{{small|{{transliteration|ar|al-Imārāt al-‘Arabīyah al-Muttaḥidah}}}}
|ennym_gienneydagh = ny h-Emmiraidyn Arabagh Unnaneysit
|jalloo_brattagh = Flag of the United Arab Emirates.svg
|jalloo_cleinney = Coat of arms of the United Arab Emirates.svg
|sorçh_cowrey = Cowrey
|jalloo_caslys = United_Arab_Emirates_(orthographic_projection).svg
|jarroo-raa =
|arrane_ashoonagh = {{lang|ar|[[Ishi Biladi|عيشي بلادي]]}}
|tessen-lettyraghey_arrane_ashoonagh={{transliteration|ar|Īshī Bilādī}}
|çhyndaa_arrane_ashoonagh = Dy Veayn My Heer
|coadan_arrane_ashoonagh = UAE national anthem.ogg
|çhengey_arrane_ashoonagh = Arabish
|çhengaghyn_oikoil = [[Arabish Chadjinit Noa-emshiragh|Arabish]]<ref>{{cite web |title=Fact sheet |url=https://u.ae/en/about-the-uae/fact-sheet |website=United Arab Emirates |publisher=U.ae |access-date=31 Luanistyn 2020 |archive-date=18 Mee Houney 2023 |archive-url=https://web.archive.org/web/20231118101755/https://u.ae/en/about-the-uae/fact-sheet |url-status=live }}</ref>
|çhengaghyn_ardjynagh = {{hlist|[[Arabish Emmiraidagh]]|[[Baarle]]{{efn|She Baarle y çhengey smoo loayrit 'syn EAU.<ref name="Siemund">{{cite journal |last1=Siemund |first1=Peter |last2=Al-Issa |first2=Ahmad |last3=Leimgruber |first3=Jakob R. E. |title=Multilingualism and the role of English in the United Arab Emirates |journal=World Englishes |date=Mean Souree 2021 |volume=40 |issue=2 |pages=191–204 |doi=10.1111/weng.12507 |s2cid=219903631 |language=en |issn=0883-2919|doi-access=free }}</ref><ref name="visitdubai">{{cite web |title=What Languages are Spoken in Dubai? {{!}} Visit Dubai |url=https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |website=www.visitdubai.com |publisher=Rheynn Tarmaynys as Turrysid Dubai |access-date=15 Boaldyn 2023 |language=en |archive-date=15 Jerrey Geuree 2022 |archive-url=https://web.archive.org/web/20220115224604/https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |url-status=live }}</ref>}}}}
|craueeaght = {{tree list}}
* 74.5% [[Yn Islam ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam]] ([[craueeaght steat|oikoil]])
** 63.3% [[Yn Islam Sunni]]
** 6.7% [[Yn Islam Shia ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam Shia]]
* 12.9% [[Yn Chreestiaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Chreestiaght]]
* 6.2% [[Yn Hindughys ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Hindughys]]
* 3.2% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Buddhaghys]]
* 1.3% [[Meechraueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|meechraueeaght]]
* 1.9% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|elley]]
{{tree list/end}}
|blein_craueeaght = 2020
|possanyn_kynneeagh =
|preeu-valley = [[Abu Dhabi]]
|latd=41 |latm=43 |latNS=N |longd=44 |longm=47 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = [[Dubai]]
|sorçh_reiltys = [[Monarkaght lieh-vunraghtoil]] reihdagh [[lieh-eaghtyraneagh]] chonastagh<ref>{{cite book|last=Stewart|first=Dona J.|title=The Middle East Today: Political, Geographical and Cultural Perspectives|publisher=Routledge|date=2013|location=Lunnin as York Noa|isbn=978-0-415-78243-2|page=155}}</ref><ref>{{cite book|last=Day|first=Alan John|title=Political Parties of The World|publisher=Stockton|date=1996|isbn=1-56159-144-0|page=599}}</ref><ref>{{cite web|url=https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|title=United Arab Emirates Constitution|work=UAE Ministry of Justice|access-date=10 Jerrey Fouyir 2018|archive-date=11 Jerrey Fouyir 2018|archive-url=https://web.archive.org/web/20181011053637/https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|url-status=live}}</ref>
|blein_LTS_CCK = 2007
|LTS_CCK = $190.2 billoon
|LTS_CCK_yn_dooinney = $37,300
|sorçh_kiondeeaght = [[Shennaghys ny h-Emmiraidyn Arabagh Unnaneysit~Bunneeaght]]
|taghyrt_bunneeaght1 = [[Coadanys Goaldagh]] myr ayrn jeh ny [[Ny Steatyn Coardailagh~Steatyn Coardailagh]]
|date_bunneeaght1 = 1820 as 1892
|taghyrt_bunneeaght2 = [[Bunneeaght ny h-Emmiraidyn Arabagh Unnaneysit|Neuchrogheydys]] veih'n [[Yn Reeriaght Unnaneysit|Reeriaght Unnaneysit]]
|date_bunneeaght2 = 2 Mee ny Nollick 1971
|taghyrt_bunneeaght3 =Lhiggey stiagh [[Emmiraid Ras Al Khaimah|Ras Al Khaimah]]
|date_bunneeaght3 = 10 Toshiaght Arree 1972
|traa_ynnydagh = [[Traa ayns ny h-Emmiraidyn Arabagh Unnaneysit|GST]]
|ashchur_utc = +04:00
|cctld = {{Ubl|[[.ae]]|[[امارات.]]}}
|coad_çhellvane = 971
}}
She çheer ayns [[yn Aishey]] ad '''ny h-Emmiraidyn Arabagh Unnaneysit'''. T'ad çhemmit liorish [[yn Araab Saudi]] da'n sheear as da'n jiass, as liorish [[yn Omaan]] da'n shiar. She [[Abu Dhabi]] yn [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|24|N|54|E|display=title}}
{{DEFAULTSORT:Emmiraidyn Arabagh Unnaneysit}}
{{bun}}
[[Ronney:Ny h-Emmiraidyn Arabagh Unnaneysit| ]]
[[Ronney:Bunneeaghtyn ayns ny h-Emmiraidyn Arabagh Unnaneysit|*]]
[[Ronney:Lieh-innys yn Arabaght]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Monarkaghtyn conastagh]]
[[Ronney:Monarkaghtyn Islamagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey yn Choonseil Cho-obbraghey cour Steatyn Arabagh y Lhoob]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1971]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
dmiaxwslrwtt8fh921c4ymfz0whzkot
394768
394767
2026-10-19T02:19:18Z
MacTire02
219
piob
394768
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Ny h-Emmiraidyn Arabagh Unnaneysit
|ennym_foddey_cadjincliaghtagh= {{lang|ar|الإِمَارَات العَرَبِيَّة المُتَّحِدة}} {{small|([[Arabish]])}}<br/>{{small|{{transliteration|ar|al-Imārāt al-‘Arabīyah al-Muttaḥidah}}}}
|ennym_gienneydagh = ny h-Emmiraidyn Arabagh Unnaneysit
|jalloo_brattagh = Flag of the United Arab Emirates.svg
|jalloo_cleinney = Coat of arms of the United Arab Emirates.svg
|sorçh_cowrey = Cowrey
|jalloo_caslys = United_Arab_Emirates_(orthographic_projection).svg
|jarroo-raa =
|arrane_ashoonagh = {{lang|ar|[[Ishi Biladi|عيشي بلادي]]}}
|tessen-lettyraghey_arrane_ashoonagh={{transliteration|ar|Īshī Bilādī}}
|çhyndaa_arrane_ashoonagh = Dy Veayn My Heer
|coadan_arrane_ashoonagh = UAE national anthem.ogg
|çhengey_arrane_ashoonagh = Arabish
|çhengaghyn_oikoil = [[Arabish Chadjinit Noa-emshiragh|Arabish]]<ref>{{cite web |title=Fact sheet |url=https://u.ae/en/about-the-uae/fact-sheet |website=United Arab Emirates |publisher=U.ae |access-date=31 Luanistyn 2020 |archive-date=18 Mee Houney 2023 |archive-url=https://web.archive.org/web/20231118101755/https://u.ae/en/about-the-uae/fact-sheet |url-status=live }}</ref>
|çhengaghyn_ardjynagh = {{hlist|[[Arabish Emmiraidagh]]|[[Baarle]]{{efn|She Baarle y çhengey smoo loayrit 'syn EAU.<ref name="Siemund">{{cite journal |last1=Siemund |first1=Peter |last2=Al-Issa |first2=Ahmad |last3=Leimgruber |first3=Jakob R. E. |title=Multilingualism and the role of English in the United Arab Emirates |journal=World Englishes |date=Mean Souree 2021 |volume=40 |issue=2 |pages=191–204 |doi=10.1111/weng.12507 |s2cid=219903631 |language=en |issn=0883-2919|doi-access=free }}</ref><ref name="visitdubai">{{cite web |title=What Languages are Spoken in Dubai? {{!}} Visit Dubai |url=https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |website=www.visitdubai.com |publisher=Rheynn Tarmaynys as Turrysid Dubai |access-date=15 Boaldyn 2023 |language=en |archive-date=15 Jerrey Geuree 2022 |archive-url=https://web.archive.org/web/20220115224604/https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |url-status=live }}</ref>}}}}
|craueeaght = {{tree list}}
* 74.5% [[Yn Islam ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam]] ([[craueeaght steat|oikoil]])
** 63.3% [[Yn Islam Sunni]]
** 6.7% [[Yn Islam Shia ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam Shia]]
* 12.9% [[Yn Chreestiaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Chreestiaght]]
* 6.2% [[Yn Hindughys ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Hindughys]]
* 3.2% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Buddhaghys]]
* 1.3% [[Meechraueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|meechraueeaght]]
* 1.9% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|elley]]
{{tree list/end}}
|blein_craueeaght = 2020
|possanyn_kynneeagh =
|preeu-valley = [[Abu Dhabi]]
|latd=41 |latm=43 |latNS=N |longd=44 |longm=47 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = [[Dubai]]
|sorçh_reiltys = [[Monarkaght lieh-vunraghtoil]] reihdagh [[lieh-eaghtyraneagh]] chonastagh<ref>{{cite book|last=Stewart|first=Dona J.|title=The Middle East Today: Political, Geographical and Cultural Perspectives|publisher=Routledge|date=2013|location=Lunnin as York Noa|isbn=978-0-415-78243-2|page=155}}</ref><ref>{{cite book|last=Day|first=Alan John|title=Political Parties of The World|publisher=Stockton|date=1996|isbn=1-56159-144-0|page=599}}</ref><ref>{{cite web|url=https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|title=United Arab Emirates Constitution|work=UAE Ministry of Justice|access-date=10 Jerrey Fouyir 2018|archive-date=11 Jerrey Fouyir 2018|archive-url=https://web.archive.org/web/20181011053637/https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|url-status=live}}</ref>
|blein_LTS_CCK = 2007
|LTS_CCK = $190.2 billoon
|LTS_CCK_yn_dooinney = $37,300
|sorçh_kiondeeaght = [[Shennaghys ny h-Emmiraidyn Arabagh Unnaneysit|Bunneeaght]]
|taghyrt_bunneeaght1 = [[Coadanys Goaldagh]] myr ayrn jeh ny [[Ny Steatyn Coardailagh~Steatyn Coardailagh]]
|date_bunneeaght1 = 1820 as 1892
|taghyrt_bunneeaght2 = [[Bunneeaght ny h-Emmiraidyn Arabagh Unnaneysit|Neuchrogheydys]] veih'n [[Yn Reeriaght Unnaneysit|Reeriaght Unnaneysit]]
|date_bunneeaght2 = 2 Mee ny Nollick 1971
|taghyrt_bunneeaght3 =Lhiggey stiagh [[Emmiraid Ras Al Khaimah|Ras Al Khaimah]]
|date_bunneeaght3 = 10 Toshiaght Arree 1972
|traa_ynnydagh = [[Traa ayns ny h-Emmiraidyn Arabagh Unnaneysit|GST]]
|ashchur_utc = +04:00
|cctld = {{Ubl|[[.ae]]|[[امارات.]]}}
|coad_çhellvane = 971
}}
She çheer ayns [[yn Aishey]] ad '''ny h-Emmiraidyn Arabagh Unnaneysit'''. T'ad çhemmit liorish [[yn Araab Saudi]] da'n sheear as da'n jiass, as liorish [[yn Omaan]] da'n shiar. She [[Abu Dhabi]] yn [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|24|N|54|E|display=title}}
{{DEFAULTSORT:Emmiraidyn Arabagh Unnaneysit}}
{{bun}}
[[Ronney:Ny h-Emmiraidyn Arabagh Unnaneysit| ]]
[[Ronney:Bunneeaghtyn ayns ny h-Emmiraidyn Arabagh Unnaneysit|*]]
[[Ronney:Lieh-innys yn Arabaght]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Monarkaghtyn conastagh]]
[[Ronney:Monarkaghtyn Islamagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey yn Choonseil Cho-obbraghey cour Steatyn Arabagh y Lhoob]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1971]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
ja3vp6wqf48vaso9plv0wbqdt6iygw5
394769
394768
2026-10-19T02:19:44Z
MacTire02
219
piob
394769
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Ny h-Emmiraidyn Arabagh Unnaneysit
|ennym_foddey_cadjincliaghtagh= {{lang|ar|الإِمَارَات العَرَبِيَّة المُتَّحِدة}} {{small|([[Arabish]])}}<br/>{{small|{{transliteration|ar|al-Imārāt al-‘Arabīyah al-Muttaḥidah}}}}
|ennym_gienneydagh = ny h-Emmiraidyn Arabagh Unnaneysit
|jalloo_brattagh = Flag of the United Arab Emirates.svg
|jalloo_cleinney = Coat of arms of the United Arab Emirates.svg
|sorçh_cowrey = Cowrey
|jalloo_caslys = United_Arab_Emirates_(orthographic_projection).svg
|jarroo-raa =
|arrane_ashoonagh = {{lang|ar|[[Ishi Biladi|عيشي بلادي]]}}
|tessen-lettyraghey_arrane_ashoonagh={{transliteration|ar|Īshī Bilādī}}
|çhyndaa_arrane_ashoonagh = Dy Veayn My Heer
|coadan_arrane_ashoonagh = UAE national anthem.ogg
|çhengey_arrane_ashoonagh = Arabish
|çhengaghyn_oikoil = [[Arabish Chadjinit Noa-emshiragh|Arabish]]<ref>{{cite web |title=Fact sheet |url=https://u.ae/en/about-the-uae/fact-sheet |website=United Arab Emirates |publisher=U.ae |access-date=31 Luanistyn 2020 |archive-date=18 Mee Houney 2023 |archive-url=https://web.archive.org/web/20231118101755/https://u.ae/en/about-the-uae/fact-sheet |url-status=live }}</ref>
|çhengaghyn_ardjynagh = {{hlist|[[Arabish Emmiraidagh]]|[[Baarle]]{{efn|She Baarle y çhengey smoo loayrit 'syn EAU.<ref name="Siemund">{{cite journal |last1=Siemund |first1=Peter |last2=Al-Issa |first2=Ahmad |last3=Leimgruber |first3=Jakob R. E. |title=Multilingualism and the role of English in the United Arab Emirates |journal=World Englishes |date=Mean Souree 2021 |volume=40 |issue=2 |pages=191–204 |doi=10.1111/weng.12507 |s2cid=219903631 |language=en |issn=0883-2919|doi-access=free }}</ref><ref name="visitdubai">{{cite web |title=What Languages are Spoken in Dubai? {{!}} Visit Dubai |url=https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |website=www.visitdubai.com |publisher=Rheynn Tarmaynys as Turrysid Dubai |access-date=15 Boaldyn 2023 |language=en |archive-date=15 Jerrey Geuree 2022 |archive-url=https://web.archive.org/web/20220115224604/https://www.visitdubai.com/en/articles/spoken-languages-in-dubai#:~:text=Absolutely.,English%20is%20always%20an%20option. |url-status=live }}</ref>}}}}
|craueeaght = {{tree list}}
* 74.5% [[Yn Islam ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam]] ([[craueeaght steat|oikoil]])
** 63.3% [[Yn Islam Sunni]]
** 6.7% [[Yn Islam Shia ayns ny h-Emmiraidyn Arabagh Unnaneysit|Yn Islam Shia]]
* 12.9% [[Yn Chreestiaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Chreestiaght]]
* 6.2% [[Yn Hindughys ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Hindughys]]
* 3.2% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|Y Buddhaghys]]
* 1.3% [[Meechraueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|meechraueeaght]]
* 1.9% [[Craueeaght ayns ny h-Emmiraidyn Arabagh Unnaneysit|elley]]
{{tree list/end}}
|blein_craueeaght = 2020
|possanyn_kynneeagh =
|preeu-valley = [[Abu Dhabi]]
|latd=41 |latm=43 |latNS=N |longd=44 |longm=47 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = [[Dubai]]
|sorçh_reiltys = [[Monarkaght lieh-vunraghtoil]] reihdagh [[lieh-eaghtyraneagh]] chonastagh<ref>{{cite book|last=Stewart|first=Dona J.|title=The Middle East Today: Political, Geographical and Cultural Perspectives|publisher=Routledge|date=2013|location=Lunnin as York Noa|isbn=978-0-415-78243-2|page=155}}</ref><ref>{{cite book|last=Day|first=Alan John|title=Political Parties of The World|publisher=Stockton|date=1996|isbn=1-56159-144-0|page=599}}</ref><ref>{{cite web|url=https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|title=United Arab Emirates Constitution|work=UAE Ministry of Justice|access-date=10 Jerrey Fouyir 2018|archive-date=11 Jerrey Fouyir 2018|archive-url=https://web.archive.org/web/20181011053637/https://elaws.moj.gov.ae/MainArabicTranslation.aspx?val=UAE-MOJ_LC-En/00_CONSTITUTION/UAE-LC-En_1971-07-18_00000_Dos.html&np=&lmp=undefined|url-status=live}}</ref>
|blein_LTS_CCK = 2007
|LTS_CCK = $190.2 billoon
|LTS_CCK_yn_dooinney = $37,300
|sorçh_kiondeeaght = [[Shennaghys ny h-Emmiraidyn Arabagh Unnaneysit|Bunneeaght]]
|taghyrt_bunneeaght1 = [[Coadanys Goaldagh]] myr ayrn jeh ny [[Ny Steatyn Coardailagh|Steatyn Coardailagh]]
|date_bunneeaght1 = 1820 as 1892
|taghyrt_bunneeaght2 = [[Bunneeaght ny h-Emmiraidyn Arabagh Unnaneysit|Neuchrogheydys]] veih'n [[Yn Reeriaght Unnaneysit|Reeriaght Unnaneysit]]
|date_bunneeaght2 = 2 Mee ny Nollick 1971
|taghyrt_bunneeaght3 =Lhiggey stiagh [[Emmiraid Ras Al Khaimah|Ras Al Khaimah]]
|date_bunneeaght3 = 10 Toshiaght Arree 1972
|traa_ynnydagh = [[Traa ayns ny h-Emmiraidyn Arabagh Unnaneysit|GST]]
|ashchur_utc = +04:00
|cctld = {{Ubl|[[.ae]]|[[امارات.]]}}
|coad_çhellvane = 971
}}
She çheer ayns [[yn Aishey]] ad '''ny h-Emmiraidyn Arabagh Unnaneysit'''. T'ad çhemmit liorish [[yn Araab Saudi]] da'n sheear as da'n jiass, as liorish [[yn Omaan]] da'n shiar. She [[Abu Dhabi]] yn [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|24|N|54|E|display=title}}
{{DEFAULTSORT:Emmiraidyn Arabagh Unnaneysit}}
{{bun}}
[[Ronney:Ny h-Emmiraidyn Arabagh Unnaneysit| ]]
[[Ronney:Bunneeaghtyn ayns ny h-Emmiraidyn Arabagh Unnaneysit|*]]
[[Ronney:Lieh-innys yn Arabaght]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Monarkaghtyn conastagh]]
[[Ronney:Monarkaghtyn Islamagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey yn Choonseil Cho-obbraghey cour Steatyn Arabagh y Lhoob]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1971]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
merpr3fhg5x7k5vnrtxoqwdirpap850
Resooney ymmydeyr:MacTire02
3
2773
394757
393565
2026-10-18T21:01:47Z
~2026-55751-57
24004
/* KPop Demon Hunters */
394757
wikitext
text/x-wiki
{{Tashtlannyn}}
{{Tashtlann resoonaght MacTire}}
== Translation request ==
Hello, MacTire02.
Can you translate and upload the articles [[:en:Mount Bazardüzü]] as [[Slieau Bazardüzü]] and [[:en:Phlegraean Fields]] as [[Campi Flegrei]] in Manx Wikipedia?
Yours sincerely, [[Ymmydeyr:Kurcke|Kurcke]] ([[Resooney ymmydeyr:Kurcke|resoonaght]]) 20:44, 25 Toshiaght Arree 2026 (UTC)
: Ta'n chied art jeant nish. Lhisin ny ronnaghyn y chroo nish as, lurg shen, neem y nah art. Bee yn nah art soit ec [[ny Magheryn Phlegraeagh]].
: I have finished the first article. I just need to create the categories and then I will do the second article. The second article will be located at [[ny Magheryn Phlegraeagh]].
: [[Ymmydeyr:MacTire02|<span style="color:#003300;font-family:serif;font-size:100%"><sup>'''Mac Tíre'''</sup></span>]] [[Resooney ymmydeyr:MacTire02|<span style="color:red;font-family:cursive;font-size:80%"><sub>''Cowag''</sub></span>]] 04:07, 26 Toshiaght Arree 2026 (UTC)
::Thank you very much for the new articles. [[Ymmydeyr:Kurcke|Kurcke]] ([[Resooney ymmydeyr:Kurcke|resoonaght]]) 07:42, 27 Toshiaght Arree 2026 (UTC)
== You may be an eligible candidate for the U4C election ==
<div lang="en" dir="ltr" class="mw-content-ltr">
Greetings,
The [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee|Universal Code of Conduct Coordinating Committee (U4C)]] seeks candidates for the 2026 election. The U4C is the global committee responsible for overseeing enforcement of the [[foundation:Special:MyLanguage/Policy:Universal Code of Conduct|Universal Code of Conduct]]. Elections are held annually, if elected a committee member serves for two years.
This year the U4C requires candidates to hold administrator rights on at least one wiki, which is why you are being contacted as you appear to hold this right. There are other requirements, such as candidates must be at least 18 years old and may not be employed by the Wikimedia Foundation or other related chapters and affiliates. You can find more information in the [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee/Election/2026#Call_for_Candidates|call for candidates on Meta-wiki]]. Additionally, the committee's working language is English; some ability to communicate in English is required.
The election opens on 18 May, if you are eligible and interested you have until 10 May to submit your candidacy. There will week between for candidates to answer questions from the community. Voting takes place privately in [[m:Special:MyLanguage/SecurePoll|SecurePoll]], successful candidates must receive at least 60% support. More information is available on [[m:Special:MyLanguage/Universal_Code_of_Conduct/Coordinating_Committee/Election/2026|the 2026 Elections page]], including timelines and other candidacy information. If you read over the material and consider yourself qualified, please consider submitting your name to run for the committee. If you think someone else in your community might be interested and qualified, please encourage them to run.
In partnership with the U4C -- [[m:User:Keegan (WMF)|Keegan (WMF)]] ([[m:User_talk:Keegan (WMF)|talk]]) 18:33, 28 Averil 2026 (UTC) </div>
<!-- Message sent by User:Keegan (WMF)@metawiki using the list at https://meta.wikimedia.org/w/index.php?title=User:Keegan_(WMF)/test&oldid=30471754 -->
== Manx ==
Hello. I'm looking for translation of descriptions "studio album by Basshunter", "song by Käärijä and Basshunter" and "single by Käärijä and Basshunter" in Manx for Wikidata items. Would you help? [[Ymmydeyr:Eurohunter|Eurohunter]] ([[Resooney ymmydeyr:Eurohunter|resoonaght]]) 19:56, 30 Averil 2026 (UTC)
:These would be, respectively, "albym seyrlann lesh Basshunter", "arrane lesh Käärijä as Basshunter", and "singyl lesh Käärijä as Basshunter". Best, [[Ymmydeyr:MacTire02|<span style="color:#003300;font-family:serif;font-size:100%"><sup>'''Mac Tíre'''</sup></span>]] [[Resooney ymmydeyr:MacTire02|<span style="color:red;font-family:cursive;font-size:80%"><sub>''Cowag''</sub></span>]] 19:58, 30 Averil 2026 (UTC)
:: Thank you. Could we also have "compilation album by Basshunter", "promotional single by Basshunter", "music video by Basshunter" and "lyric video by Basshunter"? It would be complete then. [[Ymmydeyr:Eurohunter|Eurohunter]] ([[Resooney ymmydeyr:Eurohunter|resoonaght]]) 19:50, 7 Boaldyn 2026 (UTC)
== Possible unblock ==
Hi [[Ymmydeyr:MacTire02|MacTire02]], I would like to check if it is possible, to unblock [[User:TDKR Chicago 101]]? They're active simplewiki-sysop and I think things changed from 2013. It would be great if you could consider that. Thank you very much! [[Ymmydeyr:NDG|NDG]] ([[Resooney ymmydeyr:NDG|resoonaght]]) 22:10, 17 Mean Souree 2026 (UTC)
:@[[Ymmydeyr:NDG|NDG]] I have removed the block. I did note on the block removal that any repeat of past behaviours will result in the block being reinstated permanently. There will be no warnings the next time. Failure to engage in commentary when an admin contacts this user over an issue will result in a block. Disrupting the project in any way will result in a block. Please communicate that to the user. [[Ymmydeyr:MacTire02|<span style="color:#003300;font-family:serif;font-size:100%"><sup>'''Mac Tíre'''</sup></span>]] [[Resooney ymmydeyr:MacTire02|<span style="color:red;font-family:cursive;font-size:80%"><sub>''Cowag''</sub></span>]] 01:11, 18 Mean Souree 2026 (UTC)
::Thanks a lot for giving it a try! [[Ymmydeyr:NDG|NDG]] ([[Resooney ymmydeyr:NDG|resoonaght]]) 05:08, 18 Mean Souree 2026 (UTC)
== KPop Demon Hunters ==
Could you please add more content to the page [[KPop Demon Hunters]]? Thank you. [[Er lheh:Contributions/~2026-35926-97|~2026-35926-97]] ([[Resooney ymmydeyr:~2026-35926-97|talk]]) 19:37, 20 Mean Souree 2026 (UTC)
:What about that page and [[A hetedik testvér]]? [[Er lheh:Contributions/~2026-55751-57|~2026-55751-57]] ([[Resooney ymmydeyr:~2026-55751-57|talk]]) 21:01, 18 Jerrey Fouyir 2026 (UTC)
== Infobox styles ==
you can now edit the Style. I have migrate the code to Templatestyles [[Clowan:Kishtey fys/styles.css]] [[Ymmydeyr:WikiBayer|WikiBayer]] ([[Resooney ymmydeyr:WikiBayer|resoonaght]]) 20:26, 1 Mean Fouyir 2026 (UTC)
:Thank you so much! [[Ymmydeyr:MacTire02|<span style="color:#003300;font-family:serif;font-size:100%"><sup>'''Mac Tíre'''</sup></span>]] [[Resooney ymmydeyr:MacTire02|<span style="color:red;font-family:cursive;font-size:80%"><sub>''Cowag''</sub></span>]] 20:28, 1 Mean Fouyir 2026 (UTC)
== Translation request ==
I wanna expand the Manx wiki's knowledge on knives. May you translate [[:en:Hunting knife]], [[:en:Kitchen knife]], [[:en:Pocket knife]] and [[:en:Bowie knife]]? [[Ymmydeyr:Pangasayo|Pangasayo]] ([[Resooney ymmydeyr:Pangasayo|resoonaght]]) 01:49, 23 Mean Fouyir 2026 (UTC)
krc6g3t3he4we5gni7oiqdwvkq2u83k
Ellan Wirrish
0
2920
394731
394612
2026-10-18T13:31:45Z
~2026-55739-41
24000
/* */
394731
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym_dooghyssagh = Pobblaght Ellan Wirrish
|ennym_foddey_cadjincliaghtagh= {{lang|en|Republic of Mauritius|italics=no}} {{small|([[Baarle]])}}<br/>{{lang|fr|République de Maurice|italics=no}} {{small|([[Frangish]])}}<br/>{{lang|mfe|Repiblik Moris|italics=no}} {{small|([[Creeole Mwirrishagh|Morisien]])}}
|ennym_gienneydagh = Ellan Wirrish
|jalloo_brattagh = Flag of Mauritius.svg
|jalloo_cleinney = Coat of arms of Mauritius.svg
|jalloo_caslys = Mauritius (orthographic projection).svg
|jarroo-raa = {{lang|la|Stella Clavisque Maris Indici}}
|imraa_jarroo-raa = <ref>{{Cite web|title=Government Information Service – Coat of Arms|url=http://gis.govmu.org/English/About%20Mauritius/Pages/Coats-of-Arms.aspx|archive-url=https://web.archive.org/web/20200612094501/http://gis.govmu.org/English/About%20Mauritius/Pages/Coats-of-Arms.aspx|archive-date=12 Mean Souree 2020|access-date=29 Jerrey Souree 2019|publisher=govmu.org}}</ref>
|çhyndaa_jarroo-raa = Rollage as Ogher y Cheayn Injinagh
|çhengey_jarroo-raa = Ladjyn
|arrane_ashoonagh = {{lang|en|[[Motherland (anthym)|Motherland]]|italics=no}}
|coadan_arrane_ashoonagh = Motherland_(instrumental).ogg
|çhengey_arrane_ashoonagh = Baarle
|çhengaghyn_oikoil = Çhengey oikoil erbee (''de jure'')<br />{{nowrap|{{hlist|[[Baarle]]|[[Frangish]]}} (''de facto''){{efn|Cha nel [[bunraght Ellan Wirrish]] cur sheese er [[çhengey oikoil]]. Ta'n Bunraght gra dy nee Baarle çhengey oikoil y Çhionnal Ashoonagh; ansherbee, foddee oltey yn çhionnal loayrt rish y chaairliagh 'sy Rangish.}}}}
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght pharlamaidagh]] unnaneagh<ref>{{cite web |title=Country Profile: Mauritius |url=https://www.sng-wofi.org/country_profiles/mauritius.html |website=World Observatory on Subnational Government Finance and Investment (SNG-WOFI) |publisher=OECD / UCLG |access-date=2026-09-18}}</ref>
|ushtey_sy_cheead = 0.05
|blein_LTS_CCK = 2006
|LTS_CCK = $16.0 billoon
|LTS_CCK_yn_dooinney = $13,703
|sorçh_kiondeeaght = Neuchrogheydys
|note_kiondeeaght = veih'n [[Yn Reeriaght Unnaneysit|Reeriaght Unnaneysit]]
|taghyrt1_bunnit = [[Bunraght Ellan Wirrish]]
|date1_bunnit = 12 Mayrnt 1968
|taghyrt2_bunnit = Pobblaght
|date2_bunnit = 12 Mart 1992
|traa_ynnydagh = [[Traa Ellan Wirrish|MUT]]
|ashchur_utc = +04:00
|cctld = [[.mu]]
|coad_çhellvane = 230
}}
She çheer ayns [[yn Affrick]] ee '''Ellan Wirrish'''. T'ee soit ayns [[Yn Keayn Injinagh|y Cheayn Injinagh]]. She [[Port Louis]] y [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{commonscat}}
{{Yn Affrick}}
{{gurneil eaghtyrys}}
{{DEFAULTSORT:Wirrish, Ellan}}
{{bun}}
[[Ronney:Ellan Wirrish| ]]
[[Ronney:Bunneeaghtyn 'syn Impiraght Ollanagh 'sy vlein 1638]]
[[Ronney:Bunneeaghtyn 'syn Affrick 'sy vlein 1968]]
[[Ronney:Çheeraghyn yn Affrick]]
[[Ronney:Çheeraghyn yn Affrick Hiar]]
[[Ronney:Çheeraghyn ellanagh 'sy Cheayn Injinagh]]
[[Ronney:Çheeraghyn ellanagh]]
[[Ronney:Çheeraghyn-oltey yn Unnaneys Affrickagh]]
[[Ronney:Çheeraghyn-oltey Cho-unnaneys ny h-Ashoonyn]]
[[Ronney:Çheeraghyn-oltey Organisation internationale de la Francophonie]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Ny h-Ellanyn Mascareenagh]]
[[Ronney:Yn Affrick Vioseenagh]]
[[Ronney:Buill chummaltit bunnit liorish Colught Ollanagh yn Injey Hiar]]
[[Ronney:Buill chummaltit bunnit 'sy vlein 1638]]
[[Ronney:Pobblaghtyn ayns Co-unnaneys ny h-Ashoonyn]]
[[Ronney:Steatyn Beggey Ellanagh er Lhiasaghey]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1968]]
skpdl4zzserlutb2uipjxu4ahdbg5g7
Yn Earack
0
2982
394746
394730
2026-10-18T16:07:56Z
MacTire02
219
++; ny smoo ry-yannoo
394746
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym_dooghyssagh = Pobblaght yn Earack
|ennym_foddey_cadjincliaghtagh= {{ubl|{{lang|ar|جُمْهُورِيَّة ٱلْعِرَاق}} {{small|([[Arabish]])}}<br />{{small|{{transliteration|ar|Jumhūriyyat al-ʿIrāq}}}}|{{lang|ku|کۆماری عێراق|italics=off}} {{small|([[Kurdish]])}}<br />{{small|{{transliteration|ku|Komarî Êraq}}}}}}
|ennym_gienneydagh = yn Earack
|jalloo_brattagh = Flag of Iraq.svg
|jalloo_cleinney = Coat of arms (emblem) of Iraq 2008.svg
|jalloo_caslys = Iraq (orthographic projection).svg
|jarroo-raa = الله أكبر<br />''"[[Takbir|Allahu Akbar]]"''
|arrane_ashoonagh = {{lang|ar|مَوْطِنِيْ}}<br />{{transliteration|ar|[[Mawtini (Ibrahim Tuqan song)|Mawṭinī]]}}<br />"My Homeland"{{parabr}}{{center|[[File:United States Navy Band - Mawtini.ogg]]}}
|arrane_reeoil =
|çhengaghyn_oikoil = {{hlist|[[Modern Standard Arabic|Arabic]]|[[Central Kurdish|Kurdish]]<ref name="Constitution of Iraq" />}}
|çhengaghyn_ardjynagh = {{hlist|[[Suret language|Assyrian]]<ref name="Constitution of Iraq" />|[[Armenian language|Armenian]]<ref name="Constitution of Iraq" />|[[Iraqi Turkmen#Language|Turkmen]]{{efn|Although referred to as Turkmen, the official written language of the Turkmen is [[Istanbul Turkish]].}}<ref name="Constitution of Iraq" />}}
|craueeaght = {{Tree list}}
* 90–95% [[Islam in Iraq|Islam]] ([[State religion|official]])
** 61% [[Shia Islam in Iraq|Shia]]
** 35% [[Sunni Islam in Iraq|Sunni]]
* 5-10% other religions (incl. [[Christianity in Iraq|Christians]], [[Mandeans]], [[Yazidis in Iraq|Yazidis]]){{efn|[[Christianity in Iraq|Christianity]], [[Mandaeism]], [[Yazidis]]m, [[History of the Jews in Iraq|Judaism]], [[Yarsanism]], [[Irreligion in Iraq|irreligion]] and others<ref>{{cite web |title=Iraqi religions |url=https://www.state.gov/reports/2020-report-on-international-religious-freedom/iraq/ |publisher=Office of International Religious Freedom |website=www.state.gov |date=12 May 2021 |quote=The constitution establishes Islam as the official religion and states no law may be enacted contradicting the "established provisions of Islam." It provides for freedom of religious belief and practice for all individuals, including Muslims, Christians, Yezidis, and Sabean-Mandeans, but does not explicitly mention followers of other religions or atheists. |access-date=14 December 2021 |archive-date=28 May 2022 |archive-url=https://web.archive.org/web/20220528195614/https://www.state.gov/reports/2020-report-on-international-religious-freedom/iraq/ |url-status=live }}</ref><ref>{{cite web |url=https://www.cia.gov/the-world-factbook/countries/iraq/ |archive-url=https://web.archive.org/web/20260118091316/https://www.cia.gov/the-world-factbook/countries/iraq/ |url-status=dead |archive-date=18 January 2026 |title=Iraq}}</ref>}}
{{Tree list/end}}
|blein_craueeaght = 2020
|imraa_craueeaght = <ref>{{cite web |url=https://www.thearda.com/world-religion/national-profiles?u=111c |title=National Profiles |access-date=28 October 2024 |archive-date=3 December 2024 |archive-url=https://web.archive.org/web/20241203182243/https://www.thearda.com/world-religion/national-profiles?u=111c |url-status=live }}</ref>
|preeu-valley = [[Baghdad]]
|latd=33 |latm=20 |latNS=N |longd=44 |longm=26 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght pharlamaidagh]] chonastagh fo [[feyshtynaghys (politickaght)|feyshtynaghys]]
|ushtey_sy_cheead = 1.1
|blein_LTS_CCK = 2007
|LTS_CCK = $102.3 billoon
|LTS_CCK_yn_dooinney = $3,600
| sovereignty_type = [[Shennaghys yn Earack|Bunneeaght]]
|taghyrt_bunneeaght1 = [[Sumer]]
|date_bunneeaght1 = {{circa|3300 BC}}
|taghyrt_bunneeaght2 = [[Akkadian Empire]]
|date_bunneeaght2 = {{circa|2334 BC}}
|taghyrt_bunneeaght3 = [[Assyria]]
|date_bunneeaght3 = {{circa|2025 BC}}
|taghyrt_bunneeaght4 = [[Babylonia]]
|date_bunneeaght4 = {{circa|1890 BC}}
|taghyrt_bunneeaght5 = [[Abbasid Caliphate]]
|date_bunneeaght5 = 750 AD
|taghyrt_bunneeaght6 = [[Mamluk Iraq]]
|date_bunneeaght6 = 1704 AD
|taghyrt_bunneeaght7 = [[Mandate of Mesopotamia]]
|date_bunneeaght7 = 14 April 1920
|taghyrt_bunneeaght8 = [[Kingdom of Iraq|Independence declared]]
|date_bunneeaght8 = 3 October 1932
|taghyrt_bunneeaght9 = [[14 July Revolution|Republic declared]]
|date_bunneeaght9 = 14 July 1958
|taghyrt_bunneeaght10 = {{nowrap|[[Constitution of Iraq|Current constitution]]}}
|date_bunneeaght10 = 15 October 2005
|argid = [[Dinar yn Earack]]
|coad_argid = IQD
|traa_ynnydagh =
|ashchur_utc = +3
|traa_ynnydagh_TTLS =
|ashchur_utc_TTLS =
|cctld = [[.iq]]
|coad_çhellvane = 964
}}
She çheer 'syn [[yn Aishey|Aishey]] ee '''yn Earack'''. T'ee çhemmit liorish [[Yn Turkee|y Turkee]] da'n twoaie, [[yn Eeraan]] da'n shiar, [[Yn Choowait|y Choowait]] da'n jiass, liorish [[yn Araab Saudi]] da'n sheear yiass, as liorish [[Yn Jordaan|y Jordaan]] as [[Yn Teer|y Teer]] da'n sheear. She [[Baghdad]] y [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|33|N|44|E|type:country_region:IQ|display=title}}
{{DEFAULTSORT:Earack, Yn}}
{{bun}}
[[Ronney:Yn Earack| ]]
[[Ronney:Pobblaghtyn conastagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1932]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
[[Ronney:Çheeraghyn yn Aishey]]
sm4zlltgyyc8hdnda6b27k3txegzcy0
394755
394746
2026-10-18T19:45:27Z
MacTire02
219
++
394755
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym_dooghyssagh = Pobblaght yn Earack
|ennym_foddey_cadjincliaghtagh= {{ubl|{{lang|ar|جُمْهُورِيَّة ٱلْعِرَاق}} {{small|([[Arabish]])}}<br />{{small|{{transliteration|ar|Jumhūriyyat al-ʿIrāq}}}}|{{lang|ku|کۆماری عێراق|italics=off}} {{small|([[Kurdish]])}}<br />{{small|{{transliteration|ku|Komarî Êraq}}}}}}
|ennym_gienneydagh = yn Earack
|jalloo_brattagh = Flag of Iraq.svg
|jalloo_cleinney = Coat of arms (emblem) of Iraq 2008.svg
|jalloo_caslys = Iraq (orthographic projection).svg
|jarroo-raa = none
|arrane_ashoonagh = {{lang|ar|[[Mawtini (arrane Ibrahim Tuqan)|مَوْطِنِيْ]]}}
|tessen-lettyraghey_arrane_ashoonagh={{transliteration|ar|Mawṭinī}}
|çhengey_arrane_ashoonagh = Arabish
|çhyndaa_arrane_ashoonagh = My Heer Ghooie
|coadan_arrane_ashoonagh = United States Navy Band - Mawtini.ogg
|çhengaghyn_oikoil = {{hlist|[[Arabish Chadjinit Noa-emshiragh|Arabish]]|[[Kurdish Veanagh|Kurdish]]<ref name="Constitution of Iraq">{{cite web |title=Constitution of Iraq |publisher=Constitute |url=https://www.constituteproject.org/constitution/Iraq_2005 |access-date=31 Boaldyn 2024 |archive-date=3 Boaldyn 2025 |archive-url=https://web.archive.org/web/20250503151515/https://www.constituteproject.org/constitution/Iraq_2005 |url-status=live }}</ref>}}
|çhengaghyn_ardjynagh = {{hlist|[[Suretish|Assyrianish]]<ref name="Constitution of Iraq" />|[[Armeanish]]<ref name="Constitution of Iraq" />|[[Turkmenee Earackagh#Çhengey|Turkmenish]]{{efn|Ga dy vel ee enmyssit Turkmenish, she [[Turkish İstanbul]] y çhengey screeuit oikoil.}}<ref name="Constitution of Iraq" />}}
|craueeaght = {{Tree list}}
* 90–95% [[Yn Islam 'syn Earack|Yn Islam]] ([[craueeaght steat|oikoil]])
** 61% [[Yn Islam Shia 'syn Earack|Shia]]
** 35% [[Yn Islam Sunni 'syn Earack|Sunni]]
* 5-10% craueeaghtyn elley (myr [[Yn Chreestiaght 'syn Earack|Creesteenyn]], [[Mandeanee]], [[Yazidee 'syn Earack|Yazidee]]){{efn|[[Yn Chreestiaght 'syn Earack|Y Chreestiaght]], y [[Yn Mandaeaghys|Mandaeaghys]], y [[Yazidee|Yazidaghys]], yn [[Shennaghys ny h-Ewnyn 'syn Earack|Ewaghys]], yn [[Yn Yarsanaght|Yarsanaght]], y [[Meechraueeaght 'syn Earack|veechraueeaght]], as credjueyn elley.<ref>{{cite web |title=Iraqi religions |url=https://www.state.gov/reports/2020-report-on-international-religious-freedom/iraq/ |publisher=Office of International Religious Freedom |website=www.state.gov |date=12 Boaldyn 2021 |quote=The constitution establishes Islam as the official religion and states no law may be enacted contradicting the "established provisions of Islam." It provides for freedom of religious belief and practice for all individuals, including Muslims, Christians, Yezidis, and Sabean-Mandeans, but does not explicitly mention followers of other religions or atheists. |trans-quote= Ta'n bunraght soiaghey yn Islam myr y chraueeaght oikoil as t'eh soilshaghey nagh oddys leigh erbee ve currit stiagh ayns bree ta goll noi "kiarailyn soit yn Islam." T'eh kiarail seyrsnys y chredjue as y chliaghtey crauee da dagh peiagh, goaill stiagh Moslymee, Creesteenyn, Yazidee, as Sabeanee-Mandeanee, agh cha nel eh soilshaghey eiyrtyssee chraueeaghtyn elley ny anjeeyn dy jeeragh.|access-date=14 Mee ny Nollick 2021 |archive-date=28 Boaldyn 2022 |archive-url=https://web.archive.org/web/20220528195614/https://www.state.gov/reports/2020-report-on-international-religious-freedom/iraq/ |url-status=live }}</ref><ref>{{cite web |url=https://www.cia.gov/the-world-factbook/countries/iraq/ |archive-url=https://web.archive.org/web/20260118091316/https://www.cia.gov/the-world-factbook/countries/iraq/ |url-status=dead |archive-date=18 Jerrey Geuree 2026 |title=Iraq}}</ref>}}
{{Tree list/end}}
|blein_craueeaght = 2020
|imraa_craueeaght = <ref>{{cite web |url=https://www.thearda.com/world-religion/national-profiles?u=111c |title=National Profiles |access-date=28 October 2024 |archive-date=3 December 2024 |archive-url=https://web.archive.org/web/20241203182243/https://www.thearda.com/world-religion/national-profiles?u=111c |url-status=live }}</ref>
|preeu-valley = [[Baghdad]]
|latd=33 |latm=20 |latNS=N |longd=44 |longm=26 |longEW=E |latNSgael=Hwoaie |longEWgael=Hiar
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght pharlamaidagh]] chonastagh fo [[feyshtynaghys (politickaght)|feyshtynaghys]]
|ushtey_sy_cheead = 1.1
|blein_LTS_CCK = 2007
|LTS_CCK = $102.3 billoon
|LTS_CCK_yn_dooinney = $3,600
| sovereignty_type = [[Shennaghys yn Earack|Bunneeaght]]
|taghyrt_bunneeaght1 = [[Sumer]]
|date_bunneeaght1 = {{circa|3300 RC}}
|taghyrt_bunneeaght2 = [[Impiraght Akkadia]]
|date_bunneeaght2 = {{circa|2334 RC}}
|taghyrt_bunneeaght3 = [[Assyria]]
|date_bunneeaght3 = {{circa|2025 RC}}
|taghyrt_bunneeaght4 = [[Babylonia]]
|date_bunneeaght4 = {{circa|1890 RC}}
|taghyrt_bunneeaght5 = [[Yn Chaylifaght Abbasidagh|Y Chaylifaght Abbasidagh]]
|date_bunneeaght5 = 750 BNJ
|taghyrt_bunneeaght6 = [[Yn Earack Vamluckagh]]
|date_bunneeaght6 = 1704
|taghyrt_bunneeaght7 = [[Anneydaght Mesopotamia]]
|date_bunneeaght7 = 14 Averil 1920
|taghyrt_bunneeaght8 = [[Reeriaght yn Earack|Fogrey magh y neuchrogheydys]]
|date_bunneeaght8 = 3 Jerrey Fouyor 1932
|taghyrt_bunneeaght9 = [[Bun-chaghlaa 14 Jerrey Fouyir|Fogrey magh y phobblaght]]
|date_bunneeaght9 = 14 Jerrey Souree 1958
|taghyrt_bunneeaght10 = {{nowrap|[[Bunraght yn Earack|Bunraght roie]]}}
|date_bunneeaght10 = 15 Jerrey Fouyir 2005
|traa_ynnydagh = [[Traa Chadjinit yn Arabaght|AST]]
|ashchur_utc = +03:00
|cctld = {{Ubl|[[.iq]]|[[.العراق]]}}
|coad_çhellvane = 964
}}
She çheer 'syn [[yn Aishey|Aishey]] ee '''yn Earack'''. T'ee çhemmit liorish [[Yn Turkee|y Turkee]] da'n twoaie, [[yn Eeraan]] da'n shiar, [[Yn Choowait|y Choowait]] da'n jiass, liorish [[yn Araab Saudi]] da'n sheear yiass, as liorish [[Yn Jordaan|y Jordaan]] as [[Yn Teer|y Teer]] da'n sheear. She [[Baghdad]] y [[preeu-valley]].
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Commeeys Arabagh}}
{{Gurneil eaghtyrys}}
{{Coord|33|N|44|E|type:country_region:IQ|display=title}}
{{DEFAULTSORT:Earack, Yn}}
{{bun}}
[[Ronney:Yn Earack| ]]
[[Ronney:Pobblaghtyn conastagh]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey yn Chommeeys Arabagh]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1932]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
[[Ronney:Çheeraghyn yn Aishey]]
qs59od9ucth16nc1wlnnhie01fy8pqh
Yn Eeraan
0
2997
394758
383568
2026-10-18T21:22:55Z
MacTire02
219
++; ny smoo ry-yannoo
394758
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Pobblaght Islamagh yn Eeraan
|ennym_foddey_cadjincliaghtagh= {{lang|fa|جمهوری اسلامی ایران}} {{small|([[Pershish]])}}<br />{{small|{{transliteration|fa|Jomhuri-ye Eslâmi-ye Irân}}}}
|ennym_gienneydagh = yn Eeraan
|jalloo_brattagh = Flag of Iran.svg
|jalloo_cleinney = Coat of arms of Iran.svg
|jalloo_caslys = Iran (orthographic projection).svg
|jarroo-raa = {{lang|ar|اَللَّٰهُ أَكْبَرُ}}
|çhengey_jarroo-raa = Arabish
|tessen-lettyraghey_jarroo-raa= {{transliteration|ar|Allāhu ʾAkbar}} (''[[Takbir]]'')
|çhyndaa_jarroo-raa = She [[Jee 'syn Islam|Jee]] y Fer Share
|jarroo-raa2 = {{lang|fa|استقلال، آزادی، جمهوری اسلامی}}
|tessen-lettyraghey_jarroo-raa2={{transliteration|fa|Esteghlâl, Âzâdi, Jomhuri-ye Eslâmi}}
|çhyndaa_jarroo-raa2 = Neuchrogheydys, seyrsnys, y Phobblaght Islamagh
|çhengey_jarroo-raa2 = Pershish
|arrane_ashoonagh = {{lang|fa|[[Arrane Ashoonagh Phobblaght Islamagh yn Eeraan|سرود ملی جمهوری اسلامی ایران]]}}
|tessen-lettyraghey_arrane_ashoonagh={{tessen-lettyraghey|fa|Sorud-e Melli-ye Jomhuri-ye Eslâmi-ye Irân}}
|çhyndaa_arrane_ashoonagh = {{nowrap|"Arrane Ashoonagh Phobblaght Islamagh yn Eeraan"}}
|coadan_arrane_ashoonagh = Sorud-e Mellí-e Yomhurí-e Eslamí-e Irán (instrumental).oga
|çhengey_arrane_ashoonagh = Pershish
|çhengaghyn_oikoil = [[Pershish]]
|craueeaght = {{tree list}}
* 99.4% [[Yn Islam 'syn Eeraan|Yn Islam]]
** 90–95% [[Yn Islam Shia|Shia]] ([[craueeaght steat|oikoil]])
** 5–10% [[Yn Islam Sunni|Sunni]]
* 0.6% [[Craueeaght 'syn Eeraan|elley]] (myr [[Yn Chreestiaght 'syn Eeraan|Creesteenyn]], [[Yn Toroastrianaght 'syn eeraan|Soroastrianee]], [[Yn Ewaghys 'syn Eeraan|Ewnyn]])
{{tree list/end}}
|imraa_craueeaght = <ref name="USCIRF-2026">{{cite report |title=Iran 2026 Annual Report |url=https://www.uscirf.gov/sites/default/files/2026-03/USCIRF%202026%20Annual%20Report%20Iran.pdf |publisher=[[United States Commission on International Religious Freedom]] |date=Averil 2026 |access-date=18 Averil 2026}}</ref>
|blein_craueeaght = 2026
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght Islamagh]] jeelagh [[corys eaghtyraneagh|eaghtyraneagh]]{{efn|Ta'n pooar jerrinagh jeelsit 'syn [[Ard-toshiagh yn Eeraan|Ard-toshiagh]], oik ta ny s'yrjey na'n Eaghtyrane.}} fo jaghteyraght [[smaghtys|smaghtagh]]{{refn|name=authoritarian-dictatorship|
* {{cite web |title=Democracy Index 2025 |url=https://www.eiu.com/n/campaigns/democracy-index-2025/ |website=[[Economist Intelligence Unit]] |access-date=18 Averil 2026 |date=2025}}
* {{cite web |title=Iran: Freedom in the World 2025 Country Report |publisher=[[Freedom House]] |year=2025 |url=https://freedomhouse.org/country/iran/freedom-world/2025 |access-date=7 Mean Souree 2026}}
* {{cite encyclopedia |last=Zeidan |first=Adam |title=Supreme leader of Iran |encyclopedia=[[Encyclopædia Britannica]] |url=https://www.britannica.com/topic/supreme-leader-of-Iran |access-date=7 Mean Souree 2026}}
}}
|ushtey_sy_cheead = 0.7
|blein_LTS_CCK = 2007
|LTS_CCK = $753 billoon
|LTS_CCK_yn_dooinney = $10,624
|sorçh_kiondeeaght = Co-unnaneys
|note_kiondeeaght =
|taghyrt1_bunnit = [[Reeriaght Vedeagh]]
|date1_bunnit = 625 RC
|taghyrt2_bunnit = [[Reeraghtys Hafavidagh]]
|date2_bunnit = [[1501]]
|taghyrt3_bunnit = Fogrey magh Phobblaght Islamagh
|date3_bunnit = 1 Averil 1979
|traa_ynnydagh = [[Traa Cadjinit yn Eeraan|IRST]]
|ashchur_utc = +3:30
|traa_ynnydagh_TTLS =
|ashchur_utc_TTLS =
|cctld = [[.ir]]
|coad_çhellvane = 98
}}
She çheer 'syn [[yn Aishey|Aishey]] ee '''yn Eeraan'''. T'ee çhemmit liorish [[yn Earack]] da'n sheear, liorish [[Yn Turkee|y Turkee]], [[yn Armeain]] as [[yn Asserbajaan]] da'n sheear hwoaie, liorish [[yn Turkmenistaan|y Turkmenistaan]] da'n twoaie, as liorish [[yn Afghanistaan]] as [[Yn Phakistaan|y Phakistaan]] da'n shiar. She [[Tehran]] y [[preeu-valley]].
== Noteyn ==
{{notelist}}
== Imraaghyn ==
{{reflist}}
{{Yn Aishey}}
{{Gurneil eaghtyrys}}
{{#invoke:Coordinates|coord|32|N|53|E|dim:1000km_type:country_region:IR|format=dms|display=title}}
{{DEFAULTSORT:Eeraan, Yn}}
{{bun}}
[[Ronney:Yn Eeraan| ]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Çheeraghyn y G15]]
[[Ronney:Ard-chlaare yn Eeraan]]
[[Ronney:Pobblaghtyn Islamagh]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy 6oo eash RC]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1979]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
[[Ronney:Bunneeaghtyn 'syn Eeraan 'sy vlein 1979]]
[[Ronney:Aa-vonarkaghtyn yn Aishey Heear]]
[[Ronney:Çheeraghyn-oltey D-8]]
[[Ronney:Jeelaghtyn]]
[[Ronney:Craueeaght as politickaght]]
i6pet6o0xd6samyrm33spn8eu6836xg
394761
394758
2026-10-19T01:19:52Z
MacTire02
219
++
394761
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Pobblaght Islamagh yn Eeraan
|ennym_foddey_cadjincliaghtagh= {{lang|fa|جمهوری اسلامی ایران}} {{small|([[Pershish]])}}<br />{{small|{{transliteration|fa|Jomhuri-ye Eslâmi-ye Irân}}}}
|ennym_gienneydagh = yn Eeraan
|jalloo_brattagh = Flag of Iran.svg
|jalloo_cleinney = Coat of arms of Iran.svg
|jalloo_caslys = Iran (orthographic projection).svg
|jarroo-raa = {{lang|ar|اَللَّٰهُ أَكْبَرُ}}
|çhengey_jarroo-raa = Arabish
|tessen-lettyraghey_jarroo-raa= {{transliteration|ar|Allāhu ʾAkbar}} (''[[Takbir]]'')
|çhyndaa_jarroo-raa = She [[Jee 'syn Islam|Jee]] y Fer Share
|jarroo-raa2 = {{lang|fa|استقلال، آزادی، جمهوری اسلامی}}
|tessen-lettyraghey_jarroo-raa2={{transliteration|fa|Esteghlâl, Âzâdi, Jomhuri-ye Eslâmi}}
|çhyndaa_jarroo-raa2 = Neuchrogheydys, seyrsnys, y Phobblaght Islamagh
|çhengey_jarroo-raa2 = Pershish
|arrane_ashoonagh = {{lang|fa|[[Arrane Ashoonagh Phobblaght Islamagh yn Eeraan|سرود ملی جمهوری اسلامی ایران]]}}
|tessen-lettyraghey_arrane_ashoonagh={{tessen-lettyraghey|fa|Sorud-e Melli-ye Jomhuri-ye Eslâmi-ye Irân}}
|çhyndaa_arrane_ashoonagh = {{nowrap|"Arrane Ashoonagh Phobblaght Islamagh yn Eeraan"}}
|coadan_arrane_ashoonagh = Sorud-e Mellí-e Yomhurí-e Eslamí-e Irán (instrumental).oga
|çhengey_arrane_ashoonagh = Pershish
|çhengaghyn_oikoil = [[Pershish]]
|craueeaght = {{tree list}}
* 99.4% [[Yn Islam 'syn Eeraan|Yn Islam]]
** 90–95% [[Yn Islam Shia|Shia]] ([[craueeaght steat|oikoil]])
** 5–10% [[Yn Islam Sunni|Sunni]]
* 0.6% [[Craueeaght 'syn Eeraan|elley]] (myr [[Yn Chreestiaght 'syn Eeraan|Creesteenyn]], [[Yn Toroastrianaght 'syn eeraan|Soroastrianee]], [[Yn Ewaghys 'syn Eeraan|Ewnyn]])
{{tree list/end}}
|imraa_craueeaght = <ref name="USCIRF-2026">{{cite report |title=Iran 2026 Annual Report |url=https://www.uscirf.gov/sites/default/files/2026-03/USCIRF%202026%20Annual%20Report%20Iran.pdf |publisher=[[United States Commission on International Religious Freedom]] |date=Averil 2026 |access-date=18 Averil 2026}}</ref>
|blein_craueeaght = 2026
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght Islamagh]] jeelagh [[corys eaghtyraneagh|eaghtyraneagh]]{{efn|Ta'n pooar jerrinagh jeelsit 'syn [[Ard-toshiagh yn Eeraan|Ard-toshiagh]], oik ta ny s'yrjey na'n Eaghtyrane.}} fo jaghteyraght [[smaghtys|smaghtagh]]{{refn|name=authoritarian-dictatorship|
* {{cite web |title=Democracy Index 2025 |url=https://www.eiu.com/n/campaigns/democracy-index-2025/ |website=[[Economist Intelligence Unit]] |access-date=18 Averil 2026 |date=2025}}
* {{cite web |title=Iran: Freedom in the World 2025 Country Report |publisher=[[Freedom House]] |year=2025 |url=https://freedomhouse.org/country/iran/freedom-world/2025 |access-date=7 Mean Souree 2026}}
* {{cite encyclopedia |last=Zeidan |first=Adam |title=Supreme leader of Iran |encyclopedia=[[Encyclopædia Britannica]] |url=https://www.britannica.com/topic/supreme-leader-of-Iran |access-date=7 Mean Souree 2026}}
}}
|ushtey_sy_cheead = 0.7
|blein_LTS_CCK = 2007
|LTS_CCK = $753 billoon
|LTS_CCK_yn_dooinney = $10,624
|sorçh_kiondeeaght = [[Shennaghys yn Eeraan|Crooaght]]
|taghyrt_bunneeaght1 = [[Reeriaght Media]]
|date_bunneeaght1 = {{circa|678 RC}}
|taghyrt_bunneeaght2 = [[Yn Impiraght Achaemenidagh]]
|date_bunneeaght2 = 550 RC
|taghyrt_bunneeaght3 = [[Yn Impiraght Pharthiagh]]
|date_bunneeaght3 = 247 RC
|taghyrt_bunneeaght4 = [[Yn Impiraght Hasaniagh]]
|date_bunneeaght4 = 224 BNJ
|taghyrt_bunneeaght5 = [[Eddyrchloie yn Eeraan]]
|date_bunneeaght5 = 821
|taghyrt_bunneeaght6 = [[Yn Eeraan Hafavidagh]]
|date_bunneeaght6 = 22 Mee ny Nollick 1501
|taghyrt_bunneeaght7 = [[Yn Eeraan Afsharidagh]]
|date_bunneeaght7 = 22 Jerrey Geuree 1736
|taghyrt_bunneeaght8 = [[Yn Eeraan Zand]]
|date_bunneeaght8 = 1751
|taghyrt_bunneeaght9 = [[Yn Eeraan Qajar]]
|date_bunneeaght9 = 20 Mayrnt 1794
|taghyrt_bunneeaght10= [[Bun-chaghlaa Bunraghtoil y Phershey|Y Bun-chaghlaa Bunraghtoil]]
|date_bunneeaght10 = 12 Mee ny Nollick 1905
|taghyrt_bunneeaght11= [[Yn Eeraan Phahlavagh]]
|date_bunneeaght11 = 15 Mee ny Nollick 1925
|taghyrt_bunneeaght12= [[Bun-chaghlaa yn Eeraan]]
|date_bunneeaght12 = 11 Toshiaght Arree 1979
|taghyrt_bunneeaght13= [[Refrane Phobblaght Islamagh yn Eeraan, 1979|Bunneeaght y Phobblaght Islamagh]]
|date_bunneeaght13 = 1 Averil 1979
|taghyrt_bunneeaght14= [[Bunraght yn Eeraan|Bunraght roie]]
|date_bunneeaght14 = 3 Mee ny Nollick 1979
|taghyrt_bunneeaght15= [[Refrane bunraghtoil yn Eeraan, 1989|Lhiasaghey bunraghtoil]]
|date_bunneeaght15 = 28 Jerrey Souree 1989
|traa_ynnydagh = [[Traa Chadjinit yn Eeraan|IRST]]
|ashchur_utc = +03:30
|cctld = {{Ubl|[[.ir]]|[[ایران.]]}}
|coad_çhellvane = 98
}}
She çheer 'syn [[yn Aishey|Aishey]] ee '''yn Eeraan'''. T'ee çhemmit liorish [[yn Earack]] da'n sheear, liorish [[Yn Turkee|y Turkee]], [[yn Armeain]] as [[yn Asserbajaan]] da'n sheear hwoaie, liorish [[yn Turkmenistaan|y Turkmenistaan]] da'n twoaie, as liorish [[yn Afghanistaan]] as [[Yn Phakistaan|y Phakistaan]] da'n shiar. She [[Tehran]] y [[preeu-valley]].
== Noteyn ==
{{notelist}}
== Imraaghyn ==
{{reflist}}
{{Yn Aishey}}
{{Gurneil eaghtyrys}}
{{#invoke:Coordinates|coord|32|N|53|E|dim:1000km_type:country_region:IR|format=dms|display=title}}
{{DEFAULTSORT:Eeraan, Yn}}
{{bun}}
[[Ronney:Yn Eeraan| ]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Çheeraghyn y G15]]
[[Ronney:Ard-chlaare yn Eeraan]]
[[Ronney:Pobblaghtyn Islamagh]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy 6oo eash RC]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1979]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
[[Ronney:Bunneeaghtyn 'syn Eeraan 'sy vlein 1979]]
[[Ronney:Aa-vonarkaghtyn yn Aishey Heear]]
[[Ronney:Çheeraghyn-oltey D-8]]
[[Ronney:Jeelaghtyn]]
[[Ronney:Craueeaght as politickaght]]
4dmxghu9879cew1isi4jpn6928yw924
394762
394761
2026-10-19T01:20:34Z
MacTire02
219
++
394762
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Pobblaght Islamagh yn Eeraan
|ennym_foddey_cadjincliaghtagh= {{lang|fa|جمهوری اسلامی ایران}} {{small|([[Pershish]])}}<br />{{small|{{transliteration|fa|Jomhuri-ye Eslâmi-ye Irân}}}}
|ennym_gienneydagh = yn Eeraan
|jalloo_brattagh = Flag of Iran.svg
|jalloo_cleinney = Coat of arms of Iran.svg
|jalloo_caslys = Iran (orthographic projection).svg
|jarroo-raa = {{lang|ar|اَللَّٰهُ أَكْبَرُ}}
|çhengey_jarroo-raa = Arabish
|tessen-lettyraghey_jarroo-raa= {{transliteration|ar|Allāhu ʾAkbar}} (''[[Takbir]]'')
|çhyndaa_jarroo-raa = She [[Jee 'syn Islam|Jee]] y Fer Share
|jarroo-raa2 = {{lang|fa|استقلال، آزادی، جمهوری اسلامی}}
|tessen-lettyraghey_jarroo-raa2={{transliteration|fa|Esteghlâl, Âzâdi, Jomhuri-ye Eslâmi}}
|çhyndaa_jarroo-raa2 = Neuchrogheydys, seyrsnys, y Phobblaght Islamagh
|çhengey_jarroo-raa2 = Pershish
|arrane_ashoonagh = {{lang|fa|[[Arrane Ashoonagh Phobblaght Islamagh yn Eeraan|سرود ملی جمهوری اسلامی ایران]]}}
|tessen-lettyraghey_arrane_ashoonagh={{tessen-lettyraghey|fa|Sorud-e Melli-ye Jomhuri-ye Eslâmi-ye Irân}}
|çhyndaa_arrane_ashoonagh = {{nowrap|"Arrane Ashoonagh Phobblaght Islamagh yn Eeraan"}}
|coadan_arrane_ashoonagh = Sorud-e Mellí-e Yomhurí-e Eslamí-e Irán (instrumental).oga
|çhengey_arrane_ashoonagh = Pershish
|çhengaghyn_oikoil = [[Pershish]]
|craueeaght = {{tree list}}
* 99.4% [[Yn Islam 'syn Eeraan|Yn Islam]]
** 90–95% [[Yn Islam Shia|Shia]] ([[craueeaght steat|oikoil]])
** 5–10% [[Yn Islam Sunni|Sunni]]
* 0.6% [[Craueeaght 'syn Eeraan|elley]] (myr [[Yn Chreestiaght 'syn Eeraan|Creesteenyn]], [[Yn Toroastrianaght 'syn eeraan|Soroastrianee]], [[Yn Ewaghys 'syn Eeraan|Ewnyn]])
{{tree list/end}}
|imraa_craueeaght = <ref name="USCIRF-2026">{{cite report |title=Iran 2026 Annual Report |url=https://www.uscirf.gov/sites/default/files/2026-03/USCIRF%202026%20Annual%20Report%20Iran.pdf |publisher=[[United States Commission on International Religious Freedom]] |date=Averil 2026 |access-date=18 Averil 2026}}</ref>
|blein_craueeaght = 2026
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Pobblaght Islamagh]] jeelagh [[corys eaghtyraneagh|eaghtyraneagh]]{{efn|Ta'n pooar jerrinagh jeelsit 'syn [[Ard-toshiagh yn Eeraan|Ard-toshiagh]], oik ta ny s'yrjey na'n Eaghtyrane.}} fo jaghteyraght [[smaghtys|smaghtagh]]{{refn|name=authoritarian-dictatorship|
* {{cite web |title=Democracy Index 2025 |url=https://www.eiu.com/n/campaigns/democracy-index-2025/ |website=[[Economist Intelligence Unit]] |access-date=18 Averil 2026 |date=2025}}
* {{cite web |title=Iran: Freedom in the World 2025 Country Report |publisher=[[Freedom House]] |year=2025 |url=https://freedomhouse.org/country/iran/freedom-world/2025 |access-date=7 Mean Souree 2026}}
* {{cite encyclopedia |last=Zeidan |first=Adam |title=Supreme leader of Iran |encyclopedia=[[Encyclopædia Britannica]] |url=https://www.britannica.com/topic/supreme-leader-of-Iran |access-date=7 Mean Souree 2026}}
}}
|ushtey_sy_cheead = 0.7
|blein_LTS_CCK = 2007
|LTS_CCK = $753 billoon
|LTS_CCK_yn_dooinney = $10,624
|sorçh_kiondeeaght = [[Shennaghys yn Eeraan|Crooaght]]
|taghyrt_bunneeaght1 = [[Reeriaght Media]]
|date_bunneeaght1 = {{circa|678 RC}}
|taghyrt_bunneeaght2 = [[Yn Impiraght Achaemenidagh]]
|date_bunneeaght2 = 550 RC
|taghyrt_bunneeaght3 = [[Yn Impiraght Pharthiagh]]
|date_bunneeaght3 = 247 RC
|taghyrt_bunneeaght4 = [[Yn Impiraght Hasaniagh]]
|date_bunneeaght4 = 224 BNJ
|taghyrt_bunneeaght5 = [[Eddyrchloie yn Eeraan]]
|date_bunneeaght5 = 821
|taghyrt_bunneeaght6 = [[Yn Eeraan Hafavidagh]]
|date_bunneeaght6 = 22 Mee ny Nollick 1501
|taghyrt_bunneeaght7 = [[Yn Eeraan Afsharidagh]]
|date_bunneeaght7 = 22 Jerrey Geuree 1736
|taghyrt_bunneeaght8 = [[Yn Eeraan Zand]]
|date_bunneeaght8 = 1751
|taghyrt_bunneeaght9 = [[Yn Eeraan Qajar]]
|date_bunneeaght9 = 20 Mayrnt 1794
|taghyrt_bunneeaght10= [[Bun-chaghlaa Bunraghtoil y Phershey|Y Bun-chaghlaa Bunraghtoil]]
|date_bunneeaght10 = 12 Mee ny Nollick 1905
|taghyrt_bunneeaght11= [[Yn Eeraan Phahlavagh]]
|date_bunneeaght11 = 15 Mee ny Nollick 1925
|taghyrt_bunneeaght12= [[Bun-chaghlaa yn Eeraan]]
|date_bunneeaght12 = 11 Toshiaght Arree 1979
|taghyrt_bunneeaght13= [[Refrane Phobblaght Islamagh yn Eeraan, 1979|Bunneeaght y Phobblaght Islamagh]]
|date_bunneeaght13 = 1 Averil 1979
|taghyrt_bunneeaght14= [[Bunraght yn Eeraan|Bunraght roie]]
|date_bunneeaght14 = 3 Mee ny Nollick 1979
|taghyrt_bunneeaght15= [[Refrane bunraghtoil yn Eeraan, 1989|Lhiasaghey bunraghtoil]]
|date_bunneeaght15 = 28 Jerrey Souree 1989
|traa_ynnydagh = [[Traa Chadjinit yn Eeraan|IRST]]
|ashchur_utc = +03:30
|cctld = {{Ubl|[[.ir]]|[[ایران.]]}}
|coad_çhellvane = 98
}}
She çheer 'syn [[yn Aishey|Aishey]] ee '''yn Eeraan'''. T'ee çhemmit liorish [[yn Earack]] da'n sheear, liorish [[Yn Turkee|y Turkee]], [[yn Armeain]] as [[yn Asserbajaan]] da'n sheear hwoaie, liorish [[yn Turkmenistaan|y Turkmenistaan]] da'n twoaie, as liorish [[yn Afghanistaan]] as [[Yn Phakistaan|y Phakistaan]] da'n shiar. She [[Tehran]] y [[preeu-valley]].
== Noteyn ==
{{notelist}}
== Imraaghyn ==
{{reflist}}
{{Yn Aishey}}
{{Gurneil eaghtyrys}}
{{#invoke:Coordinates|coord|32|N|53|E|dim:1000km_type:country_region:IR|format=dms|display=title}}
{{DEFAULTSORT:Eeraan, Yn}}
{{bun}}
[[Ronney:Yn Eeraan| ]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Çheeraghyn y G15]]
[[Ronney:Ard-chlaare yn Eeraan]]
[[Ronney:Pobblaghtyn Islamagh]]
[[Ronney:Ashoonyn BRICS]]
[[Ronney:Çheeraghyn-oltey OPEC]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy 6oo eash RC]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1979]]
[[Ronney:Çheeraghyn yn Aishey Heear]]
[[Ronney:Bunneeaghtyn 'syn Eeraan 'sy vlein 1979]]
[[Ronney:Eear-vonarkaghtyn yn Aishey Heear]]
[[Ronney:Çheeraghyn-oltey D-8]]
[[Ronney:Jeelaghtyn]]
[[Ronney:Craueeaght as politickaght]]
2c7xsykkgmxmo15g47542qpq9mr4zu8
Yn Indoneesh
0
3010
394770
359857
2026-10-19T02:36:09Z
MacTire02
219
++
394770
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Pobblaght yn Indoneesh
|ennym_foddey_cadjincliaghtagh= {{lang|id|Republik Indonesia|italics=no}} {{small|([[Indoneeshish]])}}
|ennym_gienneydagh = yn Indoneesh
|jalloo_brattagh = Flag of Indonesia.svg
|jalloo_cleinney = Coat of Arms of Indonesia Garuda Pancasila.svg
|jalloo_caslys = Indonesia_(orthographic_projection).svg
|jarroo-raa = {{lang|kaw|[[Bhinneka Tunggal Ika]]}}
|çhengey_jarroo-raa = Shenn Javanish
|çhyndaa_jarroo-raa = Unnaneaght 'syn Anchaslid
|arrane_ashoonagh = {{lang|id|[[Indonesia Raya]]|italics=no}}
|çhyndaa_arrane_ashoonagh = Yn Indoneesh Vooar
|çhengey_arrane_ashoonagh = Indoneesh
|coadan_arrane_ashoonagh = Indonesia Raya instrumental.ogg
|çhengaghyn_oikoil = [[Indoneeshish]]
|sorçh_reiltys = [[Pobblaght eaghtyraneagh]] [[steat unnaneagh|unnaneagh]]
|ushtey_sy_cheead = 4.85
|blein_LTS_CCK = 2007
|LTS_CCK = $837.8 billoon
|LTS_CCK_yn_dooinney = $3,725
|LTS_ennymagh = $433 billoon
|sorçh_kiondeeaght = [[Bun-chaghlaa Ashoonagh yn Indoneesh|Neuchrogheydys]]
|note_kiondeeaght = veih'n [[Impiraght choloinagh y Çheer Injil|Çheer Injil]]
|taghyrt_bunneeaght1 = [[Fogrey Magh Neuchrogheydys yn Indoneesh|Fogrey magh]]
|date_bunneeaght1 = 17 Luanistyn 1945
|taghyrt_bunneeaght2 = [[Yn Cho-whaiyl Voayrd Cruinn Ollanagh–Indoneeshagh|Enney]]
|date_bunneeaght2 = 27 Mee ny Nollick 1949
|traa_ynnydagh = [[Traa 'syn Indonesia|WIB, WITA, WIT]]
|ashchur_utc = [[UTC+07:00]], [[UTC+08:00|+08:00]], [[UTC+09:00|09:00]]
|cctld = [[.id]]
|coad_çhellvane = 62
}}
She çheer ayns [[yn Aishey]] ee '''yn Indoneesh'''. T'eh çhemmit liorish [[Yn Valaysia|y Valaysia]] da'n twoaie, [[Yn Noa Ghuinea-Phapua|y Noa Ghuinea-Phapua]] da'n shiar, as liorish [[yn Teemor Hiar|y Teemor Hiar]] da'n shiar yiass. She [[Jakarta]] yn [[preeu-valley]].
==Imraaghyn==
{{reflist}}
{{Yn Aishey}}
{{Yn Faarkeylann}}
{{gurneil eaghtyrys}}
{{bun}}
{{DEFAULTSORT:Indoneesh, Yn}}
[[Ronney:Yn Indoneesh| ]]
[[Ronney:Çheeraghyn yn Aishey]]
[[Ronney:Yn Austrailaishey]]
[[Ronney:Çheeraghyn-oltey ASEAN]]
[[Ronney:Çheeraghyn-oltey Reagheydys y Cho-obbraghey Islamagh]]
[[Ronney:Bunneeaghtyn 'syn Indoneesh 'sy vlein 1945|*]]
[[Ronney:Çheeraghyn ellanagh]]
[[Ronney:Bunneeaghtyn 'syn Aishey 'sy vlein 1945]]
[[Ronney:Bunneeaghtyn 'syn Aishey Hiar Yiass 'sy vlein 1945]]
[[Ronney:Çheeraghyn y Velaneesh]]
[[Ronney:Çheeraghyn-oltey D-8]]
[[Ronney:Çheeraghyn y G20]]
[[Ronney:Çheeraghyn y G15]]
[[Ronney:Eear-heeraghyn-oltey OPEC]]
[[Ronney:Yn Aishey Hiar Yiass Varrey]]
[[Ronney:Çheeraghyn-oltey ny h-Ashoonyn Unnaneysit]]
[[Ronney:Pobblaghtyn]]
[[Ronney:Çheeraghyn yn Aishey Hiar Yiass]]
[[Ronney:Çheeraghyn noa-hynskylit]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1945]]
[[Ronney:Ashoonyn BRICS]]
{{Coord|5|S|120|E|type:country_region:ID|display=title}}
69ix4ym2oxlonhkw5jhe8yoqvmomais
Laue yn Çhelgeyr Mooar
0
9219
394732
367821
2026-10-18T13:35:40Z
~2026-55739-41
24000
/* */
394732
wikitext
text/x-wiki
[[Coadan:Milky Way Arms ssc2008-10.svg|upright=2|thumb|Figgyr 1. Strughtoor aahroggit jeh laueyn caslagh [[Raad Mooar Gorree]]<ref>[https://web.archive.org/web/20120326160806/http://planetquest.jpl.nasa.gov/system/interactable/7/index.html Jeeagh er yn ayrn "Spiral Arms" jeh'n vioghys shoh lesh NASA son sonreeaghtyn].</ref>]]
Ta '''Laue yn Çhelgeyr Mooar''' ny [[laue chaslagh]] jeh [[Raad Mooar Gorree]]. Ta [[Corys ny Greiney]] as [[Yn Dowan|y Dowan]] soit çheusthie jeh. Ta ny h-enmyn y '''Laue Ynnydoil''', y '''Spuir Ynnydoil''' as '''Spuir y Çhelgeyr Vooar''' currit er chammah.
Hooar Laue yn Çhelgeyr Mooar yn ennym echey er oyr y niessid da ny rollageyn ayns co-hollys rollageagh [[Yn Shelgeyr Mooar (co-hollys rollageagh)|y Çhelgeyr Mooar]]. T'eh soit eddyr [[Laue yn Tideyr]] as [[Laue ny Quing]], daa chione jeh kiare laue ayns Raad Mooar Gorree. Çheusthie jeh Laue yn Çhelgeyr Mooar, ta corys ny greiney as y Dowan soit faggys da rimmey sthie y [[Bolgan Ynnydoil|Volgan Ynnydoil]], mygeayrt 8000 [[parsec]] (26,000 [[sollys-vlein]] veih'n [[çheshvean co-rollageyssagh]]).
==Reddyn Messier==
Ta ram [[reddyn Messier]] ry-akin ayns Laue yn Çhelgeyr Mooar:
* [[Çhaglym yn Ollican]] (M6)
* [[Çhaglym Ptolemy]] (M7)
* [[Messier 23|Çhaglym Foshlit M23]]
* [[Messier 25|Çhaglym Foshlit M25]]
* [[Neeal y Tromman]] (M27)
* [[Messier 29|Çhaglym Foshlit M29]]
* [[Messier 34|Çhaglym Foshlit M34]]
* [[Messier 35|Çhaglym Foshlit M35]]
* [[Messier 39|Çhaglym Foshlit M39]]
* [[Winnecke 4]] (M40)
* [[Messier 41|Çhaglym Foshlit M41]]
* [[Neeal y Çhelgeyr Mooar]] (M42)
* [[Messier 43|Neeal De Mairan]]
* [[Çhaglym y Çhelleig]] (M44)
* [[Yn Strilleen (çhaglym rollageagh)|Y Strilleen]] (M45)
* [[Messier 46|Çhaglym Foshlit M46]]
* [[Messier 47|Çhaglym Foshlit M47]]
* [[Messier 48|Çhaglym Foshlit M48]]
* [[Messier 50|Çhaglym Foshlit M50]]
* [[Neeal yn Ainey]] (M57)
* [[Messier 67|Çhaglym Foshlit M67]]
* [[Messier 73|M73]]
* [[Neeal y Tromman Beg]] (M76)
* [[Messier 78|Neeal Skeaylt M78]]
* [[Messier 93|Çhaglym Foshlit M93]]
* [[Neeal y Hullad]] (M97)
== Caslyssyn rollageagh eddyr-obbragh ==
<imagemap>
Coadan:Orion Arm.JPG|frame|center|Y Shelgeyr Mooar as ny laueyn s'niessey (caslys so-chrig)
rect 126 149 188 182 [[Neeal y Chront Rybbanagh]]
rect 285 116 327 145 [[Neeal y Phartan]]
rect 243 245 284 274 [[Neeal y Çhelgeyr Vooar]]
rect 299 288 345 312 [[Neeal y Trifid]]
rect 343 304 384 333 [[Neeal y Vooirlee]]
rect 393 322 434 353 [[Neeal Omega]]
rect 445 322 494 353 [[Neeal yn Urley]]
rect 424 244 483 280 [[Neeal America Hwoaie]]
rect 293 248 319 266 [[Yn Chass|Y Chass]]
rect 225 179 299 246 [[Ny Tree Reeaghyn]]
rect 331 211 368 234 [[Rollage ny Twoaie]]
rect 318 236 353 259 [[Yn Ghrian|Y Ghrian]]
poly 302 176 303 241 315 242 361 177 [[Betelgeuse]]
rect 419 222 458 245 [[Deneb]]
poly 0 123 508 118 637 160 637 217 470 163 0 178 [[Laue yn Whuing]]
poly 2 202 460 201 633 261 637 326 408 260 1 258 [[Laue yn Çhelgeyr Mooar]]
poly 1 284 397 293 633 360 637 477 541 475 357 413 0 400 [[Laue yn Tideyr]]
desc bottom-left
</imagemap>
<imagemap>
Coadan:Nearest_Nebulae_and_Star_clusters.gif|thumb|800px|center|Ny neealyn as ny dhossanyn s'niessey (caslys so-chrig)
rect 396 142 447 173 [[Neeal y Chront Rybbanagh]]
rect 376 230 426 258 [[Neeal yn Oillan]]
rect 463 264 501 292 [[Neeal y Chughlin]]
rect 528 284 576 322 [[Neeal California]]
rect 695 117 741 149 [[Neeal y Chree]]
rect 461 301 494 339 [[Neeal y Çhelgeyr Mooar]]
rect 691 154 739 182 [[Neeal yn Annym]]
rect 568 371 625 405 [[Neeal America Hwoaie]]
rect 643 366 687 402 [[Neeal y Chocoon]]
rect 688 392 761 429 [[Neeal Gamma Cygni]]
rect 594 404 625 444 [[Neeal y Vreid]]
rect 513 541 550 578 [[Neeal y Trifid]]
poly 676 435 690 435 692 427 723 429 726 461 677 461 [[Neeal y Chorran]]
rect 489 597 543 630 [[Neeal y Vooirlee]]
rect 555 592 595 626 [[Neeal Omega]]
rect 574 646 614 689 [[Neeal yn Urley]]
rect 444 633 500 678 [[Neeal Maaig y Chiyt]]
rect 90 502 161 529 [[Neeal Eta Carinae]]
rect 442 37 491 69 [[Neeal y Phartan]]
rect 517 158 547 175 [[Messier 37]]
rect 527 172 559 190 [[Messier 36]]
rect 533 191 563 208 [[Messier 38]]
rect 408 257 434 280 [[Messier 50]]
rect 327 232 357 257 [[Messier 46]]
rect 422 285 454 302 [[Messier 67]]
rect 553 321 582 338 [[Messier 34]]
rect 433 305 461 321 [[Messier 48]]
rect 409 314 435 330 [[Messier 41]]
rect 425 328 456 345 [[Messier 47]]
rect 474 343 500 365 [[Messier 44]]
rect 502 345 528 368 [[Messier 45]]
rect 542 378 568 399 [[Messier 37]]
rect 714 285 748 308 [[Messier 52]]
rect 352 285 379 308 [[Messier 93]]
rect 489 421 513 444 [[Messier 7]]
rect 495 452 518 473 [[Messier 6]]
rect 522 456 549 476 [[Messier 25]]
rect 512 478 539 500 [[Messier 23]]
rect 531 575 555 593 [[Messier 21]]
rect 556 564 589 580 [[Messier 18]]
rect 605 598 640 617 [[Messier 26]]
rect 630 618 654 639 [[Messier 11]]
rect 484 234 510 256 [[Messier 35]]
rect 287 248 316 276 [[NGC 2362]]
rect 370 359 411 381 [[IC 2395]]
rect 359 413 390 449 [[NGC 3114]]
rect 407 396 444 432 [[NGC 3532]]
rect 594 356 644 372 [[IC 1396]]
rect 458 392 502 406 [[IC 2602]]
rect 407 494 443 521 [[NGC 6087]]
rect 437 464 472 497 [[NGC 6025]]
rect 262 478 300 506 [[NGC 3766]]
rect 513 427 554 451 [[NGC 4665]]
rect 181 445 226 472 [[IC 2581]]
rect 212 506 257 526 [[IC 2944]]
rect 213 565 246 598 [[NGC 4755]]
rect 128 463 154 494 [[NGC 3293]]
rect 362 591 392 628 [[NGC 6067]]
rect 404 548 437 587 [[NGC 6193]]
rect 425 595 453 630 [[NGC 6231]]
rect 461 556 498 585 [[NGC 6383]]
rect 58 506 91 521 [[Tr 14]]
rect 77 520 108 536 [[Tr 16]]
rect 797 130 831 153 [[Messier 103]]
rect 665 408 691 434 [[Messier 29]]
rect 746 139 782 157 [[hPer]]
rect 763 117 804 132 [[chi Per]]
rect 152 485 194 500 [[Col 228]]
rect 456 377 492 393 [[o Vel]]
poly 0 0 496 0 841 130 976 221 972 421 633 224 277 129 5 111 [[Laue y Whing]]
poly 2 230 444 239 688 340 970 495 971 639 559 452 317 387 1 380 [[Laue yn Çhelgeyr Mooar]]
poly 2 481 423 492 694 606 922 757 470 761 234 669 1 668 [[Laue yn Tideyr]]
rect 879 666 965 684 [[Çhaglym Rollageagh]]
rect 878 684 944 699 [[Neeal]]
desc bottom-left
</imagemap>
== Jeeagh er neesht ==
* [[Cryss Gould]]
* [[Bolgan Ynnydoil]]
* [[Bolgan Loob I]]
* [[Rolley reddyn Messier]]
* [[Rolley ny rollageyn s'niessey]]
== Imraaghyn ==
{{rolleyimraaghyn}}
== Kianglaghyn magh ==
* [http://www.seds.org/messier/more/mw_m.html Nheeghyn Messier ayns Raad Mooar Ree Gorree (SEDS)] {{en jalloo}}
* [http://www.3dgalaxymap.com/ Caslys 3D jeh Raad Mooar Ree Gorree] {{en jalloo}}
{{Boayl ny Cruinney}}
{{Raad Mooar Gorree}}
{{gurneil eaghtyrys}}
[[Ronney:Laue yn Çhelgeyr Mooar| ]]
[[Ronney:Laueyn Raad Mooar Gorree|Chelgeyr Mooar]]
[[Ronney:Rollageydys co-rollageyssagh]]
[[Ronney:Co-rollageyssyn caslagh]]
nj0con54l70s01mfdggc9bbzadrvkgp
Ymmydeyr:Llywelyn2000/List of Manx people
2
19947
394776
394435
2026-10-19T04:34:04Z
ListeriaBot
10339
Wikidata list updated [V2]
394776
wikitext
text/x-wiki
{{Wikidata list
|sparql=SELECT ?item ?yob ?yod WHERE {
?item wdt:P19 ?pob .
?pob wdt:P131* wd:Q9676 .
OPTIONAL { ?item wdt:P569 ?dob . BIND(YEAR(?dob) as ?yob) }
OPTIONAL { ?item wdt:P570 ?dod . BIND(YEAR(?dod) as ?yod) }
. }
|wdq=.
|sort=569
|section=31
|columns=number:#,P18:XXX Add 'Image' in Manx here please! XXX,label:XXX change to 'Name' in Manx! XXX,?yob:XXX dob XXX,?yod:XXX date of death XXX,P19:xxx Place of birth xxx
}}
== human ==
{| class='wikitable sortable'
! #
! XXX Add 'Image' in Manx here please! XXX
! XXX change to 'Name' in Manx! XXX
! XXX dob XXX
! XXX date of death XXX
! xxx Place of birth xxx
|-
| style='text-align:right'| 1
| [[Coadan:Margaret Jennifer Kewley Draskau in the video 'Lady Derby – The Great Whore of Babylon'.png|center|128px]]
| ''[[:d:Q130730092|Jennifer Kewley Draskau]]''
|
| 2024
| [[Mannin]]
|-
| style='text-align:right'| 2
|
| ''[[:d:Q134487555|Chris Garrett]]''
| 1984
| 2025
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 3
|
| ''[[:d:Q135256163|Michael Higgins]]''
| 1939
| 1988
| [[Mannin]]
|-
| style='text-align:right'| 4
|
| ''[[:d:Q136434024|Albert Hugh Teare]]''
| 1877
| 1932
| [[Rhumsaa]]
|-
| style='text-align:right'| 5
| [[Coadan:Frederick Agnew Gill LCCN2014714984 (cropped).jpg|center|128px]]
| [[Frederick Agnew Gill]]
| 1873
| 1938
| [[Balley Chashtal]]
|-
| style='text-align:right'| 6
|
| ''[[:d:Q75456632|Elizabeth Quayle]]''
|
|
| [[Skeerey Chreest ny h-Ayrey]]
|-
| style='text-align:right'| 7
| [[Coadan:RobinGibb.jpg|center|128px]]
| ''[[:d:Q188482|Robin Gibb]]''
| 1949
| 2012
| [[Doolish]]
|-
| style='text-align:right'| 8
| [[Coadan:Maurice Gibb (Bee Gees) - TopPop 1973 (cropped).png|center|128px]]
| ''[[:d:Q296876|Maurice Gibb]]''
| 1949
| 2003
| [[Doolish]]
|-
| style='text-align:right'| 9
|
| [[Randolph Quirk]]
| 1920
| 2017
| [[Maayl]]
|-
| style='text-align:right'| 10
|
| [[Ned Maddrell]]
| 1877
| 1974
| [[Creneash]]
|-
| style='text-align:right'| 11
| [[Coadan:Rhodri Mawr - Historiae Cambriae.png|center|128px]]
| ''[[:d:Q470862|Rhodri Mawr]]''
| 820
| 878
| [[Mannin]]
|-
| style='text-align:right'| 12
| [[Coadan:John Thomas Caine.jpg|center|128px]]
| ''[[:d:Q964884|John Thomas Caine]]''
| 1829
| 1911
| [[Mannin]]
|-
| style='text-align:right'| 13
|
| ''[[:d:Q1064177|Charles Duncan Cameron]]''
| 1825
| 1870
| [[Doolish]]
|-
| style='text-align:right'| 14
|
| [[Chris Killip]]
| 1946
| 2020
| [[Doolish]]
|-
| style='text-align:right'| 15
| [[Coadan:Edward Forbes.jpg|center|128px]]
| [[Edward Forbes]]
| 1815
| 1854
| [[Doolish]]
|-
| style='text-align:right'| 16
| [[Coadan:Peter Heywood, by John Simpson.jpg|center|128px]]
| ''[[:d:Q1370965|Peter Heywood]]''
| 1772
| 1831
| [[Doolish]]
|-
| style='text-align:right'| 17
| [[Coadan:Eredoctoraten UvA nr. 21, 22 Charles B. Timmer , nr. 1 20 prof. J. Frank Kerm, Bestanddeelnr 934-1653.jpg|center|128px]]
| [[Frank Kermode]]
| 1919
| 2010
| [[Doolish]]
|-
| style='text-align:right'| 18
| [[Coadan:Hugh Binney.jpeg|center|128px]]
| ''[[:d:Q1634227|Hugh Binney]]''
| 1883
| 1953
| [[Doolish]]
|-
| style='text-align:right'| 19
|
| ''[[:d:Q2025044|Daniel Lowey]]''
| 1878
| 1951
| [[Rhumsaa]]
|-
| style='text-align:right'| 20
| [[Coadan:Gofraid Crobán (British Library Cotton MS Julius A VII, folio 50v).jpg|center|128px]]
| [[Gorree Crovan]]
| 1050
| 1095
| [[Mannin]]
|-
| style='text-align:right'| 21
| [[Coadan:MikeKerruish.jpg|center|128px]]
| [[Mike Kerruish]]
| 1948
| 2010
| [[Mannin]]
|-
| style='text-align:right'| 22
| [[Coadan:Brian Stowell - Gaisgeach na Gaelg.jpg|center|128px]]
| [[Brian Stowell]]
| 1936
| 2019
| [[Doolish]]
|-
| style='text-align:right'| 23
| [[Coadan:Archibald Knox.jpg|center|128px]]
| ''[[:d:Q2860090|Archibald Knox]]''
| 1864
| 1933
| [[Mannin]]
|-
| style='text-align:right'| 24
| [[Coadan:Goshen-Routh 10.jpg|center|128px]]
| [[Arthur Caley]]
| 1824
| 1889
| [[Skeerey Chreest ny h-Ayrey]]
|-
| style='text-align:right'| 25
|
| ''[[:d:Q2917082|Peter Buckley]]''
| 1944
| 1969
| [[Doolish]]
|-
| style='text-align:right'| 26
|
| ''[[:d:Q2960723|Charles de Viry]]''
| 1809
| 1888
| [[Doolish]]
|-
| style='text-align:right'| 27
|
| ''[[:d:Q2979086|Clifford Irving]]''
| 1914
| 2004
| [[Mannin]]
|-
| style='text-align:right'| 28
|
| ''[[:d:Q3048476|Edward Christian]]''
| 1600<br/>1590
| 1659<br/>1661
| [[Mannin]]
|-
| style='text-align:right'| 29
|
| ''[[:d:Q3082831|Frank Tipper]]''
| 1909
| 1963
| [[Doolish]]
|-
| style='text-align:right'| 30
|
| [[Hilary Pritchard]]
| 1942
| 1996
| [[Mannin]]
|-
| style='text-align:right'| 31
| [[Coadan:Illiam Dhone.JPG|center|128px]]
| [[Illiam Dhone]]
| 1608
| 1662<br/>1663
| [[Camys y Ree]]
|-
| style='text-align:right'| 32
| [[Coadan:Captain John Quilliam RN.jpg|center|128px]]
| ''[[:d:Q3182325|John Quilliam]]''
| 1771
| 1829
| [[Mannin]]
|-
| style='text-align:right'| 33
|
| ''[[:d:Q3184768|Joseph Clayton Clark]]''
| 1857
| 1937
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 34
|
| [[Joseph Davidson Qualtrough]]
| 1885
| 1960
| [[Mannin]]
|-
| style='text-align:right'| 35
|
| ''[[:d:Q3375184|Percy Cowley]]''
| 1886
| 1958
| [[Rhumsaa]]
|-
| style='text-align:right'| 36
|
| ''[[:d:Q3780140|Gwen Crellin]]''
| 1917
| 2007
| [[Mannin]]
|-
| style='text-align:right'| 37
|
| ''[[:d:Q4647267|A.P. Penketh]]''
| 1865
| 1932
| [[Mannin]]
|-
| style='text-align:right'| 38
|
| ''[[:d:Q4684998|Adrian Earnshaw]]''
| 1950
| 2022
| [[Mannin]]
|-
| style='text-align:right'| 39
| [[Coadan:AWM 099103 Arnold Potts.jpg|center|128px]]
| ''[[:d:Q4795209|Arnold Potts]]''
| 1896
| 1968
| [[Mannin]]
|-
| style='text-align:right'| 40
| [[Coadan:Arthur William Moore.png|center|128px]]
| [[Arthur William Moore]]
| 1853
| 1909
| [[Doolish]]
|-
| style='text-align:right'| 41
| [[Coadan:Baldwin Wake Walker.jpg|center|128px]]
| ''[[:d:Q4850612|Baldwin Wake Walker]]''
| 1802
| 1876
| ''[[:d:Q3398663|Port e Vullen]]''
|-
| style='text-align:right'| 42
| [[Coadan:Bertram Kelly, vicar.jpg|center|128px]]
| [[Bertram Kelly]]
| 1884
| 1976
| [[Doolish]]
|-
| style='text-align:right'| 43
|
| [[Bill Malarkey (politickeyr)|Bill Malarkey]]
| 1951
| 2020
| [[Mannin]]
|-
| style='text-align:right'| 44
|
| ''[[:d:Q4980208|Bryan Kneale]]''
| 1930
| 2025
| [[Doolish]]
|-
| style='text-align:right'| 45
|
| [[Charles Kerruish]]
| 1917
| 2003
| [[Mannin]]
|-
| style='text-align:right'| 46
| [[Coadan:TT Lightweight - Dan Kneen (8985019419).jpg|center|128px]]
| ''[[:d:Q5213818|Dan Kneen]]''
| 1987
| 2018
| [[Doolish]]
|-
| style='text-align:right'| 47
|
| ''[[:d:Q5232102|David Callister]]''
| 1935
| 2020
| [[Mannin]]
|-
| style='text-align:right'| 48
|
| ''[[:d:Q5233727|David Forbes]]''
| 1828
| 1876
| [[Doolish]]
|-
| style='text-align:right'| 49
|
| ''[[:d:Q5262311|Derek Robinson]]''
| 1941
| 2002
| [[Mannin]]
|-
| style='text-align:right'| 50
|
| [[Dursley McLinden]]
| 1965
| 1995
| [[Doolish]]
|-
| style='text-align:right'| 51
|
| ''[[:d:Q5339649|Edmund Lowey]]''
| 1938
| 2024
| [[Balley Sallagh]]
|-
| style='text-align:right'| 52
|
| ''[[:d:Q5442313|Felix Fordati Ready]]''
| 1872
| 1940
| [[Balley Sallagh]]
|-
| style='text-align:right'| 53
|
| ''[[:d:Q5534099|Geoff Corkish]]''
| 1953
| 2025
| [[Mannin]]
|-
| style='text-align:right'| 54
|
| ''[[:d:Q5585508|Gordon Manley]]''
| 1902
| 1980
| [[Doolish]]
|-
| style='text-align:right'| 55
|
| ''[[:d:Q5702651|Harry Dacre]]''
| 1860
| 1922
| [[Mannin]]
|-
| style='text-align:right'| 56
| [[Coadan:Hugh Stowell Brown.jpg|center|128px]]
| [[Hugh Stowell Brown]]
| 1823
| 1886
| [[Doolish]]
|-
| style='text-align:right'| 57
|
| [[Jack Nivison]]
| 1910
| 2003
| [[Skeerey Vraddan|Skeerey Braddan]]<br/>[[Kione Droghad]]
|-
| style='text-align:right'| 58
| [[Coadan:James Ashton.jpeg|center|128px]]
| ''[[:d:Q6128902|James Ashton]]''
| 1859
| 1935
| [[Mannin]]
|-
| style='text-align:right'| 59
| [[Coadan:James Kewley Ward 1890.jpg|center|128px]]
| ''[[:d:Q6137285|James Kewley Ward]]''
| 1819
| 1910
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 60
|
| ''[[:d:Q6218777|John Allen Mylrea]]''
| 1849
| 1911
| [[Doolish]]
|-
| style='text-align:right'| 61
|
| [[John Joseph Kneen]]
| 1873
| 1938
| [[Doolish]]
|-
| style='text-align:right'| 62
| [[Coadan:John McHutchin.jpg|center|128px]]
| ''[[:d:Q6247893|John McHutchin]]''
| 1788
| 1847
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 63
| [[Coadan:Paul Lebiedzinski.jpg|center|128px]]
| ''[[:d:Q28810393|Paul Lebiedzinski]]''
| 1951
| 1995
| [[Rhumsaa]]
|-
| style='text-align:right'| 64
| [[Coadan:John Moore Jeffcott.png|center|128px]]
| ''[[:d:Q31201248|John Moore Jeffcott]]''
| 1817
| 1892
| [[Balley Chashtal]]
|-
| style='text-align:right'| 65
| [[Coadan:Stewart Stevenson Moore.jpg|center|128px]]
| ''[[:d:Q37154286|Stewart Stevenson Moore]]''
| 1860
| 1951
| [[Mannin]]
|-
| style='text-align:right'| 66
|
| ''[[:d:Q39070085|John Kelly]]''
| 1793
| 1854
| [[Mannin]]
|-
| style='text-align:right'| 67
| [[Coadan:Snaefell Miners.jpg|center|128px]]
| ''[[:d:Q41757067|John Kewley]]''
| 1832
| 1905
| [[Mannin]]
|-
| style='text-align:right'| 68
| [[Coadan:Elizabeth S. Nutt, A.R.C.A. (I0007923).jpg|center|128px]]
| ''[[:d:Q43196426|Elizabeth Styring Nutt]]''
| 1870
| 1946
| [[Kione Droghad]]
|-
| style='text-align:right'| 69
|
| ''[[:d:Q43606976|Charles Swynnerton]]''
| 1843
| 1923
| [[Mannin]]
|-
| style='text-align:right'| 70
|
| ''[[:d:Q43779525|Mark Hildesley Quayle]]''
| 1804
| 1879
| [[Mannin]]
|-
| style='text-align:right'| 71
|
| ''[[:d:Q43945628|Mark Quayle]]''
| 1770
| 1804
| [[Mannin]]
|-
| style='text-align:right'| 72
|
| ''[[:d:Q44049933|John Quayle]]''
| 1693
| 1755
| [[Mannin]]
|-
| style='text-align:right'| 73
|
| ''[[:d:Q44746168|Mark Quayle]]''
| 1841
| 1928
| [[Mannin]]
|-
| style='text-align:right'| 74
|
| ''[[:d:Q48110870|Joseph Swynnerton]]''
| 1848
| 1910
| [[Doolish]]
|-
| style='text-align:right'| 75
|
| ''[[:d:Q52148110|Jim Caine]]''
| 1926
| 2018
| [[Doolish]]
|-
| style='text-align:right'| 76
|
| ''[[:d:Q53196681|Wilfred Kissack]]''
| 1873
| 1942
| [[Mannin]]
|-
| style='text-align:right'| 77
|
| ''[[:d:Q54553548|Millie Robinson]]''
| 1924
| 1994
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 78
| [[Coadan:Nellie Brennan.jpg|center|128px]]
| ''[[:d:Q55418295|Nelly Brennan]]''
| 1792
| 1859
| [[Doolish]]
|-
| style='text-align:right'| 79
|
| ''[[:d:Q56254209|Thomas Stowell]]''
| 1764
| 1821
| [[Mannin]]
|-
| style='text-align:right'| 80
|
| ''[[:d:Q56452187|Derek Ennett]]''
| 1931
| 1956
| [[Balley Chashtal]]
|-
| style='text-align:right'| 81
|
| ''[[:d:Q56528264|Thomas Tobin]]''
| 1775
| 1863
| [[Doolish]]
|-
| style='text-align:right'| 82
| [[Coadan:John D. LaMothe.jpg|center|128px]]
| ''[[:d:Q56665493|John Dominique LaMothe]]''
| 1868
| 1928
| [[Rhumsaa]]
|-
| style='text-align:right'| 83
|
| ''[[:d:Q56887925|Nina Morrison]]''
| 1915
| 2011
| [[Doolish]]
|-
| style='text-align:right'| 84
|
| [[Dorothy Pantin]]
| 1896
| 1985
| [[Doolish]]
|-
| style='text-align:right'| 85
| [[Coadan:John Quayle (1725 - 1797).png|center|128px]]
| ''[[:d:Q60754040|John Quayle]]''
| 1725
| 1797
| [[Mannin]]
|-
| style='text-align:right'| 86
|
| ''[[:d:Q64685433|Francis Claudius Armstrong]]''
| 1802
| 1872
| [[Mannin]]
|-
| style='text-align:right'| 87
|
| ''[[:d:Q64685645|Hugh Coleman Davidson]]''
| 1852
| 1934
| [[Balley Chashtal]]
|-
| style='text-align:right'| 88
|
| ''[[:d:Q65767130|Pilcher George Ralfe]]''
| 1861
| 1936
| [[Skeerey Chreest ny h-Ayrey]]
|-
| style='text-align:right'| 89
|
| ''[[:d:Q65768017|Frank Stanley Graves]]''
| 1863
| 1935
| [[Skeerey Charmane]]
|-
| style='text-align:right'| 90
|
| ''[[:d:Q66606883|John Joseph Heywood]]''
| 1789
| 1855
| [[Mannin]]
|-
| style='text-align:right'| 91
| [[Coadan:Mona Hirst 1925.jpg|center|128px]]
| ''[[:d:Q70743693|Mona Hirst]]''
| 1903
| 1988
| [[Mannin]]
|-
| style='text-align:right'| 92
| [[Coadan:Emily Maria Gawne.jpg|center|128px]]
| ''[[:d:Q75265312|Emily Maria Gawne]]''
| 1814
| 1889
| [[Doolish]]
|-
| style='text-align:right'| 93
|
| [[Ewan Christian (briw)|Ewan Christian]]
| 1579
| 1655
| [[Skeerey Chreest ny h-Ayrey]]
|-
| style='text-align:right'| 94
| [[Coadan:Portrait of Esther Taubman, née Christian (by George Romney).jpg|center|128px]]
| ''[[:d:Q75456778|Esther Christian]]''
| 1711
| 1802
| [[Rhumsaa]]
|-
| style='text-align:right'| 95
|
| ''[[:d:Q75458718|George Horsley Wood]]''
|
| 1874
| [[Doolish]]
|-
| style='text-align:right'| 96
|
| ''[[:d:Q75460583|Robert Christian]]''
| 1625
| 1668
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 97
|
| ''[[:d:Q75463324|Margaret Moore]]''
| 1733<br/>1730
| 1782<br/>1807
| [[Doolish]]
|-
| style='text-align:right'| 98
|
| ''[[:d:Q75463414|Margaret Moore]]''
| 1736
| 1828
| [[Skeerey Vraddan|Skeerey Braddan]]
|-
| style='text-align:right'| 99
|
| ''[[:d:Q75463447|Margaret Moore]]''
| 1769
| 1804
| [[Skeerey Vraddan|Skeerey Braddan]]
|-
| style='text-align:right'| 100
|
| ''[[:d:Q75946963|Anna Cleather]]''
| 1811
| 1887
| [[Mannin]]
|-
| style='text-align:right'| 101
|
| ''[[:d:Q76142859|Fanny Edith Walters]]''
| 1887
| 1949
| [[Balley Chashtal]]
|-
| style='text-align:right'| 102
|
| ''[[:d:Q76245966|Laura, Lady Buchan]]''
| 1797
| 1888
| [[Doolish]]
|-
| style='text-align:right'| 103
|
| ''[[:d:Q78901420|Edward Ashton Cannell]]''
| 1927
| 1994
| [[Purt Çhiarn]]
|-
| style='text-align:right'| 104
|
| [[Tommy Leece]]
| 1859
| 1956
| [[Skeerey Chairbre]]
|-
| style='text-align:right'| 105
|
| ''[[:d:Q94373906|John Kaighn]]''
| 1660
| 1724
| [[Mannin]]
|-
| style='text-align:right'| 106
| [[Coadan:Leonard McCombe, 1954, NY, Photograh taken by Jun Miki.jpg|center|128px]]
| ''[[:d:Q97066829|Leonard McCombe]]''
| 1923
| 2005
| [[Mannin]]
|-
| style='text-align:right'| 107
|
| [[Edmund Goodwin]]
| 1845
| 1925
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 108
|
| ''[[:d:Q97497011|Lewis Crellin]]''
| 1901
| 1990
| [[Forsdal]]
|-
| style='text-align:right'| 109
|
| ''[[:d:Q97597263|Leslie Quirk]]''
| 1914
| 2004
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 110
|
| ''[[:d:Q98763296|Norman Sayle]]''
| 1926
| 2007
| [[Doolish]]
|-
| style='text-align:right'| 111
|
| ''[[:d:Q101068189|John Quayle-Dickson]]''
| 1860
| 1945
| [[Balley Chashtal]]
|-
| style='text-align:right'| 112
|
| ''[[:d:Q102175647|David W. Lewis]]''
| 1944
| 2021
| [[Doolish]]
|-
| style='text-align:right'| 113
|
| ''[[:d:Q104286259|Ernest Feltus Adams]]''
| 1865
| 1957
| [[Mannin]]
|-
| style='text-align:right'| 114
| [[Coadan:Thomas Leigh-Goldie.jpg|center|128px]]
| ''[[:d:Q109559333|Thomas Leigh Goldie]]''
| 1807
| 1854
| [[Doolish]]
|-
| style='text-align:right'| 115
|
| ''[[:d:Q110806864|John Newlands Thomson]]''
| 1870
| 1948
| [[Purt le Moirrey]]
|-
| style='text-align:right'| 116
|
| ''[[:d:Q112394413|John David Williams]]''
| 1931
| 2005
| [[Doolish]]
|-
| style='text-align:right'| 117
|
| ''[[:d:Q112954595|Letitia Hannah Damer Sandys]]''
| 1840<br/>1833
| 1911
| [[Mannin]]
|-
| style='text-align:right'| 118
|
| ''[[:d:Q114578445|John Wordsworth]]''
| 1845
| 1920
| [[Rhumsaa]]
|-
| style='text-align:right'| 119
|
| ''[[:d:Q120900628|R. S. McCombe]]''
| 1902
| 1985
| [[Doolish]]
|-
| style='text-align:right'| 120
| [[Coadan:Robert Swan Stephen.png|center|128px]]
| ''[[:d:Q121875076|Robert Swan Stephen]]''
| 1843
| 1903
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 121
|
| [[John Quane]]
| 1757
| 1838
| [[Mannin]]
|-
| style='text-align:right'| 122
|
| [[Robert E. Christian]]
| 1817
| 1891
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 123
|
| ''[[:d:Q122381207|Voirrey Irving]]''
| 1918
| 2005
| [[Mannin]]
|-
| style='text-align:right'| 124
| [[Coadan:Charles Lionel Carson (1847–1901).png|center|128px]]
| ''[[:d:Q123558946|Charles Lionel Carson]]''
| 1847
| 1901
| [[Mannin]]
|-
| style='text-align:right'| 125
|
| ''[[:d:Q6387399|Ken Burns]]''
| 1923
| 2006
| [[Rhumsaa]]
|-
| style='text-align:right'| 126
| [[Coadan:Mark Cubbon b1785.jpg|center|128px]]
| ''[[:d:Q6767214|Mark Cubbon]]''
| 1775
| 1861
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 127
| [[Coadan:ColMarkWilks.jpg|center|128px]]
| ''[[:d:Q6770348|Mark Wilks]]''
| 1759
| 1831
| [[Mannin]]
|-
| style='text-align:right'| 128
|
| ''[[:d:Q6777668|Martyn Quayle]]''
| 1959
| 2016
| [[Mannin]]
|-
| style='text-align:right'| 129
|
| ''[[:d:Q7173434|Peter Craine]]''
| 2000
| 2003
| [[Doolish]]
|-
| style='text-align:right'| 130
|
| ''[[:d:Q7324916|Richard Costain]]''
| 1839
| 1902
| [[Mannin]]
|-
| style='text-align:right'| 131
|
| ''[[:d:Q7342026|Robert Benjamin Young]]''
| 1773
| 1846
| [[Doolish]]
|-
| style='text-align:right'| 132
|
| ''[[:d:Q7351285|Robert Wylie]]''
| 1839
| 1877
| [[Mannin]]
|-
| style='text-align:right'| 133
| [[Coadan:Sophia Morrison.jpg|center|128px]]
| [[Sophia Morrison]]
| 1859
| 1917
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 134
|
| ''[[:d:Q7627097|Stuart Slack]]''
| 1935
| 1998
| [[Doolish]]
|-
| style='text-align:right'| 135
| [[Coadan:T. E. Brown (young).jpg|center|128px]]
| ''[[:d:Q7789264|Thomas Edward Brown]]''
| 1830
| 1897
| [[Doolish]]
|-
| style='text-align:right'| 136
|
| ''[[:d:Q7790684|Thomas Hill Dixon]]''
| 1816
| 1880
| [[Mannin]]
|-
| style='text-align:right'| 137
|
| ''[[:d:Q7821311|Toni Onley]]''
| 1928
| 2004
| [[Doolish]]
|-
| style='text-align:right'| 138
|
| [[Walter y Chleree]]
| 1928
| 2007
| [[Rhumsaa]]
|-
| style='text-align:right'| 139
|
| ''[[:d:Q8010366|William H. Corlett]]''
| 1856
| 1937
| [[Mannin]]
|-
| style='text-align:right'| 140
|
| [[William Kennish]]
| 1799
| 1862
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 141
| [[Coadan:William Moore (1898).jpg|center|128px]]
| ''[[:d:Q8015768|William Moore]]''
| 1823
| 1914
| [[Mannin]]
|-
| style='text-align:right'| 142
| [[Coadan:Sir William Rowan.jpg|center|128px]]
| ''[[:d:Q8017805|William Rowan]]''
| 1789
| 1879
| [[Mannin]]
|-
| style='text-align:right'| 143
| [[Coadan:Rushen Abbey.jpg|center|128px]]
| ''[[:d:Q8017850|William Russell]]''
|
| 1374
| [[Mannin]]
|-
| style='text-align:right'| 144
|
| ''[[:d:Q9374876|William Russell]]''
| 1852
| 1940
| [[Doolish]]
|-
| style='text-align:right'| 145
|
| ''[[:d:Q10314191|Kenneth Creer]]''
| 1925
| 2020
| [[Doolish]]
|-
| style='text-align:right'| 146
|
| [[John Kelly (scoillar)|John Kelly]]
| 1750
| 1809
| [[Doolish]]
|-
| style='text-align:right'| 147
|
| [[Noel Cringle]]
| 1937
| 2021
| [[Mannin]]
|-
| style='text-align:right'| 148
| [[Coadan:Edward Faragher.jpeg|center|128px]]
| [[Edward Faragher]]
| 1831
| 1908
| [[Creneash]]
|-
| style='text-align:right'| 149
| [[Coadan:Josephine Kermode (Cushag).jpg|center|128px]]
| [[Josephine Kermode]]
| 1852
| 1937
| [[Rhumsaa]]
|-
| style='text-align:right'| 150
| [[Coadan:Mona Margaret McBURNEY.jpg|center|128px]]
| ''[[:d:Q15433239|Mona McBurney]]''
| 1862
| 1932
| [[Doolish]]
|-
| style='text-align:right'| 151
| [[Coadan:Philip Moore Callow Kermode.png|center|128px]]
| ''[[:d:Q15453822|P. M. C. Kermode]]''
| 1855
| 1932
| [[Rhumsaa]]
|-
| style='text-align:right'| 153
| [[Coadan:Hugo Flinn 1933.png|center|128px]]
| ''[[:d:Q15996075|Hugo Flinn]]''
| 1880
| 1943
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 154
| [[Coadan:Canon John Quine.jpg|center|128px]]
| ''[[:d:Q15997058|John Quine]]''
| 1857
| 1940
| [[Skeerey Charmane]]
|-
| style='text-align:right'| 155
| [[Coadan:W. Walter Gill.jpg|center|128px]]
| ''[[:d:Q16002989|W. Walter Gill]]''
| 1876
| 1963
| [[Mannin]]
|-
| style='text-align:right'| 156
|
| ''[[:d:Q16007058|Harry Korris]]''
| 1891
| 1971
| [[Kione Droghad]]
|-
| style='text-align:right'| 157
| [[Coadan:Christopher R. Shimmin.jpg|center|128px]]
| ''[[:d:Q16029252|Christopher R. Shimmin]]''
| 1870
| 1933
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 158
| [[Coadan:Actress Annie Yeamans, c. 1896.png|center|128px]]
| [[Annie Yeamans]]
| 1835
| 1912
| [[Mannin]]
|-
| style='text-align:right'| 159
| [[Coadan:Robert Q. Kermode.jpg|center|128px]]
| ''[[:d:Q16065654|Robert Kermode]]''
| 1812
| 1870
| [[Mannin]]
|-
| style='text-align:right'| 160
|
| ''[[:d:Q16169661|John Dongan]]''
| 1301
| 1413
| [[Mannin]]
|-
| style='text-align:right'| 161
|
| ''[[:d:Q16200333|Esther Nelson]]''
| 1810
| 1843
| [[Jorby]]
|-
| style='text-align:right'| 162
| [[Coadan:Kathleen Faragher.jpg|center|128px]]
| [[Kathleen Faragher]]
| 1904
| 1974
| [[Rhumsaa]]
|-
| style='text-align:right'| 163
|
| ''[[:d:Q16825531|Stewart Henbest Capper]]''
| 1859
| 1925
| [[Lunnin]]<br/>[[Doolish]]
|-
| style='text-align:right'| 164
|
| ''[[:d:Q17182825|William Garrett]]''
| 1842
| 1916
| [[Mannin]]
|-
| style='text-align:right'| 165
|
| ''[[:d:Q17309064|Charles Gibbon]]''
| 1843
| 1890
| [[Mannin]]
|-
| style='text-align:right'| 166
| [[Coadan:Plexus (1901) (14597471297).jpg|center|128px]]
| ''[[:d:Q18157096|William Edward Quine]]''
| 1847
| 1922
| [[Skeerey Stondane]]
|-
| style='text-align:right'| 167
| [[Coadan:Capt. William Gill, the first Captain of the line..jpg|center|128px]]
| [[William Gill (marrinagh)|William Gill]]
| 1795
| 1858
| [[Rhumsaa]]
|-
| style='text-align:right'| 168
| [[Coadan:William Cubbon.jpg|center|128px]]
| [[William Cubbon]]
| 1865
| 1955
| [[Colby]]
|-
| style='text-align:right'| 169
| [[Coadan:Sir Benjamin Alfred Dobson statue, Bolton (4).JPG|center|128px]]
| ''[[:d:Q18681459|Benjamin Dobson]]''
| 1847
| 1898
| [[Doolish]]
|-
| style='text-align:right'| 170
| [[Coadan:Sir James Gell.jpg|center|128px]]
| ''[[:d:Q18922358|James Gell]]''
| 1823
| 1905
| [[Mannin]]
|-
| style='text-align:right'| 171
| [[Coadan:Archibald Cregeen.png|center|128px]]
| [[Archibald Cregeen]]
| 1774
| 1841
| [[Colby]]
|-
| style='text-align:right'| 172
| [[Coadan:Rev thomas bacon.jpg|center|128px]]
| ''[[:d:Q19282324|Thomas Bacon]]''
| 1711
| 1768
| [[Mannin]]
|-
| style='text-align:right'| 173
|
| ''[[:d:Q20639142|Annie Warren Gill]]''
| 1862
| 1930
| [[Balley Chashtal]]
|-
| style='text-align:right'| 174
|
| ''[[:d:Q20683954|Charles Clague]]''
| 1890
| 1962
| [[Mannin]]
|-
| style='text-align:right'| 175
|
| ''[[:d:Q20711846|Frank Gill]]''
| 1866
| 1950
| [[Balley Chashtal]]
|-
| style='text-align:right'| 176
|
| ''[[:d:Q20747196|Arthur Lemon]]''
| 1850
| 1912
| [[Mannin]]
|-
| style='text-align:right'| 177
|
| ''[[:d:Q20756364|Patrick William Stuart-Menteath]]''
| 1845
| 1925
| [[Doolish]]
|-
| style='text-align:right'| 178
|
| ''[[:d:Q20763301|Richard Paget Murray]]''
| 1842
| 1908
| [[Mannin]]
|-
| style='text-align:right'| 179
| [[Coadan:Joseph Creer MLA.png|center|128px]]
| ''[[:d:Q20810712|Joseph Creer]]''
| 1832
| 1913
| [[Mannin]]
|-
| style='text-align:right'| 180
|
| ''[[:d:Q20877240|Edward Quayle]]''
| 1802
| 1862
| [[Mannin]]
|-
| style='text-align:right'| 181
|
| ''[[:d:Q20981819|Sidney Nowell Rostron]]''
| 1883
| 1948
| [[Doolish]]
|-
| style='text-align:right'| 182
|
| ''[[:d:Q21461346|Frederick Swynnerton]]''
| 1858
| 1918
| [[Doolish]]
|-
| style='text-align:right'| 183
|
| ''[[:d:Q21538837|Thomas O'Reilly]]''
| 1819
| 1881
| [[Doolish]]
|-
| style='text-align:right'| 184
| [[Coadan:Capt. James Teare of the RMS Ellan Vannin..JPG|center|128px]]
| ''[[:d:Q22018744|James Teare]]''
| 1872
| 1909
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 185
|
| ''[[:d:Q24034942|Amelia Jane Murray]]''
| 1800
| 1896
| [[Doolish]]
|-
| style='text-align:right'| 186
|
| ''[[:d:Q24205000|William Cain]]''
| 1831
| 1914
| [[Mannin]]
|-
| style='text-align:right'| 187
|
| ''[[:d:Q24264205|James F. Keggin]]''
| 1905
| 1993
| [[Mannin]]
|-
| style='text-align:right'| 188
|
| [[Doolish y Karagher]]
| 1926
| 1987
| [[Doolish]]
|-
| style='text-align:right'| 189
|
| ''[[:d:Q26330510|William Hutchison]]''
| 1904
| 1975
| [[Mannin]]
|-
| style='text-align:right'| 190
|
| ''[[:d:Q27178436|Robert H. Nesbitt]]''
| 1883
| 1966
| [[Mannin]]
|-
| style='text-align:right'| 191
| [[Coadan:David "Dawsey" Kewley.jpg|center|128px]]
| ''[[:d:Q27827705|David Kewley]]''
| 1850
| 1904
| [[Doolish]]
|-
| style='text-align:right'| 192
| [[Coadan:James Stowell Gell.jpg|center|128px]]
| ''[[:d:Q28179118|James Stowell Gell]]''
| 1855
| 1919
| [[Balley Chashtal]]
|-
| style='text-align:right'| 193
| [[Coadan:Samuel Harris.jpg|center|128px]]
| ''[[:d:Q28203030|Samuel Harris]]''
| 1815
| 1905
| [[Doolish]]
|-
| style='text-align:right'| 194
| [[Coadan:Jersey Town Criterium 2012 Greg Mansell.jpg|center|128px]]
| ''[[:d:Q126242|Greg Mansell]]''
| 1987
|
| [[Doolish]]
|-
| style='text-align:right'| 195
| [[Coadan:Mark Cavendish TDF2012 (cropped).jpg|center|128px]]
| [[Mark Cavendish]]
| 1985
|
| [[Doolish]]
|-
| style='text-align:right'| 196
| [[Coadan:Barry Gibb in 2017-Glasto17-197 (34744934874).jpg|center|128px]]
| ''[[:d:Q296872|Barry Gibb]]''
| 1946
|
| [[Doolish]]
|-
| style='text-align:right'| 197
|
| ''[[:d:Q373700|Richard Corkill]]''
| 1951
|
| [[Doolish]]
|-
| style='text-align:right'| 198
| [[Coadan:Leo Mansell 2010.jpg|center|128px]]
| ''[[:d:Q427791|Leo Mansell]]''
| 1985
|
| [[Mannin]]
|-
| style='text-align:right'| 199
| [[Coadan:Samantha Barks - Fendi.jpg|center|128px]]
| [[Samantha Barks]]
| 1990
|
| [[Laksaa]]
|-
| style='text-align:right'| 200
| [[Coadan:Andrew Roche - 2014 Commonwealth Games (Men's road time trial).jpg|center|128px]]
| ''[[:d:Q506928|Andrew Roche]]''
| 1971
|
| [[Mannin]]
|-
| style='text-align:right'| 201
| [[Coadan:Peter Kennaugh - Tour de Romandie 2010, Stage 3.jpg|center|128px]]
| ''[[:d:Q561361|Peter Kennaugh]]''
| 1989
|
| [[Doolish]]
|-
| style='text-align:right'| 202
| [[Coadan:Ss7 higgins.jpg|center|128px]]
| ''[[:d:Q570357|Mark Higgins]]''
| 1971
|
| [[Mannin]]
|-
| style='text-align:right'| 203
| [[Coadan:Saint-Ghislain - Grand Prix Pino Cerami, 22 juillet 2015, départ (B016).JPG|center|128px]]
| ''[[:d:Q594947|Mark Christian]]''
| 1990
|
| [[Doolish]]
|-
| style='text-align:right'| 204
|
| ''[[:d:Q935074|Donald Gelling]]''
| 1938
|
| [[Skeerey Stondane]]
|-
| style='text-align:right'| 205
| [[Coadan:Alan Bell 2007.jpg|center|128px]]
| [[Allan Bell]]
| 1947
|
| [[Mannin]]
|-
| style='text-align:right'| 206
|
| ''[[:d:Q1378254|James Anthony Brown]]''
| 1950
|
| [[Balley Chashtal]]
|-
| style='text-align:right'| 207
| [[Coadan:Jonathan Bellis.jpg|center|128px]]
| ''[[:d:Q1381074|Jonathan Bellis]]''
| 1988
|
| [[Doolish]]
|-
| style='text-align:right'| 208
| [[Coadan:Amy Jackson headshot (cropped).jpg|center|128px]]
| [[Amy Jackson]]
| 1992
|
| [[Doolish]]
|-
| style='text-align:right'| 209
| [[Coadan:David Knight WEC 2010.jpg|center|128px]]
| ''[[:d:Q2309170|David Knight]]''
| 1978
|
| [[Balley ny Loghey]]
|-
| style='text-align:right'| 210
| [[Coadan:Prof eva rieger.jpg|center|128px]]
| ''[[:d:Q2693484|Eva Rieger]]''
| 1940
|
| [[Mannin]]
|-
| style='text-align:right'| 211
|
| ''[[:d:Q2898341|Bernard Moffatt]]''
| 1946
|
| [[Mannin]]
|-
| style='text-align:right'| 212
|
| [[Clare Christian]]
| 1945
|
| [[Mannin]]
|-
| style='text-align:right'| 213
| [[Coadan:Harry Manx at Bluesfest 2008.jpg|center|128px]]
| ''[[:d:Q3127867|Harry Manx]]''
| 1955
|
| [[Mannin]]
|-
| style='text-align:right'| 214
| [[Coadan:Jamie Blackley.jpg|center|128px]]
| [[Jamie Blackley]]
| 1991
|
| [[Doolish]]
|-
| style='text-align:right'| 215
|
| ''[[:d:Q3314091|Miles Walker]]''
| 1940
|
| [[Mannin]]
|-
| style='text-align:right'| 216
|
| ''[[:d:Q3337801|Neil Bennett]]''
| 1951
|
| [[Rhumsaa]]
|-
| style='text-align:right'| 217
| [[Coadan:Conor Cummins portrait.JPG|center|128px]]
| ''[[:d:Q3687112|Conor Cummins]]''
| 1986
|
| [[Doolish]]
|-
| style='text-align:right'| 218
|
| ''[[:d:Q3973323|Steve Colley]]''
| 1972
|
| [[Kione Droghad]]
|-
| style='text-align:right'| 219
|
| ''[[:d:Q4706420|Alan Corkish]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 220
|
| ''[[:d:Q4706451|Alan Crowe]]''
| 1940
|
| [[Mannin]]
|-
| style='text-align:right'| 221
| [[Coadan:AndyT Mugshot.jpg|center|128px]]
| ''[[:d:Q4761421|Andy Tudor]]''
| 1977
|
| [[Doolish]]
|-
| style='text-align:right'| 222
| [[Coadan:Prof Angela Little.jpg|center|128px]]
| ''[[:d:Q4762488|Angela Little]]''
| 1949
|
| [[Doolish]]
|-
| style='text-align:right'| 223
|
| [[Anne Craine]]
| 1954
|
| [[Doolish]]
|-
| style='text-align:right'| 224
| [[Coadan:Christine Collister.jpg|center|128px]]
| [[Christine Collister]]
| 1961
|
| [[Mannin]]
|-
| style='text-align:right'| 225
| [[Coadan:Sidecar Thurs Practice IMG 00257.jpg|center|128px]]
| ''[[:d:Q5229405|Dave Molyneux]]''
| 1963
|
| [[Doolish]]
|-
| style='text-align:right'| 226
|
| ''[[:d:Q5229413|Dave Moore]]''
| 1966
|
| [[Doolish]]
|-
| style='text-align:right'| 227
|
| ''[[:d:Q5230767|David Anderson]]''
| 1954
|
| [[Mannin]]
|-
| style='text-align:right'| 228
|
| ''[[:d:Q5232661|David Cretney]]''
| 1954
|
| [[Mannin]]
|-
| style='text-align:right'| 229
|
| ''[[:d:Q5236864|David Lyon]]''
| 1943
|
| [[Doolish]]
|-
| style='text-align:right'| 230
| [[Coadan:Davy-knowles.jpg|center|128px]]
| ''[[:d:Q5242207|Davy Knowles]]''
| 1987
|
| [[Purt le Moirrey]]
|-
| style='text-align:right'| 231
|
| ''[[:d:Q5336528|Eddie Teare]]''
| 1948
|
| [[Mannin]]
|-
| style='text-align:right'| 232
|
| ''[[:d:Q5337428|Edgar Quine]]''
| 1934
|
| [[Andreas, Mannin|Andreas]]
|-
| style='text-align:right'| 233
|
| ''[[:d:Q5522814|Gareth Davies]]''
| 1965
|
| [[Doolish]]
|-
| style='text-align:right'| 234
|
| ''[[:d:Q5687920|Hazel Hannan]]''
| 2000
|
| [[Purt Soderick]]
|-
| style='text-align:right'| 235
| [[Coadan:Roskams jane.jpg|center|128px]]
| ''[[:d:Q6152688|Jane Roskams]]''
|
|
| [[Doolish]]
|-
| style='text-align:right'| 236
|
| ''[[:d:Q6239980|John Houghton]]''
| 2000
|
| [[Doolish]]
|-
| style='text-align:right'| 237
|
| [[Juan Turner]]
| 1974
|
| [[Mannin]]
|-
| style='text-align:right'| 238
| [[Coadan:2021-Watterson-Juan-portrait.jpg|center|128px]]
| ''[[:d:Q6301157|Juan Watterson]]''
| 1980
|
| [[Mannin]]
|-
| style='text-align:right'| 239
|
| ''[[:d:Q6397791|Kevin Woodford]]''
| 1950
|
| [[Doolish]]
|-
| style='text-align:right'| 240
| [[Coadan:Martin Bridson2.jpg|center|128px]]
| ''[[:d:Q6775057|Martin Bridson]]''
| 1964
|
| [[Doolish]]
|-
| style='text-align:right'| 241
|
| ''[[:d:Q7175096|Peter Karran]]''
| 1960
|
| [[Mannin]]
|-
| style='text-align:right'| 242
| [[Coadan:Phil Gawne (cropped).jpg|center|128px]]
| [[Phil Gawne]]
| 1965
|
| [[Doolish]]
|-
| style='text-align:right'| 243
|
| ''[[:d:Q7612099|Steve Burke]]''
| 1974
|
| [[Mannin]]
|-
| style='text-align:right'| 244
|
| [[Tim Kennaugh]]
| 1991
|
| [[Doolish]]
|-
| style='text-align:right'| 245
| [[Coadan:Stoneham Maltais Anthonioz.jpg|center|128px]]
| [[Zoe Gillings]]
| 1985
|
| [[Doolish]]
|-
| style='text-align:right'| 246
|
| [[Cristen Marritt]]
| 1989
|
| [[Doolish]]
|-
| style='text-align:right'| 247
|
| [[Kimberley Clague]]
| 1988
|
| [[Doolish]]
|-
| style='text-align:right'| 248
| [[Coadan:Robert Corteen Carswell.jpg|center|128px]]
| [[Bob Carswell]]
| 1950
|
| [[Mannin]]
|-
| style='text-align:right'| 249
|
| ''[[:d:Q16206261|Nick Crowe]]''
| 1971
|
| [[Mannin]]
|-
| style='text-align:right'| 250
|
| ''[[:d:Q16213489|Araminta de Clermont]]''
| 1971
|
| [[Mannin]]
|-
| style='text-align:right'| 251
| [[Coadan:Goshen-Routh 16.jpg|center|128px]]
| ''[[:d:Q16855481|Arthur Caley]]''
| 1824
|
| [[Mannin]]
|-
| style='text-align:right'| 252
| [[Coadan:Anna Christian - 2019 Women's Tour of Scotland (stage 3).jpg|center|128px]]
| [[Anna Christian]]
| 1995
|
| [[Doolish]]
|-
| style='text-align:right'| 253
| [[Coadan:FIL 2014 - Femmes Gaéliques - Ruth Keggin quartet - 1377.jpg|center|128px]]
| ''[[:d:Q19874790|Ruth Keggin]]''
| 1989
|
| [[Purt Çhiarn]]
|-
| style='text-align:right'| 254
| [[Coadan:Kieran Tierney Scotland v Bolivia 6 June 2026-6.jpg|center|128px]]
| ''[[:d:Q19888012|Kieran Tierney]]''
| 1997
|
| [[Doolish]]
|-
| style='text-align:right'| 255
|
| ''[[:d:Q19956065|Kate Costain]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 256
|
| ''[[:d:Q21289363|Kevin Atherton]]''
| 1950
|
| [[Doolish]]
|-
| style='text-align:right'| 257
|
| ''[[:d:Q21642675|Tim Kneale]]''
| 1982
|
| [[Doolish]]
|-
| style='text-align:right'| 258
| [[Coadan:Lillers - Grand Prix de Lillers-Souvenir Bruno Comini, 6 mars 2016 (B052).JPG|center|128px]]
| [[Jake Kelly (daawheeylleyder)|Jake Kelly]]
| 1995
|
| [[Doolish]]
|-
| style='text-align:right'| 259
| [[Coadan:Liam Doyle.JPG|center|128px]]
| ''[[:d:Q24005468|Liam Doyle]]''
| 1992
|
| [[Mannin]]
|-
| style='text-align:right'| 260
| [[Coadan:2021-Skelly-Laurence-portrait.jpg|center|128px]]
| [[Laurence Skelly]]
| 1961
|
| [[Doolish]]
|-
| style='text-align:right'| 261
|
| [[Isla Callister]]
|
|
| [[Mannin]]
|-
| style='text-align:right'| 262
|
| [[Paayl Rogers]]
|
|
| [[Mannin]]
|-
| style='text-align:right'| 263
|
| [[Daniel Quayle]]
|
|
| [[Mannin]]
|-
| style='text-align:right'| 264
| [[Coadan:Howard Quayle.jpg|center|128px]]
| [[Howard Quayle]]
| 1967
|
| [[Doolish]]
|-
| style='text-align:right'| 265
| [[Coadan:Laura Wasley - 2014 Commonwealth Games (Women's road time trial).jpg|center|128px]]
| ''[[:d:Q26845558|Laura Wasley]]''
| 1984
|
| [[Doolish]]
|-
| style='text-align:right'| 266
| [[Coadan:Matt Bostock - 2019 Tour Series, Aberdeen (Men's race - team win).jpg|center|128px]]
| [[Matthew Bostock]]
| 1997
|
| [[Mannin]]
|-
| style='text-align:right'| 267
| [[Coadan:Brianne West.jpg|center|128px]]
| ''[[:d:Q28033898|Brianne West]]''
| 1985
|
| [[Purt Çhiarn]]
|-
| style='text-align:right'| 268
| [[Coadan:2024 Tour de France Femmes - 2e etappe Lizzie Holden 1.jpg|center|128px]]
| [[Lizzie Holden]]
| 1997
|
| [[Doolish]]
|-
| style='text-align:right'| 269
|
| ''[[:d:Q28378513|Hugh Davidson]]''
| 1935
|
| [[Mannin]]
|-
| style='text-align:right'| 270
|
| ''[[:d:Q28792438|Nathan Draper]]''
| 1997
|
| [[Doolish]]
|-
| style='text-align:right'| 271
| [[Coadan:Sam Brand, 2019 Milan-Sanremo.jpg|center|128px]]
| ''[[:d:Q36286044|Sam Brand]]''
| 1991
|
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 272
|
| [[Adam Long (bluckaneyr)|Adam Long]]
| 2000
|
| [[Doolish]]
|-
| style='text-align:right'| 273
|
| ''[[:d:Q44821053|Alfred Walter Adams]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 274
| [[Coadan:Dr Eleanor Scott.jpg|center|128px]]
| ''[[:d:Q46997927|Eleanor Scott]]''
| 1960
|
| [[Mannin]]
|-
| style='text-align:right'| 275
|
| [[Jessica Li]]
| 1998
|
| [[Doolish]]
|-
| style='text-align:right'| 276
| [[Coadan:Sophia Goulden anon died 1910.jpg|center|128px]]
| ''[[:d:Q50387964|Sophia Goulden]]''
| 1833
|
| [[Skeerey Lonan]]
|-
| style='text-align:right'| 277
|
| ''[[:d:Q50676544|Kerry Sharpe]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 278
|
| [[Daryl Callister]]
| 1989
|
| [[Mannin]]
|-
| style='text-align:right'| 279
|
| ''[[:d:Q55409232|Leon Mazzone]]''
| 1996
|
| [[Rhumsaa]]
|-
| style='text-align:right'| 280
|
| ''[[:d:Q55900439|Gérard MacQuillan]]''
| 1949
|
| [[Doolish]]
|-
| style='text-align:right'| 281
|
| ''[[:d:Q59242725|Clare Faulds]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 282
|
| ''[[:d:Q63344804|Colin Callow]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 283
|
| ''[[:d:Q64006025|Gary R. Lewin]]''
| 1965
|
| [[Mannin]]
|-
| style='text-align:right'| 284
|
| ''[[:d:Q72604247|Nigel Dean]]''
| 1947
|
| [[Doolish]]
|-
| style='text-align:right'| 285
|
| ''[[:d:Q75401195|Margaret Rosamund Moore]]''
| 1871
|
| [[Skeerey Vraddan|Skeerey Braddan]]
|-
| style='text-align:right'| 286
|
| ''[[:d:Q75463040|Margaret Moore]]''
| 1735
|
| [[Skeerey Maghal]]
|-
| style='text-align:right'| 287
|
| ''[[:d:Q75463064|George Quaile]]''
| 1801
|
| [[Mannin]]
|-
| style='text-align:right'| 288
|
| ''[[:d:Q75463140|Margaret Moore]]''
|
|
| [[Skeerey Malew]]
|-
| style='text-align:right'| 289
|
| ''[[:d:Q75467601|Margaret Moore]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 290
|
| ''[[:d:Q87063021|Tom Mazzone]]''
| 1993
|
| [[Doolish]]
|-
| style='text-align:right'| 291
| [[Coadan:Paul Quine.jpg|center|128px]]
| ''[[:d:Q98755074|Paul Quine]]''
| 1969
|
| [[Doolish]]
|-
| style='text-align:right'| 292
|
| ''[[:d:Q100740733|Jane Callister]]''
| 1963
|
| [[Doolish]]
|-
| style='text-align:right'| 293
| [[Coadan:Joe Locke en 2022.jpg|center|128px]]
| [[Joe Locke (aghteyr)|Joe Locke]]
| 2003
|
| [[Doolish]]
|-
| style='text-align:right'| 294
|
| ''[[:d:Q106808901|Julie Edge]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 295
| [[Coadan:Max Walker - 2023 UCI Road World Championships (Men's under-23 road race).jpg|center|128px]]
| ''[[:d:Q107036155|Max Walker]]''
| 2001
|
| [[Doolish]]
|-
| style='text-align:right'| 296
|
| ''[[:d:Q108257419|Nola York]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 297
| [[Coadan:Will Draper.jpg|center|128px]]
| ''[[:d:Q108809635|Will Draper]]''
| 2000
|
| [[Mannin]]
|-
| style='text-align:right'| 298
| [[Coadan:Becky Storrie - Présentation TCFIA 2025.jpg|center|128px]]
| ''[[:d:Q108878510|Becky Storrie]]''
| 1998
|
| [[Balley Sallagh]]
|-
| style='text-align:right'| 299
|
| ''[[:d:Q111254683|Jason Evans]]''
| 1991
|
| [[Doolish]]
|-
| style='text-align:right'| 300
| [[Coadan:Yasmin Ingham at the Badminton Horse Trials 2025 - 20250510 135552(0).jpg|center|128px]]
| [[Yasmin Ingham]]
| 1997
|
| [[Mannin]]
|-
| style='text-align:right'| 301
|
| ''[[:d:Q114785217|William Henry Cooper]]''
| 1870
|
| [[Balley Chashtal]]
|-
| style='text-align:right'| 302
|
| ''[[:d:Q115910223|Michael Bott]]''
| 1954
|
| [[Doolish]]
|-
| style='text-align:right'| 303
|
| ''[[:d:Q117309494|Anna Branford]]''
| 1975
|
| [[Mannin]]
|-
| style='text-align:right'| 304
|
| ''[[:d:Q124685800|Tyler Hannay]]''
| 2003
|
| [[Mannin]]
|-
| style='text-align:right'| 305
|
| ''[[:d:Q126365066|Lucy Barnett]]''
| 2006
|
| [[Kione Droghad]]
|-
| style='text-align:right'| 306
|
| ''[[:d:Q130198574|Brian Christian]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 307
|
| ''[[:d:Q134973228|Catherine Perry]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 308
|
| ''[[:d:Q134973249|Rebecca Webster]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 309
|
| ''[[:d:Q134973255|Daniellle Murphy]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 310
|
| ''[[:d:Q134973282|Alanya Thorpe]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 311
|
| ''[[:d:Q134973285|Andrea Littlejohns]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 312
|
| ''[[:d:Q134973288|Caitlin Henery]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 313
|
| ''[[:d:Q134973298|Clare Crowe]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 314
|
| ''[[:d:Q134980247|Bliss Murtagh]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 315
|
| ''[[:d:Q134980251|Emma Miller]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 316
|
| ''[[:d:Q134980254|Rachel Overman]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 317
|
| ''[[:d:Q134980258|Sam Hassall]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 318
|
| ''[[:d:Q134980259|Finnola Martin]]''
|
|
| [[Mannin]]
|-
| style='text-align:right'| 319
| [[Coadan:David Steven Mullarkey (born 2000) at the Rhine-Ruhr 2025 FISU World University Games.png|center|128px]]
| ''[[:d:Q135162284|David Mullarkey]]''
| 2000
|
| [[Purt ny h-Inshey]]
|-
| style='text-align:right'| 320
| [[Coadan:James franklin iom 2021 1.jpg|center|128px]]
| ''[[:d:Q135898155|James Franklin]]''
| 1980
|
| ''[[:d:Q26715141|Glen Mona]]''
|-
| style='text-align:right'| 321
|
| ''[[:d:Q135898269|Simon Maddrell]]''
| 1965
|
| [[Doolish]]
|-
| style='text-align:right'| 322
|
| ''[[:d:Q138535546|Alexander Foster]]''
| 1999
|
| [[Doolish]]
|-
| style='text-align:right'| 323
|
| ''[[:d:Q140366855|William Arthur Gill]]''
| 1865
|
| [[Mannin]]
|}
== Misc ==
{| class='wikitable sortable'
! #
! XXX Add 'Image' in Manx here please! XXX
! XXX change to 'Name' in Manx! XXX
! XXX dob XXX
! XXX date of death XXX
! xxx Place of birth xxx
|-
| style='text-align:right'| 152
|
| ''[[:d:Q15840011|Peta]]''
| 1963
| 1980
| [[Mannin]]
|}
{{Wikidata list end}}
60yo3772wk2oup8dpiri5ubpw5ot2v2
The Simpsons
0
20680
394765
394013
2026-10-19T02:10:16Z
Stephan1000000
14694
812
394765
wikitext
text/x-wiki
{{ennym iddaalagh}}
{{WD Kishtey Fys Çhellveeish
| jalloo = The_Simpsons_yellow_logo.svg
| traa_roie = 22 vinnid
| earroo_straihyn=38
| earroo_episodeyn=812}}
She straih hellveeish bioghit Americaanagh va crooit ec [[Matt Groening]] er son [[Fox Broadcasting Company]] eh '''''The Simpsons'''''. Hie yn straih magh er ny creeley da'n chied cheayrt er 17 Mee ny Nollick 1989.
{{Gurneil eaghtyrys}}
{{DEFAULTSORT:Simpsons, The}}
{{bun}}
[[Ronney:The Simpsons| ]]
[[Ronney:Straihyn çhellveeish Americaanagh]]
[[Ronney:Straihyn çhellveeish Americaanagh er nyn doshiaghey ayns 1989]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh da deiney aasit veih ny 1980yn]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh veih ny 1980yn]]
[[Ronney:Straihyn çhellveeish grinderagh Americaanagh veih ny 1980yn]]
[[Ronney:Sitcomyn Americaanagh veih ny 1980yn]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh da deiney aasit veih ny 1990yn]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh veih ny 1990yn]]
[[Ronney:Straihyn çhellveeish grinderagh Americaanagh veih ny 1990yn]]
[[Ronney:Sitcomyn Americaanagh veih ny 1990yn]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh da deiney aasit veih ny 2000yn]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh veih ny 2000yn]]
[[Ronney:Straihyn çhellveeish grinderagh Americaanagh veih ny 2000yn]]
[[Ronney:Sitcomyn Americaanagh veih ny 2000yn]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh da deiney aasit veih ny 2010yn]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh veih ny 2010yn]]
[[Ronney:Straihyn çhellveeish grinderagh Americaanagh veih ny 2010yn]]
[[Ronney:Sitcomyn Americaanagh veih ny 2010yn]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh da deiney aasit veih ny 2020yn]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh veih ny 2020yn]]
[[Ronney:Straihyn çhellveeish grinderagh Americaanagh veih ny 2020yn]]
[[Ronney:Sitcomyn Americaanagh veih ny 2020yn]]
[[Ronney:Straihyn çhellveeish bioghit da deiney aasit]]
[[Ronney:Straihyn çhellveeish aittys bioghit Americaanagh da deiney aasit]]
[[Ronney:Sitcomyn bioghit Americaanagh]]
[[Ronney:Fo-straihyn çhellveeish bioghit Americaanagh]]
[[Ronney:Straihyn çhellveeish bioghit Americaanagh bentyn rish cooishyn LADT]]
[[Ronney:Straihyn çhellveeish Americaanagh marish jantys bio as bioghys]]
[[Ronney:Claareeyn bunneydagh Fox Broadcasting Company]]
[[Ronney:Claareeyn çhellveeish 'sy Vaarle]]
[[Ronney:Straihyn çhellveeish liorish 20th Century Fox Television]]
[[Ronney:Straihyn çhellveeish liorish Film Roman]]
[[Ronney:Straihyn çhellveeish liorish Fox Television Animation]]
[[Ronney:Straihyn çhellveeish liorish Gracie Films]]
[[Ronney:Straihyn çhellveeish liorish Klasky Csupo]]
[[Ronney:Straihyn çhellveeish liorish Rough Draft Studios]]
h2ctyy85qh4tzn1anremkh0faohdhh9
Module:Wd
828
20744
394743
394492
2026-10-18T15:30:12Z
MacTire02
219
imraaghyn tashtit
394743
Scribunto
text/plain
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
nativeLabel = "P1705",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433",
lastUpdate = "P5017"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if not text then
return "Missing i18n error key: " .. tostring(code)
end
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
local function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
local i, j = str:find(del)
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
local function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end
root = {} -- array
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
end
endParam()
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
return root, params
end
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default)
local sorted = {}
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
return sorted
end
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabel(id)
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, is URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local candidateParams = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 12 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "ISO 3166-1 numeric code" - not a citable field, just metadata about the source's location
if statement.snaks["P299"] then
statement.snaks["P299"] = nil
end
-- if "retrieved" (access-date) is the only remaining property, this reference has no
-- actual source information (no URL, no stated-in, no title) and cannot be meaningfully
-- cited; skip it silently rather than showing an error
do
local onlyRetrieved = true
local hasAny = false
for snakProperty in pairs(statement.snaks) do
hasAny = true
if snakProperty ~= aliasesP.retrieved then
onlyRetrieved = false
break
end
end
if hasAny and onlyRetrieved then
return {}
end
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
end
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- initialize candidateParams and citeParams
for _, citeType in ipairs(citeTypes) do
candidateParams[citeType] = {}
citeParams[citeType] = {}
end
-- fill candidateParams
for _, citeType in ipairs(citeTypes) do
-- This will contain value--priority pairs for each param name.
local candidateValuesAndPriorities = {}
-- fill candidateValuesAndPriorities
for refProperty in pairs(statement.snaks) do
if citeErrors[citeType] then
break
end
repeat -- just a simple wrapper to emulate "continue"
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break -- skip this property for this value of citeType
end
-- handle unknown properties in the reference
if not paramName then
referenceEmpty = false
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
referenceEmpty = false
-- add an empty entry to candidateValuesAndPriorities, if there isn't one already
if not candidateValuesAndPriorities[paramName] then
candidateValuesAndPriorities[paramName] = {}
end
-- find the priority of refProperty
local thisPropertyPriority = -1
local thisParamPrioritization = citeConfig[citeType]["prioritization"][paramName]
if thisParamPrioritization then
for i_priority, i_property in ipairs(thisParamPrioritization) do
if i_property == refProperty then
thisPropertyPriority = i_priority
end
end
end
for _, propertyValue in pairs(processedProperty) do
table.insert(
candidateValuesAndPriorities[paramName],
{prefix .. propertyValue, thisPropertyPriority}
)
end
until true
end
-- fill candidateParams[citeType]
if not citeErrors[citeType] then
local compareValuePriorities = function(pair1, pair2)
if pair1[2] == -1 and pair2[2] ~= -1 then
return false
end
if pair1[2] ~= -1 and pair2[2] == -1 then
return true
end
return pair1[2] < pair2[2]
end
-- fill candidateParams[citeType][paramName] for each used param
for paramName, _ in pairs(candidateValuesAndPriorities) do
table.sort(candidateValuesAndPriorities[paramName], compareValuePriorities)
candidateParams[citeType][paramName] = {}
for _, valuePriorityPair in ipairs(candidateValuesAndPriorities[paramName]) do
table.insert(candidateParams[citeType][paramName], valuePriorityPair[1])
end
end
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not candidateParams[citeType][paramName] then
candidateParams[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(candidateParams[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(candidateParams[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- archive-only references: recover the original URL (and archive date) from the archive link
for _, citeType in ipairs(citeTypes) do
local urlParam = citeParamMapping[citeType][aliasesP.referenceURL]
local archiveUrlParam = citeParamMapping[citeType][aliasesP.archiveURL]
local archiveDateParam = citeParamMapping[citeType][aliasesP.archiveDate]
local cp = citeParams[citeType]
if urlParam and urlParam ~= "" and archiveUrlParam and archiveUrlParam ~= ""
and not cp[urlParam] and cp[archiveUrlParam] then
local archiveUrl = cp[archiveUrlParam]
local stamp, original = mw.ustring.match(archiveUrl, "^https?://web%.archive%.org/web/(%d+)[%a_]*/(https?://.+)$")
if not original then
stamp, original = mw.ustring.match(archiveUrl, "^https?://archive%.[a-z]+/(%d+)/(https?://.+)$")
end
cp[urlParam] = original or archiveUrl
if stamp and archiveDateParam and archiveDateParam ~= "" and not cp[archiveDateParam] and #stamp >= 8 then
cp[archiveDateParam] = stamp:sub(1,4) .. "-" .. stamp:sub(5,6) .. "-" .. stamp:sub(7,8)
end
end
end
-- fallback: use "stated in" (P248) as title if "title" (P1476) is missing;
-- if neither is present, fall back to the reference URL's domain name
for _, citeType in ipairs(citeTypes) do
local titleParam = citeParamMapping[citeType][aliasesP.title]
local urlParam = citeParamMapping[citeType][aliasesP.referenceURL]
if titleParam and not citeParams[citeType][titleParam] then
if statement.snaks[aliasesP.statedIn] then
local fallbackTitle = self:getReferenceDetail(
statement.snaks,
aliasesP.statedIn,
false,
false
)
if fallbackTitle and fallbackTitle ~= "" then
citeParams[citeType][titleParam] = fallbackTitle
end
end
-- still nothing? try the URL's domain as a last resort
if not citeParams[citeType][titleParam] and urlParam and citeParams[citeType][urlParam] then
local domain = mw.ustring.match(citeParams[citeType][urlParam], "^%a+://([^/]+)")
if domain then
citeParams[citeType][titleParam] = domain
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
local valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix, globalSiteId)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page, globalSiteId) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], false, args[p.args.globalSiteId])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true, args[p.args.globalSiteId])
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
j8jlomf0ujrbnbwqaxqnzp268b92vc9
Ny Pirgrinyn (Coloin Plymouth)
0
28960
394771
335256
2026-10-19T02:42:31Z
MacTire02
219
++
394771
wikitext
text/x-wiki
[[Coadan:Robert Walter Weir - Embarkation of the Pilgrims - Google Art Project.jpg|upright=1.35|right|thumb|''The Embarkation of the Pilgrims'' ("Goll er Boayrd ny Pirgrinyn") (1857) liorish y pheinteyr Americaanagh [[Robert Walter Weir]] ec y Brooklyn Museum]]
Ta '''ny Pirgrinyn''', ny '''ny h-Ayraghyn Pirgrinagh''', çheet er ny coloinee Hostynagh haink dys America er y ''[[Mayflower]]'' as chur [[Coloin Plymouth]] er bun ayns [[Plymouth, Massachusetts]] (ren [[John Smith (ronseyder)|John Smith]] enmyssey yn thalloo shoh New Plymouth ayns 1616, yn ennym cheddin dy cohuittymagh v'ec y phurt faagee [[Plymouth|Plymouth, Devon]]). Haink toshiaghys ny Pirgrinyn voish cohionnalyn crauee jeh ny [[Brownee]], ny [[Puritaanee]] Scarreydagh hea voish y tranlaase crauee ayns Sostyn dys lowaltys yn Ollan 'sy Çheer Injil 'sy 17oo eash.
Va kuse vooar jeh ny bun-chredjueyn [[Calveenaghys|Calveenagh]] Puritaanagh cheddin oc agh, neu-ghollrish y chooid smoo jeh ny Puritaanee, v'ad gra dy lhisagh nyn gohionnalyn scarrey voish [[Agglish Hostyn|agglish steat Hostyn]]. Rere shen, haink ad dy ve enmyssit [[Jiooldeyderyn Sostynagh|Scarreyderyn]]. Lurg shiartanse dy vleeantyn beaghey 'syn Ollan, ren ad reaghey coloin noa y vunnaghey 'sy Theihll Noa as ren ad reaghey marish bahideryn argid adsyn y chooney. Vunnee ad Coloin Plymouth ayns 1620, raad chur ad kialteenyn [[Cohionnalaghys|Cohionnalagh]] er bun.<ref name="Johnson1990">{{Cite book|title=Theology and Identity - Traditions, Movements, and Polity in the United Church of Christ|last=Johnson|first=Daniel L.|publisher=United Church Press|year=1990|isbn=0-8298-0807-8|location=Cleveland, Ohio|pages=[https://archive.org/details/theologyidentity00john/page/4 4]|url=https://archive.org/details/theologyidentity00john/page/4}}</ref> Haink skeeal ny Pirgrinyn dy ve ny h-ard-chooish ayns shennaghys as cultoor ny Steatyn Unnaneysit.<ref>{{cite web|last1=Davis|first1=Kenneth. C.|title=America's True History of Religious Tolerance|url=http://www.smithsonianmag.com/history/americas-true-history-of-religious-tolerance-61312684/?=&no-ist=&page=1|magazine=Smithsonian|accessdate=16 Mean Fouyir 2016}}</ref>
==Imraaghyn==
{{rolleyimraaghyn}}
==Kianglaghyn magh==
{{Commonscategory|Pilgrim Fathers|ny h-Ayraghyn Pirgrinagh}}
* [https://web.archive.org/web/20090521175344/http://www.pilgrimarchives.nl/en/pilgrims-in-documents/pilgrims-in-documents Pilgrim Archives]
* [https://web.archive.org/web/20110711004638/http://www.fenlandlincs.com/mayflower Fotografyn York Noa (Lincs – UK) as lhiaght ny h-Ayraghyn Pirgrinagh (Lincs – UK)]
* [http://www.pilgrimhall.org/ Pilgrim Hall Museum] Shennaghys as jeantaneyn ny Pirgrinyn
* [http://www.mayflowersteps.co.uk/ ''Mayflower'' Steps] Chooilley red bentyn rish y ''Mayflower'' as ny h-Ayraghyn Pirgrinagh
{{DEFAULTSORT:Pirgrinyn, Ny}}
[[Ronney:Yn Protestoonys ayns Sostyn]]
[[Ronney:Yn Cohionnalaghys]]
[[Ronney:Arraghey magh Sostynagh]]
[[Ronney:Coloinaghey Sostynagh ny h-Americkyn]]
[[Ronney:Shennaghys Agglish Hostyn]]
[[Ronney:Shennaghys Lincolnshire]]
[[Ronney:Shennaghys Massachusetts]]
[[Ronney:Shennaghys y Çheer Injil]]
[[Ronney:Shennaghys mooiragh y Çheer Injil]]
[[Ronney:Yn Calveenaghys]]
[[Ronney:Eebyrtee Ghoaldagh 'sy Çheer Injil]]
[[Ronney:Shennaghys ny Tree Coloinyn Jeig]]
[[Ronney:Coloin Plymouth]]
[[Ronney:Plymouth, Massachusetts]]
[[Ronney:Puritaanaghys ayns Sostyn Noa]]
[[Ronney:Pistyl dys ny Hebrewnee]]
b0johzefq7o2xvwyv6g7eoyhcu5cf6j
394772
394771
2026-10-19T02:42:51Z
MacTire02
219
++
394772
wikitext
text/x-wiki
[[Coadan:Robert Walter Weir - Embarkation of the Pilgrims - Google Art Project.jpg|upright=1.35|right|thumb|''The Embarkation of the Pilgrims'' ("Goll er Boayrd ny Pirgrinyn") (1857) liorish y pheinteyr Americaanagh [[Robert Walter Weir]] ec y Brooklyn Museum]]
Ta '''ny Pirgrinyn''', ny '''ny h-Ayraghyn Pirgrinagh''', çheet er ny coloinee Hostynagh haink dys America er y ''[[Mayflower]]'' as chur [[Coloin Plymouth]] er bun ayns [[Plymouth, Massachusetts]] (ren [[John Smith (ronseyder)|John Smith]] enmyssey yn thalloo shoh New Plymouth ayns 1616, yn ennym cheddin dy cohuittymagh v'ec y phurt faagee [[Plymouth|Plymouth, Devon]]). Haink toshiaghys ny Pirgrinyn voish cohionnalyn crauee jeh ny [[Brownee]], ny [[Puritaanee]] Scarreydagh hea voish y tranlaase crauee ayns Sostyn dys lowaltys yn Ollan 'sy Çheer Injil 'sy 17oo eash.
Va kuse vooar jeh ny bun-chredjueyn [[Calveenaghys|Calveenagh]] Puritaanagh cheddin oc agh, neu-ghollrish y chooid smoo jeh ny Puritaanee, v'ad gra dy lhisagh nyn gohionnalyn scarrey voish [[Agglish Hostyn|agglish steat Hostyn]]. Rere shen, haink ad dy ve enmyssit [[Jiooldeyderyn Sostynagh|Scarreyderyn]]. Lurg shiartanse dy vleeantyn beaghey 'syn Ollan, ren ad reaghey coloin noa y vunnaghey 'sy Theihll Noa as ren ad reaghey marish bahideryn argid adsyn y chooney. Vunnee ad Coloin Plymouth ayns 1620, raad chur ad kialteenyn [[Cohionnalaghys|Cohionnalagh]] er bun.<ref name="Johnson1990">{{Cite book|title=Theology and Identity - Traditions, Movements, and Polity in the United Church of Christ|last=Johnson|first=Daniel L.|publisher=United Church Press|year=1990|isbn=0-8298-0807-8|location=Cleveland, Ohio|pages=[https://archive.org/details/theologyidentity00john/page/4 4]|url=https://archive.org/details/theologyidentity00john/page/4}}</ref> Haink skeeal ny Pirgrinyn dy ve ny h-ard-chooish ayns shennaghys as cultoor ny Steatyn Unnaneysit.<ref>{{cite web|last1=Davis|first1=Kenneth. C.|title=America's True History of Religious Tolerance|url=http://www.smithsonianmag.com/history/americas-true-history-of-religious-tolerance-61312684/?=&no-ist=&page=1|magazine=Smithsonian|accessdate=16 Mean Fouyir 2016}}</ref>
==Imraaghyn==
{{rolleyimraaghyn}}
==Kianglaghyn magh==
{{Commonscategory|Pilgrim Fathers|ny h-Ayraghyn Pirgrinagh}}
* [https://web.archive.org/web/20090521175344/http://www.pilgrimarchives.nl/en/pilgrims-in-documents/pilgrims-in-documents Pilgrim Archives]
* [https://web.archive.org/web/20110711004638/http://www.fenlandlincs.com/mayflower Fotografyn York Noa (Lincs – UK) as lhiaght ny h-Ayraghyn Pirgrinagh (Lincs – UK)]
* [http://www.pilgrimhall.org/ Pilgrim Hall Museum] Shennaghys as jeantaneyn ny Pirgrinyn
* [http://www.mayflowersteps.co.uk/ ''Mayflower'' Steps] Chooilley red bentyn rish y ''Mayflower'' as ny h-Ayraghyn Pirgrinagh
{{gurneil eaghtyrys}}
{{DEFAULTSORT:Pirgrinyn, Ny}}
[[Ronney:Yn Protestoonys ayns Sostyn]]
[[Ronney:Yn Cohionnalaghys]]
[[Ronney:Arraghey magh Sostynagh]]
[[Ronney:Coloinaghey Sostynagh ny h-Americkyn]]
[[Ronney:Shennaghys Agglish Hostyn]]
[[Ronney:Shennaghys Lincolnshire]]
[[Ronney:Shennaghys Massachusetts]]
[[Ronney:Shennaghys y Çheer Injil]]
[[Ronney:Shennaghys mooiragh y Çheer Injil]]
[[Ronney:Yn Calveenaghys]]
[[Ronney:Eebyrtee Ghoaldagh 'sy Çheer Injil]]
[[Ronney:Shennaghys ny Tree Coloinyn Jeig]]
[[Ronney:Coloin Plymouth]]
[[Ronney:Plymouth, Massachusetts]]
[[Ronney:Puritaanaghys ayns Sostyn Noa]]
[[Ronney:Pistyl dys ny Hebrewnee]]
77to7g0j0trbv674iai90wh22pkyc1d
Module:Language/data/iana languages
828
30253
394773
394724
2026-10-19T02:44:53Z
MacTire02
219
Kawish
394773
Scribunto
text/plain
-- File-Date: 2023-10-16
local active = {
["aa"] = {"Afarish"},
["ab"] = {"Abcaashish"},
["ae"] = {"Avestan"},
["af"] = {"Affrickaanish"},
["ak"] = {"Akanish"},
["am"] = {"Amharish"},
["an"] = {"Aragonish"},
["ar"] = {"Arabish"},
["as"] = {"Assamish"},
["av"] = {"Avarish"},
["ay"] = {"Aymarish"},
["az"] = {"Asserbajaanish"},
["ba"] = {"Bashkeerish"},
["be"] = {"Belarooshish"},
["bg"] = {"Bulgeyrish"},
["bh"] = {"çhengaghyn Biharagh"},
["bi"] = {"Bislama"},
["bm"] = {"Bambarish"},
["bn"] = {"Bengaalish", "Bangla"},
["bo"] = {"Tibetish"},
["br"] = {"Britaanish"},
["bs"] = {"Bosnish"},
["ca"] = {"Catalaanish", "Cataloanish", "Valensianish", "Valenciano"},
["ce"] = {"Sheshnish"},
["ch"] = {"Chamorro"},
["co"] = {"Corsickish"},
["cr"] = {"Creeish"},
["cs"] = {"Sheckish"},
["cu"] = {"Slavish Agglish", "Slavonish Agglish", "Slavish yn Agglish", "Slavonish yn Agglish", "Shenn Vulgeyrish", "Shenn Slavonish Agglish", "Shenn Slavish Agglish"},
["cv"] = {"Shuvashish"},
["cy"] = {"Bretnish"},
["da"] = {"Danvargish"},
["de"] = {"Germaanish"},
["dv"] = {"Dhivehi", "Divehi", "Maldeevish"},
["dz"] = {"Dzongkha"},
["ee"] = {"Ewe"},
["el"] = {"Greagish Noa-emshyragh (1453-)"},
["en"] = {"Baarle"},
["eo"] = {"Esperanto"},
["es"] = {"Spaainish", "Cashteelish"},
["et"] = {"Estaanish", "Estoinish", "Esthoinish"},
["eu"] = {"Bascish"},
["fa"] = {"Pershish"},
["ff"] = {"Fulah"},
["fi"] = {"Finnlynnish"},
["fj"] = {"Fijian"},
["fo"] = {"Faaroish"},
["fr"] = {"Frangish"},
["fy"] = {"Freeshlannish Heear"},
["ga"] = {"Yernish", "Gaelg Nerin", "Gaelg ny h-Erin", "Gaelg Yernagh"},
["gd"] = {"Gaelg ny h-Albey", "Gaelg Albinagh"},
["gl"] = {"Galeeshish"},
["gn"] = {"Guaranish"},
["gu"] = {"Gujaratish"},
["gv"] = {"Gaelg", "Gailck"},
["ha"] = {"Hausish"},
["he"] = {"Ewnish"},
["hi"] = {"Hindish"},
["ho"] = {"Hiri Motu"},
["hr"] = {"Croitish"},
["ht"] = {"Haitish", "Creeole Haiti"},
["hu"] = {"Ungaarish"},
["hy"] = {"Armeanish"},
["hz"] = {"Hereroish"},
["ia"] = {"Interlingua (International Auxiliary Language Association)"},
["id"] = {"Indoneeshish"},
["ie"] = {"Interlingue", "Occidental"},
["ig"] = {"Igbo"},
["ii"] = {"Sichuan Yi", "Nuosu"},
["ik"] = {"Inupiaq"},
["io"] = {"Idoish"},
["is"] = {"Eeslynnish"},
["it"] = {"Iddaalish"},
["iu"] = {"Inuktitut"},
["ja"] = {"Shapaanish"},
["jv"] = {"Javish", "basa Jawa"},
["ka"] = {"Shorshish"},
["kg"] = {"Kongoish"},
["ki"] = {"Kikuyuish", "Gikuyu"},
["kj"] = {"Kuanyamish", "Kwanyama"},
["kk"] = {"Kassaghish"},
["kl"] = {"Kalaallisut", "Greenlynnish"},
["km"] = {"Khmerish", "Khmerish Veanagh"},
["kn"] = {"Kannada"},
["ko"] = {"Koreeish"},
["kr"] = {"Kanurish"},
["ks"] = {"Kashmirish"},
["ku"] = {"Kurdish"},
["kv"] = {"Komish"},
["kw"] = {"Cornish"},
["ky"] = {"Kyrgisish"},
["la"] = {"Ladjyn"},
["lb"] = {"Lucsemburgish", "Letzeburgesch"},
["lg"] = {"Ganda", "Luganda"},
["li"] = {"Limburgish"},
["ln"] = {"Lingalish"},
["lo"] = {"Laoish"},
["lt"] = {"Litaanish"},
["lu"] = {"Luba-Katanga"},
["lv"] = {"Latvish"},
["mg"] = {"Malagasish"},
["mh"] = {"Marshylish"},
["mi"] = {"Maorish"},
["mk"] = {"Massadoanish"},
["ml"] = {"Malayalamish"},
["mn"] = {"Mongoilish"},
["mr"] = {"Marathish"},
["ms"] = {"Malayish (mooar-hengey)"},
["mt"] = {"Maltish"},
["my"] = {"Burmish"},
["na"] = {"Nauru"},
["nb"] = {"Bokmål Norlynnagh"},
["nd"] = {"Ndebele Hwoaie"},
["ne"] = {"Nepaalish"},
["ng"] = {"Ndonga"},
["nl"] = {"Ollanish", "Flandrynish"},
["nn"] = {"Nynorsk Norlynnagh"},
["no"] = {"Norlynnish"},
["nr"] = {"Ndebele Yiass"},
["nv"] = {"Navahoish", "Navajo", "Navaho"},
["ny"] = {"Chewish", "Nyanja", "Chewa", "Chichewa"},
["oc"] = {"Ocsitaanish (lurg 1500)"},
["oj"] = {"Ojibwa"},
["om"] = {"Oromoish"},
["or"] = {"Oriyish (mooar-hengey)", "Odish (mooar-hengey)"},
["os"] = {"Ossetish"},
["pa"] = {"Panjabish", "Punjabish"},
["pi"] = {"Palish"},
["pl"] = {"Polynnish"},
["ps"] = {"Pushtish", "Pashtish"},
["pt"] = {"Portiugish"},
["qu"] = {"Quechua"},
["rm"] = {"Romansh", "Romanshish"},
["rn"] = {"Rundish"},
["ro"] = {"Romaanish", "Romaainish", "Moldaavish", "Moldovish"},
["ru"] = {"Rooshish"},
["rw"] = {"Kinyarooandish"},
["sa"] = {"Sanskrit"},
["sc"] = {"Sardeenish"},
["sd"] = {"Sindhish"},
["se"] = {"Saamish Hwoaie"},
["sg"] = {"Sangoish"},
["sh"] = {"Serbo-Chroitish"},
["si"] = {"Sinhalish"},
["sk"] = {"Slovackish"},
["sl"] = {"Sloveanish"},
["sm"] = {"Samoish"},
["sn"] = {"Shonish"},
["so"] = {"Somaalish"},
["sq"] = {"Albaanish"},
["sr"] = {"Serbish"},
["ss"] = {"Swassish"},
["st"] = {"Sotoish Yiass"},
["su"] = {"Sundanish"},
["sv"] = {"Soolynnish"},
["sw"] = {"Swahilish (mooar-hengey)"},
["ta"] = {"Tamilish"},
["te"] = {"Teloogooish"},
["tg"] = {"Tajikish"},
["th"] = {"Thaish"},
["ti"] = {"Tigrinyish"},
["tk"] = {"Turkmenish"},
["tl"] = {"Tagalogish"},
["tn"] = {"Tswaanish"},
["to"] = {"Tonga (Ellanyn y Tongey)"},
["tr"] = {"Turkish"},
["ts"] = {"Tsongish"},
["tt"] = {"Tatarish"},
["tw"] = {"Twi"},
["ty"] = {"Tahitish"},
["ug"] = {"Uighurish", "Uyghurish"},
["uk"] = {"Ookraanish"},
["ur"] = {"Oordooish"},
["uz"] = {"Oosbeckish"},
["ve"] = {"Vendish"},
["vi"] = {"Vietnamish"},
["vo"] = {"Volapük"},
["wa"] = {"Walloonish"},
["wo"] = {"Wolofish"},
["xh"] = {"Xhosa"},
["yi"] = {"Ewdish"},
["yo"] = {"Yorubish"},
["za"] = {"Zhuang", "Chuang"},
["zh"] = {"Sheenish"},
["zu"] = {"Soolooish"},
["aaa"] = {"Ghotuo"},
["aab"] = {"Alumu-Tesu"},
["aac"] = {"Ari"},
["aad"] = {"Amal"},
["aae"] = {"Albaanish Arbëreshë"},
["aaf"] = {"Aranadanish"},
["aag"] = {"Ambrakish"},
["aah"] = {"Abu' Arapesh"},
["aai"] = {"Arifama-Miniafia"},
["aak"] = {"Ankave"},
["aal"] = {"Afade"},
["aan"] = {"Anambé"},
["aao"] = {"Arabish Algearagh y Tahara"},
["aap"] = {"Pará Arára"},
["aaq"] = {"Abnakish Hiar"},
["aas"] = {"Aasáx"},
["aat"] = {"Albaanish Arvanitika"},
["aau"] = {"Abau"},
["aav"] = {"çhengaghyn Austro-Aishanagh"},
["aaw"] = {"Solong"},
["aax"] = {"Mandobo Atas"},
["aaz"] = {"Amarasish"},
["aba"] = {"Abé"},
["abb"] = {"Bankonish"},
["abc"] = {"Ambala Ayta"},
["abd"] = {"Manide"},
["abe"] = {"Abnakish Heear"},
["abf"] = {"Abai Sungai"},
["abg"] = {"Abaga"},
["abh"] = {"Arabish Hajikagh"},
["abi"] = {"Abidji"},
["abj"] = {"Aka-Bea"},
["abl"] = {"Lampung Nyo"},
["abm"] = {"Abanyom"},
["abn"] = {"Abua"},
["abo"] = {"Abon"},
["abp"] = {"Abellen Ayta"},
["abq"] = {"Abaza"},
["abr"] = {"Abron"},
["abs"] = {"Ambonese Malay"},
["abt"] = {"Ambulas"},
["abu"] = {"Abure"},
["abv"] = {"Baharna Arabic"},
["abw"] = {"Pal"},
["abx"] = {"Inabaknon"},
["aby"] = {"Aneme Wake"},
["abz"] = {"Abui"},
["aca"] = {"Achagua"},
["acb"] = {"Áncá"},
["acd"] = {"Gikyode"},
["ace"] = {"Achinish"},
["acf"] = {"Creeole Frangish Noo Lucia"},
["ach"] = {"Acoli"},
["aci"] = {"Aka-Cari"},
["ack"] = {"Aka-Kora"},
["acl"] = {"Akar-Bale"},
["acm"] = {"Arabish Vesopotaamagh"},
["acn"] = {"Achang"},
["acp"] = {"Acipa Hiar"},
["acq"] = {"Ta'izzi-Adeni Arabic"},
["acr"] = {"Achi"},
["acs"] = {"Acroá"},
["act"] = {"Achterhoeks"},
["acu"] = {"Achuar-Shiwiar"},
["acv"] = {"Achumawi"},
["acw"] = {"Arabish Hijaz"},
["acx"] = {"Arabish Omaanagh"},
["acy"] = {"Arabish Cheepragh"},
["acz"] = {"Acheron"},
["ada"] = {"Adangme"},
["adb"] = {"Atauran"},
["add"] = {"Lidzonka", "Dzodinka"},
["ade"] = {"Adele"},
["adf"] = {"Arabish Dhofari"},
["adg"] = {"Andegerebinha"},
["adh"] = {"Adhola"},
["adi"] = {"Adi"},
["adj"] = {"Adioukrou"},
["adl"] = {"Galo"},
["adn"] = {"Adang"},
["ado"] = {"Abu"},
["adq"] = {"Adangbe"},
["adr"] = {"Adonara"},
["ads"] = {"Çhengey Chowree Adamorobe"},
["adt"] = {"Adnyamathanha"},
["adu"] = {"Aduge"},
["adw"] = {"Amundava"},
["adx"] = {"Tibetish Amdo"},
["ady"] = {"Adyghe", "Adygei"},
["adz"] = {"Adzera"},
["aea"] = {"Areba"},
["aeb"] = {"arabish Hooneeshagh"},
["aec"] = {"Arabish Saidi"},
["aed"] = {"Çhengey Chowree Argenteenagh"},
["aee"] = {"Pashai Hiar Hwoaie", "Pashayi Hiar Hwoaie"},
["aek"] = {"Haeke"},
["ael"] = {"Ambele"},
["aem"] = {"Arem"},
["aen"] = {"Çhengey Chowree Armeanagh"},
["aeq"] = {"Aer"},
["aer"] = {"Arrernte Hiar"},
["aes"] = {"Alsea"},
["aeu"] = {"Akeu"},
["aew"] = {"Ambakich"},
["aey"] = {"Amele"},
["aez"] = {"Aeka"},
["afa"] = {"çhengaghyn Affro-Aishanagh"},
["afb"] = {"Arabish Cheayn yn Arabaght"},
["afd"] = {"Andai"},
["afe"] = {"Putukwam"},
["afg"] = {"Çhengey Chowree Afghaanagh"},
["afh"] = {"Afrihili"},
["afi"] = {"Akrukay", "Chini"},
["afk"] = {"Nanubae"},
["afn"] = {"Defaka"},
["afo"] = {"Eloyi"},
["afp"] = {"Tapei"},
["afs"] = {"Creeole Affro-Seminolagh"},
["aft"] = {"Afitti"},
["afu"] = {"Awutu"},
["afz"] = {"Obokuitai"},
["aga"] = {"Aguano"},
["agb"] = {"Legbo"},
["agc"] = {"Agatu"},
["agd"] = {"Agarabi"},
["age"] = {"Angal"},
["agf"] = {"Arguni"},
["agg"] = {"Angor"},
["agh"] = {"Ngelima"},
["agi"] = {"Agariya"},
["agj"] = {"Argobba"},
["agk"] = {"Isarog Agta"},
["agl"] = {"Fembe"},
["agm"] = {"Angaataha"},
["agn"] = {"Agutaynen"},
["ago"] = {"Tainae"},
["agq"] = {"Aghem"},
["agr"] = {"Aguaruna"},
["ags"] = {"Esimbi"},
["agt"] = {"Cagayan Agta Meanagh"},
["agu"] = {"Aguacateco"},
["agv"] = {"Remontado Dumagat"},
["agw"] = {"Kahua"},
["agx"] = {"Aghul"},
["agy"] = {"Alta Yiass"},
["agz"] = {"Mt. Iriga Agta"},
["aha"] = {"Ahanta"},
["ahb"] = {"Axamb"},
["ahg"] = {"Qimant"},
["ahh"] = {"Aghu"},
["ahi"] = {"Tiagbamrin Aizi"},
["ahk"] = {"Akha"},
["ahl"] = {"Igo"},
["ahm"] = {"Mobumrin Aizi"},
["ahn"] = {"Àhàn"},
["aho"] = {"Ahom"},
["ahp"] = {"Aproumu Aizi"},
["ahr"] = {"Ahirani"},
["ahs"] = {"Ashe"},
["aht"] = {"Ahtena"},
["aia"] = {"Arosi"},
["aib"] = {"Ainu (y Çheen)"},
["aic"] = {"Ainbai"},
["aid"] = {"Alngith"},
["aie"] = {"Amara"},
["aif"] = {"Agi"},
["aig"] = {"Creeole Baarle Antigua as Barbuda"},
["aih"] = {"Ai-Cham"},
["aii"] = {"Noa-Aramaaish Assyriagh"},
["aij"] = {"Lishanid Noshan"},
["aik"] = {"Ake"},
["ail"] = {"Aimele"},
["aim"] = {"Aimol"},
["ain"] = {"Ainu (y Çhapaan)"},
["aio"] = {"Aiton"},
["aip"] = {"Burumakok"},
["aiq"] = {"Aimaq"},
["air"] = {"Airoran"},
["ait"] = {"Arikem"},
["aiw"] = {"Aari"},
["aix"] = {"Aighon"},
["aiy"] = {"Ali"},
["aja"] = {"Aja (y Toodaan Yiass)"},
["ajg"] = {"Aja (Benin)"},
["aji"] = {"Ajië"},
["ajn"] = {"Andajin"},
["ajs"] = {"Algerian Jewish Sign Language"},
["aju"] = {"Judeo-Moroccan Arabic"},
["ajw"] = {"Ajawa"},
["ajz"] = {"Amri Karbi"},
["akb"] = {"Batak Angkola"},
["akc"] = {"Mpur"},
["akd"] = {"Ukpet-Ehom"},
["ake"] = {"Akawaio"},
["akf"] = {"Akpa"},
["akg"] = {"Anakalangu"},
["akh"] = {"Angal Heneng"},
["aki"] = {"Aiome"},
["akj"] = {"Aka-Jeru"},
["akk"] = {"Akkadian"},
["akl"] = {"Aklanon"},
["akm"] = {"Aka-Bo"},
["ako"] = {"Akurio"},
["akp"] = {"Siwu"},
["akq"] = {"Ak"},
["akr"] = {"Araki"},
["aks"] = {"Akaselem"},
["akt"] = {"Akolet"},
["aku"] = {"Akum"},
["akv"] = {"Akhvakh"},
["akw"] = {"Akwa"},
["akx"] = {"Aka-Kede"},
["aky"] = {"Aka-Kol"},
["akz"] = {"Alabama"},
["ala"] = {"Alago"},
["alc"] = {"Qawasqar"},
["ald"] = {"Alladian"},
["ale"] = {"Aleutagh"},
["alf"] = {"Alege"},
["alg"] = {"çhengaghyn Algonquiagh"},
["alh"] = {"Alawa"},
["ali"] = {"Amaimon"},
["alj"] = {"Alangan"},
["alk"] = {"Alak"},
["all"] = {"Allar"},
["alm"] = {"Amblong"},
["aln"] = {"Albaanish Gheg"},
["alo"] = {"Larike-Wakasihu"},
["alp"] = {"Alune"},
["alq"] = {"Algonquin"},
["alr"] = {"Alutorish"},
["als"] = {"Albaanish Tosk"},
["alt"] = {"Altayish Yiass"},
["alu"] = {"'Are'are"},
["alv"] = {"çhengaghyn Atlantagh-Congo"},
["alw"] = {"Alaba-K’abeena", "Wanbasana"},
["alx"] = {"Amol"},
["aly"] = {"Alyawarr"},
["alz"] = {"Alur"},
["ama"] = {"Amanayé"},
["amb"] = {"Ambo"},
["amc"] = {"Amahuaca"},
["ame"] = {"Yanesha'"},
["amf"] = {"Hamer-Banna"},
["amg"] = {"Amurdak"},
["ami"] = {"Amis"},
["amj"] = {"Amdang"},
["amk"] = {"Ambai"},
["aml"] = {"War-Jaintia"},
["amm"] = {"Ama (Papooey Guinea Noa)"},
["amn"] = {"Amanab"},
["amo"] = {"Amo"},
["amp"] = {"Alamblak"},
["amq"] = {"Amahai"},
["amr"] = {"Amarakaeri"},
["ams"] = {"Amami-Oshima Yiass"},
["amt"] = {"Amto"},
["amu"] = {"Guerrero Amuzgo"},
["amv"] = {"Ambelau"},
["amw"] = {"Noa-Aramaaish Heear"},
["amx"] = {"Anmatyerre"},
["amy"] = {"Ami"},
["amz"] = {"Atampaya"},
["ana"] = {"Andaqui"},
["anb"] = {"Andoa"},
["anc"] = {"Ngas"},
["and"] = {"Ansus"},
["ane"] = {"Xârâcùù"},
["anf"] = {"Animere"},
["ang"] = {"Shenn Vaarle (ca. 450-1100)"},
["anh"] = {"Nend"},
["ani"] = {"Andi"},
["anj"] = {"Anor"},
["ank"] = {"Goemai"},
["anl"] = {"Anu-Hkongso Chin"},
["anm"] = {"Anal"},
["ann"] = {"Obolo"},
["ano"] = {"Andoque"},
["anp"] = {"Angika"},
["anq"] = {"Jarawa (yn Injey)"},
["anr"] = {"Andh"},
["ans"] = {"Anserma"},
["ant"] = {"Antakarinya", "Antikarinya"},
["anu"] = {"Anuak"},
["anv"] = {"Denya"},
["anw"] = {"Anaang"},
["anx"] = {"Andra-Hus"},
["any"] = {"Anyin"},
["anz"] = {"Anem"},
["aoa"] = {"Angolar"},
["aob"] = {"Abom"},
["aoc"] = {"Pemon"},
["aod"] = {"Andarum"},
["aoe"] = {"Angal Enen"},
["aof"] = {"Bragat"},
["aog"] = {"Angoram"},
["aoi"] = {"Anindilyakwa"},
["aoj"] = {"Mufian"},
["aok"] = {"Arhö"},
["aol"] = {"Alor"},
["aom"] = {"Ömie"},
["aon"] = {"Bumbita Arapesh"},
["aor"] = {"Aore"},
["aos"] = {"Taikat"},
["aot"] = {"Atong (yn Injey)", "A'tong"},
["aou"] = {"A'ou"},
["aox"] = {"Atorada"},
["aoz"] = {"Uab Meto"},
["apa"] = {"çhengaghyn Apaçheeagh"},
["apb"] = {"Sa'a"},
["apc"] = {"Arabish Levaantagh"},
["apd"] = {"Arabish Hoodaanagh"},
["ape"] = {"Bukiyip"},
["apf"] = {"Pahanan Agta"},
["apg"] = {"Ampanang"},
["aph"] = {"Athpariya"},
["api"] = {"Apiaká"},
["apj"] = {"Apaçheeish Jicarilla"},
["apk"] = {"Apaçheeish Kiowa"},
["apl"] = {"Apaçheeish Lipan"},
["apm"] = {"Apaçheeish Mescalero-Chiricahua"},
["apn"] = {"Apinayé"},
["apo"] = {"Ambul"},
["app"] = {"Apma"},
["apq"] = {"A-Pucikwar"},
["apr"] = {"Arop-Lokep"},
["aps"] = {"Arop-Sissano"},
["apt"] = {"Apatanish"},
["apu"] = {"Apurinã"},
["apv"] = {"Alapmunte"},
["apw"] = {"Apaçheeish Heear"},
["apx"] = {"Aputai"},
["apy"] = {"Apalaí"},
["apz"] = {"Safeyoka"},
["aqa"] = {"çhengaghyn Alacalufan"},
["aqc"] = {"Archi"},
["aqd"] = {"Ampari Dogon"},
["aqg"] = {"Arigidi"},
["aqk"] = {"Aninka"},
["aql"] = {"çhengaghyn Algagh"},
["aqm"] = {"Atohwaim"},
["aqn"] = {"Alta Hwoaie"},
["aqp"] = {"Atakapa"},
["aqr"] = {"Arhâ"},
["aqt"] = {"Angaité"},
["aqz"] = {"Akuntsu"},
["arb"] = {"Arabish Stundayrtit"},
["arc"] = {"Aramaaish Oikoil (700-300 RC)", "Aramaaish Impiroil (700-300 RC)"},
["ard"] = {"Arabana"},
["are"] = {"Arrarnta Heear"},
["arh"] = {"Arhuaco"},
["ari"] = {"Arikara"},
["arj"] = {"Arapaso"},
["ark"] = {"Arikapú"},
["arl"] = {"Arabela"},
["arn"] = {"Mapudungunish", "Mapuçhish"},
["aro"] = {"Araona"},
["arp"] = {"Arapahoish"},
["arq"] = {"Arabish Algearagh"},
["arr"] = {"Karo (y Vrasseel)"},
["ars"] = {"Arabish Najdi"},
["art"] = {"Çhengaghyn ellynagh"},
["aru"] = {"Aruá (Steat Amazonas)", "Arawá"},
["arv"] = {"Arbore"},
["arw"] = {"Arawak"},
["arx"] = {"Aruá (Steat Rodonia)"},
["ary"] = {"Arabish Varocagh"},
["arz"] = {"Arabish Egyptagh"},
["asa"] = {"Asu (Tanzania)"},
["asb"] = {"Assiniboine"},
["asc"] = {"Casuarina Coast Asmat"},
["ase"] = {"Çhengey Chowree Americaanagh"},
["asf"] = {"Auslan", "Çhengey Chowree Austrailagh"},
["asg"] = {"Cishingini"},
["ash"] = {"Abishira"},
["asi"] = {"Buruwai"},
["asj"] = {"Sari"},
["ask"] = {"Ashkun"},
["asl"] = {"Asilulu"},
["asn"] = {"Xingú Asuriní"},
["aso"] = {"Dano"},
["asp"] = {"Çhengey Chowree Algearagh"},
["asq"] = {"Çhengey Chowree Austrailagh"},
["asr"] = {"Asuri"},
["ass"] = {"Ipulo"},
["ast"] = {"Astoorish", "Astoorleonish", "Bable", "Leonish"},
["asu"] = {"Tocantins Asurini"},
["asv"] = {"Asoa"},
["asw"] = {"Çhengey Chowree Vun-dooghyssee yn Austrail"},
["asx"] = {"Muratayak"},
["asy"] = {"Yaosakor Asmat"},
["asz"] = {"As"},
["ata"] = {"Pele-Ata"},
["atb"] = {"Zaiwa"},
["atc"] = {"Atsahuaca"},
["atd"] = {"Ata Manobo"},
["ate"] = {"Atemble"},
["atg"] = {"Ivbie North-Okpela-Arhe"},
["ath"] = {"çhengaghyn Athapascagh"},
["ati"] = {"Attié"},
["atj"] = {"Atikamekw"},
["atk"] = {"Ati"},
["atl"] = {"Mt. Iraya Agta"},
["atm"] = {"Ata"},
["atn"] = {"Ashtiani"},
["ato"] = {"Atong (Cameroon)"},
["atp"] = {"Pudtol Atta"},
["atq"] = {"Aralle-Tabulahan"},
["atr"] = {"Waimiri-Atroari"},
["ats"] = {"Gros Ventre"},
["att"] = {"Pamplona Atta"},
["atu"] = {"Reel"},
["atv"] = {"Altayish Hwoaie"},
["atw"] = {"Atsugewi"},
["atx"] = {"Arutani"},
["aty"] = {"Aneityum"},
["atz"] = {"Arta"},
["aua"] = {"Asumboa"},
["aub"] = {"Alugu"},
["auc"] = {"Waorani"},
["aud"] = {"Anuta"},
["auf"] = {"çhengaghyn Arauagh"},
["aug"] = {"Aguna"},
["auh"] = {"Aushi"},
["aui"] = {"Anuki"},
["auj"] = {"Awjilah"},
["auk"] = {"Heyo"},
["aul"] = {"Aulua"},
["aum"] = {"Asu (y Naigeer)"},
["aun"] = {"Molmo One"},
["auo"] = {"Auyokawa"},
["aup"] = {"Makayam"},
["auq"] = {"Anus", "Korur"},
["aur"] = {"Aruek"},
["aus"] = {"çhengaghyn Austrailagh"},
["aut"] = {"Austral"},
["auu"] = {"Auye"},
["auw"] = {"Awyi"},
["aux"] = {"Aurá"},
["auy"] = {"Awiyaana"},
["auz"] = {"Arabish Oosbeckagh"},
["avb"] = {"Avau"},
["avd"] = {"Alviri-Vidari"},
["avi"] = {"Avikam"},
["avk"] = {"Kotava"},
["avl"] = {"Arabish Bedawi Egyptagh Hiar"},
["avm"] = {"Angkamuthi"},
["avn"] = {"Avatime"},
["avo"] = {"Agavotaguerra"},
["avs"] = {"Aushiri"},
["avt"] = {"Au"},
["avu"] = {"Avokaya"},
["avv"] = {"Avá-Canoeiro"},
["awa"] = {"Awadhi"},
["awb"] = {"Awa (Papooey Guinea Noa)"},
["awc"] = {"Cicipu"},
["awd"] = {"çhengaghyn Arawakagh"},
["awe"] = {"Awetí"},
["awg"] = {"Anguthimri"},
["awh"] = {"Awbono"},
["awi"] = {"Aekyom"},
["awk"] = {"Awabakal"},
["awm"] = {"Arawum"},
["awn"] = {"Awngi"},
["awo"] = {"Awak"},
["awr"] = {"Awera"},
["aws"] = {"Awyu Yiass"},
["awt"] = {"Araweté"},
["awu"] = {"Awyu Meanagh"},
["awv"] = {"Jair Awyu"},
["aww"] = {"Awun"},
["awx"] = {"Awara"},
["awy"] = {"Edera Awyu"},
["axb"] = {"Abipon"},
["axe"] = {"Ayerrerenge"},
["axg"] = {"Mato Grosso Arára"},
["axk"] = {"Yaka (Pobblaght yn Affrick Veanagh)"},
["axl"] = {"Arandish Yiass Injil"},
["axm"] = {"Armeanish Veanagh"},
["axx"] = {"Xârâgurè"},
["aya"] = {"Awar"},
["ayb"] = {"Ayizo Gbe"},
["ayc"] = {"Aymarish Yiass"},
["ayd"] = {"Ayabadhu"},
["aye"] = {"Ayere"},
["ayg"] = {"Ginyanga"},
["ayh"] = {"Arabish Hadram"},
["ayi"] = {"Leyigha"},
["ayk"] = {"Akuku"},
["ayl"] = {"Arabish Leebagh"},
["ayn"] = {"Arabish Sanaanagh"},
["ayo"] = {"Ayoreo"},
["ayp"] = {"Arabish Vesopotaamagh Hwoaie"},
["ayq"] = {"Ayi (Papooey Guinea Noa)"},
["ayr"] = {"Aymarish Veanagh"},
["ays"] = {"Sorsogon Ayta"},
["ayt"] = {"Magbukun Ayta"},
["ayu"] = {"Ayu"},
["ayz"] = {"Mai Brat"},
["aza"] = {"Azha"},
["azb"] = {"Asserbajaanish Yiass"},
["azc"] = {"çhengaghyn Uto-Asteckagh"},
["azd"] = {"Nahuatl Durango Hiar"},
["azg"] = {"San Pedro Amuzgos Amuzgo"},
["azj"] = {"Asserbajaanish Hwoaie"},
["azm"] = {"Ipalapa Amuzgo"},
["azn"] = {"Nahuatl Durango Heear"},
["azo"] = {"Awing"},
["azt"] = {"Faire Atta"},
["azz"] = {"Nahuatl Puebla Sleitoil"},
["baa"] = {"Babatana"},
["bab"] = {"Bainouk-Gunyuño"},
["bac"] = {"Badui"},
["bad"] = {"çhengaghyn Banda"},
["bae"] = {"Baré"},
["baf"] = {"Nubaca"},
["bag"] = {"Tuki"},
["bah"] = {"Creeole Baarle ny Bahamaghyn"},
["bai"] = {"çhengaghyn Bamileke"},
["baj"] = {"Barakai"},
["bal"] = {"Balooçhish"},
["ban"] = {"Balinish"},
["bao"] = {"Waimaha"},
["bap"] = {"Bantawa"},
["bar"] = {"Baveyrish"},
["bas"] = {"Basa (Cameroon)"},
["bat"] = {"çhengaghyn Baltagh"},
["bau"] = {"Bada (y Naigeer)"},
["bav"] = {"Vengo"},
["baw"] = {"Bambili-Bambui"},
["bax"] = {"Bamun"},
["bay"] = {"Batuley"},
["bba"] = {"Baatonum"},
["bbb"] = {"Barai"},
["bbc"] = {"Batak Toba"},
["bbd"] = {"Bau"},
["bbe"] = {"Bangba"},
["bbf"] = {"Baibai"},
["bbg"] = {"Barama"},
["bbh"] = {"Bugan"},
["bbi"] = {"Barombi"},
["bbj"] = {"Ghomálá'"},
["bbk"] = {"Babanki"},
["bbl"] = {"Bats"},
["bbm"] = {"Babango"},
["bbn"] = {"Uneapa"},
["bbo"] = {"Bobo Madaré Hwoaie", "Konabéré"},
["bbp"] = {"Banda Veanagh Heear"},
["bbq"] = {"Bamali"},
["bbr"] = {"Girawa"},
["bbs"] = {"Bakpinka"},
["bbt"] = {"Mburku"},
["bbu"] = {"Kulung (y Naigeer)"},
["bbv"] = {"Karnai"},
["bbw"] = {"Baba"},
["bbx"] = {"Bubia"},
["bby"] = {"Befang"},
["bca"] = {"Bai Meanagh"},
["bcb"] = {"Bainouk-Samik"},
["bcc"] = {"Balooçhish Yiass"},
["bcd"] = {"Babar Hwoaie"},
["bce"] = {"Bamenyam"},
["bcf"] = {"Bamu"},
["bcg"] = {"Baga Pokur"},
["bch"] = {"Bariai"},
["bci"] = {"Baoulé"},
["bcj"] = {"Bardi"},
["bck"] = {"Bunuba"},
["bcl"] = {"Bikolish Veanagh"},
["bcm"] = {"Bannoni"},
["bcn"] = {"Bali (y Naigeer)"},
["bco"] = {"Kaluli"},
["bcp"] = {"Bali (Pobblaght Gheynlagh y Chongo)"},
["bcq"] = {"Bench"},
["bcr"] = {"Babine"},
["bcs"] = {"Kohumono"},
["bct"] = {"Bendi"},
["bcu"] = {"Awad Bing"},
["bcv"] = {"Shoo-Minda-Nye"},
["bcw"] = {"Bana"},
["bcy"] = {"Bacama"},
["bcz"] = {"Bainouk-Gunyaamolo"},
["bda"] = {"Bayot"},
["bdb"] = {"Basap"},
["bdc"] = {"Emberá-Baudó"},
["bdd"] = {"Bunama"},
["bde"] = {"Bade"},
["bdf"] = {"Biage"},
["bdg"] = {"Bonggi"},
["bdh"] = {"Baka (y Toodaan Yiass)"},
["bdi"] = {"Burun"},
["bdj"] = {"Bai (y Toodaan Yiass)", "Bai"},
["bdk"] = {"Budukh"},
["bdl"] = {"Bajau Indoneeshagh"},
["bdm"] = {"Buduma"},
["bdn"] = {"Baldemu"},
["bdo"] = {"Morom"},
["bdp"] = {"Bende"},
["bdq"] = {"Bahnar"},
["bdr"] = {"Bajau y Choose Heear"},
["bds"] = {"Burunge"},
["bdt"] = {"Bokoto"},
["bdu"] = {"Oroko"},
["bdv"] = {"Bodo Parja"},
["bdw"] = {"Baham"},
["bdx"] = {"Budong-Budong"},
["bdy"] = {"Bandjalang"},
["bdz"] = {"Badeshi"},
["bea"] = {"Beaver"},
["beb"] = {"Bebele"},
["bec"] = {"Iceve-Maci"},
["bed"] = {"Bedoanas"},
["bee"] = {"Byangsi"},
["bef"] = {"Benabena"},
["beg"] = {"Belait"},
["beh"] = {"Biali"},
["bei"] = {"Bekati'"},
["bej"] = {"Beja", "Bedawiyet"},
["bek"] = {"Bebeli"},
["bem"] = {"Bemba (y Tambia)"},
["beo"] = {"Beami"},
["bep"] = {"Besoa"},
["beq"] = {"Beembe"},
["ber"] = {"çhengaghyn Berberagh"},
["bes"] = {"Besme"},
["bet"] = {"Guiberoua Béte"},
["beu"] = {"Blagar"},
["bev"] = {"Daloa Bété"},
["bew"] = {"Betawi"},
["bex"] = {"Jur Modo"},
["bey"] = {"Beli (Papooey Guinea Noa)"},
["bez"] = {"Bena (Tanzania)"},
["bfa"] = {"Bari"},
["bfb"] = {"Pauri Bareli"},
["bfc"] = {"Panyi Bai", "Bai Hwoaie"},
["bfd"] = {"Bafut"},
["bfe"] = {"Betaf", "Tena"},
["bff"] = {"Bofi"},
["bfg"] = {"Busang Kayan"},
["bfh"] = {"Blafe"},
["bfi"] = {"Çhengey Chowree Ghoaldagh"},
["bfj"] = {"Bafanji"},
["bfk"] = {"Çhengey Chowree Ban Khor"},
["bfl"] = {"Banda-Ndélé"},
["bfm"] = {"Mmen"},
["bfn"] = {"Bunak"},
["bfo"] = {"Malba Birifor"},
["bfp"] = {"Beba"},
["bfq"] = {"Badaga"},
["bfr"] = {"Bazigar"},
["bfs"] = {"Bai Yiass"},
["bft"] = {"Balti"},
["bfu"] = {"Gahri"},
["bfw"] = {"Bondo"},
["bfx"] = {"Bantayanon"},
["bfy"] = {"Bagheli"},
["bfz"] = {"Mahasu Pahari"},
["bga"] = {"Gwamhi-Wuri"},
["bgb"] = {"Bobongko"},
["bgc"] = {"Haryanvi"},
["bgd"] = {"Rathwi Bareli"},
["bge"] = {"Bauria"},
["bgf"] = {"Bangandu"},
["bgg"] = {"Bugun"},
["bgi"] = {"Giangan"},
["bgj"] = {"Bangolan"},
["bgk"] = {"Bit", "Buxinhua"},
["bgl"] = {"Bo (y Laos)"},
["bgn"] = {"Balooçhish"},
["bgo"] = {"Baga Koga"},
["bgp"] = {"Balooçhish Hiar"},
["bgq"] = {"Bagri"},
["bgr"] = {"Bawm Chin"},
["bgs"] = {"Tagabawa"},
["bgt"] = {"Bughotu"},
["bgu"] = {"Mbongno"},
["bgv"] = {"Warkay-Bipim"},
["bgw"] = {"Bhatri"},
["bgx"] = {"Turkish Ghaugaussagh Balkanagh"},
["bgy"] = {"Benggoi"},
["bgz"] = {"Banggai"},
["bha"] = {"Bharia"},
["bhb"] = {"Bhili"},
["bhc"] = {"Biga"},
["bhd"] = {"Bhadrawahi"},
["bhe"] = {"Bhaya"},
["bhf"] = {"Odiai"},
["bhg"] = {"Binandere"},
["bhh"] = {"Bukharic"},
["bhi"] = {"Bhilali"},
["bhj"] = {"Bahing"},
["bhl"] = {"Bimin"},
["bhm"] = {"Bathari"},
["bhn"] = {"Noa-Aramaaish Bohtan"},
["bho"] = {"Bhojpuri"},
["bhp"] = {"Bima"},
["bhq"] = {"Tukang Besi South"},
["bhr"] = {"Bara Malagasy"},
["bhs"] = {"Buwal"},
["bht"] = {"Bhattiyali"},
["bhu"] = {"Bhunjia"},
["bhv"] = {"Bahau"},
["bhw"] = {"Biak"},
["bhx"] = {"Bhalay"},
["bhy"] = {"Bhele"},
["bhz"] = {"Bada (yn Indoneesh)"},
["bia"] = {"Badimaya"},
["bib"] = {"Bissa", "Bisa"},
["bid"] = {"Bidiyo"},
["bie"] = {"Bepour"},
["bif"] = {"Biafada"},
["big"] = {"Biangai"},
["bik"] = {"Bikol"},
["bil"] = {"Bile"},
["bim"] = {"Bimoba"},
["bin"] = {"Bini", "Edo"},
["bio"] = {"Nai"},
["bip"] = {"Bila"},
["biq"] = {"Bipi"},
["bir"] = {"Bisorio"},
["bit"] = {"Berinomo"},
["biu"] = {"Biete"},
["biv"] = {"Birifor Yiass"},
["biw"] = {"Kol (Cameroon)"},
["bix"] = {"Bijori"},
["biy"] = {"Birhor"},
["biz"] = {"Baloi"},
["bja"] = {"Budza"},
["bjb"] = {"Banggarla"},
["bjc"] = {"Bariji"},
["bje"] = {"Biao-Jiao Mien"},
["bjf"] = {"Barzani Jewish Neo-Aramaic"},
["bjg"] = {"Bidyogo"},
["bjh"] = {"Bahinemo"},
["bji"] = {"Burji"},
["bjj"] = {"Kanauji"},
["bjk"] = {"Barok"},
["bjl"] = {"Bulu (Papooey Guinea Noa)"},
["bjm"] = {"Bajelani"},
["bjn"] = {"Banjar"},
["bjo"] = {"Banda Jiass Veanagh"},
["bjp"] = {"Fanamaket"},
["bjr"] = {"Binumarien"},
["bjs"] = {"Bajan"},
["bjt"] = {"Balanta-Ganja"},
["bju"] = {"Busuu"},
["bjv"] = {"Bedjond"},
["bjw"] = {"Bakwé"},
["bjx"] = {"Banao Itneg"},
["bjy"] = {"Bayali"},
["bjz"] = {"Baruga"},
["bka"] = {"Kyak"},
["bkc"] = {"Baka (Cameroon)"},
["bkd"] = {"Binukid", "Talaandig"},
["bkf"] = {"Beeke"},
["bkg"] = {"Buraka"},
["bkh"] = {"Bakoko"},
["bki"] = {"Baki"},
["bkj"] = {"Pande"},
["bkk"] = {"Brokskat"},
["bkl"] = {"Berik"},
["bkm"] = {"Kom (Cameroon)"},
["bkn"] = {"Bukitan"},
["bko"] = {"Kwa'"},
["bkp"] = {"Boko (Pobblaght Gheynlagh y Chongo)"},
["bkq"] = {"Bakairí"},
["bkr"] = {"Bakumpai"},
["bks"] = {"Sorsoganon Hwoaie"},
["bkt"] = {"Boloki"},
["bku"] = {"Buhid"},
["bkv"] = {"Bekwarra"},
["bkw"] = {"Bekwel"},
["bkx"] = {"Baikeno"},
["bky"] = {"Bokyi"},
["bkz"] = {"Bungku"},
["bla"] = {"Siksika"},
["blb"] = {"Bilua"},
["blc"] = {"Bella Coola"},
["bld"] = {"Bolango"},
["ble"] = {"Balanta-Kentohe"},
["blf"] = {"Buol"},
["blh"] = {"Kuwaa"},
["bli"] = {"Bolia"},
["blj"] = {"Bolongan"},
["blk"] = {"Pa'o Karen", "Pa'O"},
["bll"] = {"Biloxi"},
["blm"] = {"Beli (y Toodaan Yiass)"},
["bln"] = {"Bikol Catanduanes Yiass"},
["blo"] = {"Anii"},
["blp"] = {"Blablanga"},
["blq"] = {"Baluan-Pam"},
["blr"] = {"Blang"},
["bls"] = {"Balaesang"},
["blt"] = {"Tai Dam"},
["blv"] = {"Kibala", "Bolo"},
["blw"] = {"Balangao"},
["blx"] = {"Mag-Indi Ayta"},
["bly"] = {"Notre"},
["blz"] = {"Balantak"},
["bma"] = {"Lame"},
["bmb"] = {"Bembe"},
["bmc"] = {"Biem"},
["bmd"] = {"Baga Manduri"},
["bme"] = {"Limassa"},
["bmf"] = {"Bom-Kim"},
["bmg"] = {"Bamwe"},
["bmh"] = {"Kein"},
["bmi"] = {"Bagirmi"},
["bmj"] = {"Bote-Majhi"},
["bmk"] = {"Ghayavi"},
["bml"] = {"Bomboli"},
["bmm"] = {"Malagasish Betsimisaraka Hwoaie"},
["bmn"] = {"Bina (Papooey Guinea Noa)"},
["bmo"] = {"Bambalang"},
["bmp"] = {"Bulgebi"},
["bmq"] = {"Bomu"},
["bmr"] = {"Muinane"},
["bms"] = {"Bilma Kanuri"},
["bmt"] = {"Biao Mon"},
["bmu"] = {"Somba-Siawari"},
["bmv"] = {"Bum"},
["bmw"] = {"Bomwali"},
["bmx"] = {"Baimak"},
["bmz"] = {"Baramu"},
["bna"] = {"Bonerate"},
["bnb"] = {"Bookan"},
["bnc"] = {"Bontok"},
["bnd"] = {"Banda (yn Indoneesh)"},
["bne"] = {"Bintauna"},
["bnf"] = {"Masiwang"},
["bng"] = {"Benga"},
["bni"] = {"Bangi"},
["bnj"] = {"Tawbuid Hiar"},
["bnk"] = {"Bierebo"},
["bnl"] = {"Boon"},
["bnm"] = {"Batanga"},
["bnn"] = {"Bunun"},
["bno"] = {"Bantoanon"},
["bnp"] = {"Bola"},
["bnq"] = {"Bantik"},
["bnr"] = {"Butmas-Tur"},
["bns"] = {"Bundeli"},
["bnt"] = {"çhengaghyn Bantu"},
["bnu"] = {"Bentong"},
["bnv"] = {"Bonerif", "Beneraf", "Edwas"},
["bnw"] = {"Bisis"},
["bnx"] = {"Bangubangu"},
["bny"] = {"Bintulu"},
["bnz"] = {"Beezen"},
["boa"] = {"Bora"},
["bob"] = {"Aweer"},
["boe"] = {"Mundabli"},
["bof"] = {"Bolon"},
["bog"] = {"Çhengey Chowree Bamako"},
["boh"] = {"Boma"},
["boi"] = {"Barbareño"},
["boj"] = {"Anjam"},
["bok"] = {"Bonjo"},
["bol"] = {"Bole"},
["bom"] = {"Berom"},
["bon"] = {"Bine"},
["boo"] = {"Tiemacèwè Bozo"},
["bop"] = {"Bonkiman"},
["boq"] = {"Bogaya"},
["bor"] = {"Borôro"},
["bot"] = {"Bongo"},
["bou"] = {"Bondei"},
["bov"] = {"Tuwuli"},
["bow"] = {"Rema"},
["box"] = {"Buamu"},
["boy"] = {"Bodo (Pobblaght yn Affrick Veanagh)"},
["boz"] = {"Tiéyaxo Bozo"},
["bpa"] = {"Daakaka"},
["bpc"] = {"Mbuk"},
["bpd"] = {"Banda-Banda"},
["bpe"] = {"Bauni"},
["bpg"] = {"Bonggo"},
["bph"] = {"Botlikh"},
["bpi"] = {"Bagupi"},
["bpj"] = {"Binji"},
["bpk"] = {"Orowe", "'Ôrôê"},
["bpl"] = {"Broome Pearling Lugger Pidgin"},
["bpm"] = {"Biyom"},
["bpn"] = {"Dzao Min"},
["bpo"] = {"Anasi"},
["bpp"] = {"Kaure"},
["bpq"] = {"Malayish Banda"},
["bpr"] = {"Koronadal Blaan"},
["bps"] = {"Sarangani Blaan"},
["bpt"] = {"Barrow Point"},
["bpu"] = {"Bongu"},
["bpv"] = {"Bian Marind"},
["bpw"] = {"Bo (Papooey Guinea Noa)"},
["bpx"] = {"Palya Bareli"},
["bpy"] = {"Bishnupriya"},
["bpz"] = {"Bilba"},
["bqa"] = {"Tchumbuli"},
["bqb"] = {"Bagusa"},
["bqc"] = {"Boko (Benin)", "Boo"},
["bqd"] = {"Bung"},
["bqf"] = {"Baga Kaloum"},
["bqg"] = {"Bago-Kusuntu"},
["bqh"] = {"Baima"},
["bqi"] = {"Bakhtiari"},
["bqj"] = {"Bandial"},
["bqk"] = {"Banda-Mbrès"},
["bql"] = {"Bilakura"},
["bqm"] = {"Wumboko"},
["bqn"] = {"Çhengey Chowree Vulgeyragh"},
["bqo"] = {"Balo"},
["bqp"] = {"Busa"},
["bqq"] = {"Biritai"},
["bqr"] = {"Burusu"},
["bqs"] = {"Bosngun"},
["bqt"] = {"Bamukumbit"},
["bqu"] = {"Boguru"},
["bqv"] = {"Koro Wachi", "Begbere-Ejar"},
["bqw"] = {"Buru (y Naigeer)"},
["bqx"] = {"Baangi"},
["bqy"] = {"Çhengey Chowree Bengkala"},
["bqz"] = {"Bakaka"},
["bra"] = {"Braj"},
["brb"] = {"Brao", "Lave"},
["brc"] = {"Creeole Ollanish Berbice"},
["brd"] = {"Baraamu"},
["brf"] = {"Bira"},
["brg"] = {"Baure"},
["brh"] = {"Brahui"},
["bri"] = {"Mokpwe"},
["brj"] = {"Bieria"},
["brk"] = {"Birked"},
["brl"] = {"Birwa"},
["brm"] = {"Barambu"},
["brn"] = {"Boruca"},
["bro"] = {"Brokkat"},
["brp"] = {"Barapasi"},
["brq"] = {"Breri"},
["brr"] = {"Birao"},
["brs"] = {"Baras"},
["brt"] = {"Bitare"},
["bru"] = {"Bru Hiar"},
["brv"] = {"Bru Heear"},
["brw"] = {"Bellari"},
["brx"] = {"Bodo (yn Injey)"},
["bry"] = {"Burui"},
["brz"] = {"Bilbil"},
["bsa"] = {"Abinomn"},
["bsb"] = {"Brunei Bisaya"},
["bsc"] = {"Bassari", "Oniyan"},
["bse"] = {"Wushi"},
["bsf"] = {"Bauchi"},
["bsg"] = {"Bashkardish"},
["bsh"] = {"Kati"},
["bsi"] = {"Bassossi"},
["bsj"] = {"Bangwinji"},
["bsk"] = {"Burushaski"},
["bsl"] = {"Basa-Gumna"},
["bsm"] = {"Busami"},
["bsn"] = {"Barasana-Eduria"},
["bso"] = {"Buso"},
["bsp"] = {"Baga Sitemu"},
["bsq"] = {"Bassa"},
["bsr"] = {"Bassa-Kontagora"},
["bss"] = {"Akoose"},
["bst"] = {"Basketo"},
["bsu"] = {"Bahonsuai"},
["bsv"] = {"Baga Sobané"},
["bsw"] = {"Baiso"},
["bsx"] = {"Yangkam"},
["bsy"] = {"Sabah Bisaya"},
["bta"] = {"Bata"},
["btc"] = {"Bati (Cameroon)"},
["btd"] = {"Batak Dairi"},
["bte"] = {"Gamo-Ningi"},
["btf"] = {"Birgit"},
["btg"] = {"Gagnoa Bété"},
["bth"] = {"Biatah Bidayuh"},
["bti"] = {"Burate"},
["btj"] = {"Malayish Vacanagh"},
["btk"] = {"çhengaghyn Batak"},
["btm"] = {"Batak Mandailing"},
["btn"] = {"Ratagnon"},
["bto"] = {"Rinconada Bikol"},
["btp"] = {"Budibud"},
["btq"] = {"Batek"},
["btr"] = {"Baetora"},
["bts"] = {"Batak Simalungun"},
["btt"] = {"Bete-Bendi"},
["btu"] = {"Batu"},
["btv"] = {"Bateri"},
["btw"] = {"Butuanon"},
["btx"] = {"Batak Karo"},
["bty"] = {"Bobot"},
["btz"] = {"Batak Alas-Kluet"},
["bua"] = {"Buryatish"},
["bub"] = {"Bua"},
["buc"] = {"Bushi"},
["bud"] = {"Ntcham"},
["bue"] = {"Beothuk"},
["buf"] = {"Bushoong"},
["bug"] = {"Buginish"},
["buh"] = {"Younuo Bunu"},
["bui"] = {"Bongili"},
["buj"] = {"Basa-Gurmana"},
["buk"] = {"Bugawac"},
["bum"] = {"Bulu (Cameroon)"},
["bun"] = {"Sherbro"},
["buo"] = {"Terei"},
["bup"] = {"Busoa"},
["buq"] = {"Brem"},
["bus"] = {"Bokobaru"},
["but"] = {"Bungain"},
["buu"] = {"Budu"},
["buv"] = {"Bun"},
["buw"] = {"Bubi"},
["bux"] = {"Boghom"},
["buy"] = {"Bullom So"},
["buz"] = {"Bukwen"},
["bva"] = {"Barein"},
["bvb"] = {"Bube"},
["bvc"] = {"Baelelea"},
["bvd"] = {"Baeggu"},
["bve"] = {"Malayish Berau"},
["bvf"] = {"Boor"},
["bvg"] = {"Bonkeng"},
["bvh"] = {"Bure"},
["bvi"] = {"Belanda Viri"},
["bvj"] = {"Baan"},
["bvk"] = {"Bukat"},
["bvl"] = {"Çh Chowree Voliviagh"},
["bvm"] = {"Bamunka"},
["bvn"] = {"Buna"},
["bvo"] = {"Bolgo"},
["bvp"] = {"Bumang"},
["bvq"] = {"Birri"},
["bvr"] = {"Burarra"},
["bvt"] = {"Bati (yn Indoneesh)"},
["bvu"] = {"Malayish Bukit"},
["bvv"] = {"Baniva"},
["bvw"] = {"Boga"},
["bvx"] = {"Dibole"},
["bvy"] = {"Baybayanon"},
["bvz"] = {"Bauzi"},
["bwa"] = {"Bwatoo"},
["bwb"] = {"Namosi-Naitasiri-Serua"},
["bwc"] = {"Bwile"},
["bwd"] = {"Bwaidoka"},
["bwe"] = {"Bwe Karen"},
["bwf"] = {"Boselewa"},
["bwg"] = {"Barwe"},
["bwh"] = {"Bishuo"},
["bwi"] = {"Baniwa"},
["bwj"] = {"Láá Láá Bwamu"},
["bwk"] = {"Bauwaki"},
["bwl"] = {"Bwela"},
["bwm"] = {"Biwat"},
["bwn"] = {"Wunai Bunu"},
["bwo"] = {"Boro (yn Eetoip)", "Borna (yn Eetoip)"},
["bwp"] = {"Mandobo Bawah"},
["bwq"] = {"Bobo Madaré Yiass"},
["bwr"] = {"Bura-Pabir"},
["bws"] = {"Bomboma"},
["bwt"] = {"Bafaw-Balong"},
["bwu"] = {"Buli (y Ghaney)"},
["bww"] = {"Bwa"},
["bwx"] = {"Bu-Nao Bunu"},
["bwy"] = {"Cwi Bwamu"},
["bwz"] = {"Bwisi"},
["bxa"] = {"Tairaha"},
["bxb"] = {"Belanda Bor"},
["bxc"] = {"Molengue"},
["bxd"] = {"Pela"},
["bxe"] = {"Birale"},
["bxf"] = {"Bilur", "Minigir"},
["bxg"] = {"Bangala"},
["bxh"] = {"Buhutu"},
["bxi"] = {"Pirlatapa"},
["bxj"] = {"Bayungu"},
["bxk"] = {"Bukusu", "Lubukusu"},
["bxl"] = {"Jalkunan"},
["bxm"] = {"Buryatish Vongoilagh"},
["bxn"] = {"Burduna"},
["bxo"] = {"Barikanchi"},
["bxp"] = {"Bebil"},
["bxq"] = {"Beele"},
["bxr"] = {"Buryatish Rooshagh"},
["bxs"] = {"Busam"},
["bxu"] = {"Buryatish Heenagh"},
["bxv"] = {"Berakou"},
["bxw"] = {"Bankagooma"},
["bxz"] = {"Binahari"},
["bya"] = {"Batak"},
["byb"] = {"Bikya"},
["byc"] = {"Ubaghara"},
["byd"] = {"Benyadu'"},
["bye"] = {"Pouye"},
["byf"] = {"Bete"},
["byg"] = {"Baygo"},
["byh"] = {"Bhujel"},
["byi"] = {"Buyu"},
["byj"] = {"Bina (y Naigeer)"},
["byk"] = {"Biao"},
["byl"] = {"Bayono"},
["bym"] = {"Bidjara"},
["byn"] = {"Bilin", "Blin"},
["byo"] = {"Biyo"},
["byp"] = {"Bumaji"},
["byq"] = {"Basay"},
["byr"] = {"Baruya", "Yipma"},
["bys"] = {"Burak"},
["byt"] = {"Berti"},
["byv"] = {"Medumba"},
["byw"] = {"Belhariya"},
["byx"] = {"Qaqet"},
["byz"] = {"Banaro"},
["bza"] = {"Bandi"},
["bzb"] = {"Andio"},
["bzc"] = {"Malagasish Betsimisaraka Yiass"},
["bzd"] = {"Bribri"},
["bze"] = {"Jenaama Bozo"},
["bzf"] = {"Boikin"},
["bzg"] = {"Babuza"},
["bzh"] = {"Mapos Buang"},
["bzi"] = {"Bisu"},
["bzj"] = {"Creeole Baarle Beleeshagh"},
["bzk"] = {"Creeole Baarle Nickeraagagh"},
["bzl"] = {"Boano (Sulawesi)"},
["bzm"] = {"Bolondo"},
["bzn"] = {"Boano (Maluku)"},
["bzo"] = {"Bozaba"},
["bzp"] = {"Kemberano"},
["bzq"] = {"Buli (yn Indoneesh)"},
["bzr"] = {"Biri"},
["bzs"] = {"Çhengey Chowree Vrasseelagh"},
["bzt"] = {"Brithenig"},
["bzu"] = {"Burmeso"},
["bzv"] = {"Naami"},
["bzw"] = {"Basa (y Naigeer)"},
["bzx"] = {"Kɛlɛngaxo Bozo"},
["bzy"] = {"Obanliku"},
["bzz"] = {"Evant"},
["caa"] = {"Chortí"},
["cab"] = {"Garifunish"},
["cac"] = {"Chuj"},
["cad"] = {"Caddo"},
["cae"] = {"Lehar", "Laalaa"},
["caf"] = {"Carrier Yiass"},
["cag"] = {"Nivaclé"},
["cah"] = {"Cahuarano"},
["cai"] = {"çhengaghyn Injinagh Americaanagh Meanagh"},
["caj"] = {"Chané"},
["cak"] = {"Kaqchikel", "Cakchiquel"},
["cal"] = {"Carolinish"},
["cam"] = {"Cemuhî"},
["can"] = {"Chambri"},
["cao"] = {"Chácobo"},
["cap"] = {"Chipaya"},
["caq"] = {"Car Nicobarese"},
["car"] = {"Caribish Galibi"},
["cas"] = {"Tsimané"},
["cau"] = {"çhengaghyn Coagaashagh"},
["cav"] = {"Cavineña"},
["caw"] = {"Callawalla"},
["cax"] = {"Chiquitano"},
["cay"] = {"Cayuga"},
["caz"] = {"Canichana"},
["cba"] = {"çhengaghyn Çhibçhagh"},
["cbb"] = {"Cabiyarí"},
["cbc"] = {"Carapana"},
["cbd"] = {"Carijona"},
["cbg"] = {"Chimila"},
["cbi"] = {"Chachi"},
["cbj"] = {"Ede Cabe"},
["cbk"] = {"Chavacano"},
["cbl"] = {"Bualkhaw Chin"},
["cbn"] = {"Nyahkur"},
["cbo"] = {"Izora"},
["cbq"] = {"Tsucuba", "Cuba"},
["cbr"] = {"Cashibo-Cacataibo"},
["cbs"] = {"Cashinahua"},
["cbt"] = {"Chayahuita"},
["cbu"] = {"Candoshi-Shapra"},
["cbv"] = {"Cacua"},
["cbw"] = {"Kinabalish"},
["cby"] = {"Carabayo"},
["ccc"] = {"Chamicuro"},
["ccd"] = {"Creeole Cafundo"},
["cce"] = {"Chopi"},
["ccg"] = {"Samba Daka"},
["cch"] = {"Atsam"},
["ccj"] = {"Kasanga"},
["ccl"] = {"Cutchi-Swahili"},
["ccm"] = {"Creeole Malayish Malacca"},
["ccn"] = {"çhengaghyn Coagaashagh Hwoaie"},
["cco"] = {"Comaltepec Chinantec"},
["ccp"] = {"Chakma"},
["ccr"] = {"Cacaopera"},
["ccs"] = {"çhengaghyn Coagaashagh Yiass"},
["cda"] = {"Choni"},
["cdc"] = {"çhengaghyn Shadagh"},
["cdd"] = {"çhengaghyn Caddoagh"},
["cde"] = {"Chenchu"},
["cdf"] = {"Chiru"},
["cdh"] = {"Chambeali"},
["cdi"] = {"Chodri"},
["cdj"] = {"Churahi"},
["cdm"] = {"Chepang"},
["cdn"] = {"Chaudangsi"},
["cdo"] = {"Sheenish Min Dong"},
["cdr"] = {"Cinda-Regi-Tiyal"},
["cds"] = {"Çhengey Chowree Hadagh"},
["cdy"] = {"Chadong"},
["cdz"] = {"Koda"},
["cea"] = {"Chehalis Injil"},
["ceb"] = {"Cebuano"},
["ceg"] = {"Chamacoco"},
["cek"] = {"Khumi Chin Hiar"},
["cel"] = {"çhengaghyn Celtiagh"},
["cen"] = {"Cen"},
["cet"] = {"Centúúm"},
["cey"] = {"Ekai Chin"},
["cfa"] = {"Dijim-Bwilim"},
["cfd"] = {"Cara"},
["cfg"] = {"Como Karim"},
["cfm"] = {"Falam Chin"},
["cga"] = {"Changriwa"},
["cgc"] = {"Kagayanen"},
["cgg"] = {"Chiga"},
["cgk"] = {"Chocangacakha"},
["chb"] = {"Chibcha"},
["chc"] = {"Catawba"},
["chd"] = {"Chontal Oaxaca Sleitoil"},
["chf"] = {"Chontal Tabasco"},
["chg"] = {"Chagatai"},
["chh"] = {"Chinook"},
["chj"] = {"Ojitlán Chinantec"},
["chk"] = {"Chuukese"},
["chl"] = {"Cahuilla"},
["chm"] = {"Marish (y Roosh)"},
["chn"] = {"Chinookish"},
["cho"] = {"Shoctawish"},
["chp"] = {"Chipewyish", "Dene Suline"},
["chq"] = {"Chinantec Quiotepec"},
["chr"] = {"Sherokeeish"},
["cht"] = {"Cholón"},
["chw"] = {"Chuwabu"},
["chx"] = {"Chantyal"},
["chy"] = {"Cheyenne"},
["chz"] = {"Chinantec Ozumacín"},
["cia"] = {"Cia-Cia"},
["cib"] = {"Ci Gbe"},
["cic"] = {"Chickasawish"},
["cid"] = {"Chimariko"},
["cie"] = {"Cineni"},
["cih"] = {"Chinali"},
["cik"] = {"Chitkuli Kinnauri"},
["cim"] = {"Cimbrish"},
["cin"] = {"Cinta Larga"},
["cip"] = {"Chiapanec"},
["cir"] = {"Tiri", "Haméa", "Méa"},
["ciw"] = {"Chippewa"},
["ciy"] = {"Chaima"},
["cja"] = {"Chamish Heear"},
["cje"] = {"Chru"},
["cjh"] = {"Chehalis Heose"},
["cji"] = {"Chamalal"},
["cjk"] = {"Chokwe"},
["cjm"] = {"Chamish Hiar"},
["cjn"] = {"Chenapish"},
["cjo"] = {"Ashéninka Pajonal"},
["cjp"] = {"Cabécar"},
["cjs"] = {"Shor"},
["cjv"] = {"Chuave"},
["cjy"] = {"Sheenish Jinyu"},
["ckb"] = {"Kurdish Veanagh"},
["ckh"] = {"Chak"},
["ckl"] = {"Cibak"},
["ckm"] = {"Chakavish"},
["ckn"] = {"Kaang Chin"},
["cko"] = {"Anufo"},
["ckq"] = {"Kajakse"},
["ckr"] = {"Kairak"},
["cks"] = {"Tayo"},
["ckt"] = {"Shukçheeish"},
["cku"] = {"Koasati"},
["ckv"] = {"Kavalan"},
["ckx"] = {"Caka"},
["cky"] = {"Cakfem-Mushere"},
["ckz"] = {"Çhengey Vestit Cakchiquel-Quiché"},
["cla"] = {"Ron"},
["clc"] = {"Chilcotin"},
["cld"] = {"Noa-Aramaaish Haldeanagh"},
["cle"] = {"Chinantec Lealao"},
["clh"] = {"Chilisso"},
["cli"] = {"Chakali"},
["clj"] = {"Laitu Chin"},
["clk"] = {"Idu-Mishmi"},
["cll"] = {"Chala"},
["clm"] = {"Clallam"},
["clo"] = {"Chontal Oaxaca Injil"},
["clt"] = {"Lautu Chin"},
["clu"] = {"Caluyanun"},
["clw"] = {"Chulym"},
["cly"] = {"Chatino Sleitoil Hiar"},
["cma"] = {"Maa"},
["cmc"] = {"çhengaghyn Shamagh"},
["cme"] = {"Cerma"},
["cmg"] = {"Mongoilish Chlassicagh"},
["cmi"] = {"Emberá-Chamí"},
["cml"] = {"Campalagian"},
["cmm"] = {"Michigamea"},
["cmn"] = {"Sheenish Mandarin"},
["cmo"] = {"Mnong Meanagh"},
["cmr"] = {"Mro-Khimi Chin"},
["cms"] = {"Messapic"},
["cmt"] = {"Camtho"},
["cna"] = {"Changthang"},
["cnb"] = {"Chinbon Chin"},
["cnc"] = {"Côông"},
["cng"] = {"Qiang Hwoaie"},
["cnh"] = {"Hakha Chin", "Haka Chin"},
["cni"] = {"Asháninka"},
["cnk"] = {"Khumi Chin"},
["cnl"] = {"Lalana Chinantec"},
["cno"] = {"Con"},
["cnp"] = {"Sheenish Ping Hwoaie", "Pinghua Hwoaie"},
["cnq"] = {"Chung"},
["cnr"] = {"Montenegrish"},
["cns"] = {"Asmatish Veanagh"},
["cnt"] = {"Chinantec Tepetotutla"},
["cnu"] = {"Chenoua"},
["cnw"] = {"Ngawn Chin"},
["cnx"] = {"Cornish Veanagh"},
["coa"] = {"Malayish Ellanyn Cocos"},
["cob"] = {"Chicomuceltec"},
["coc"] = {"Cocopa"},
["cod"] = {"Cocama-Cocamilla"},
["coe"] = {"Koreguaje"},
["cof"] = {"Colorado"},
["cog"] = {"Chong"},
["coh"] = {"Chonyi-Dzihana-Kauma", "Chichonyi-Chidzihana-Chikauma"},
["coj"] = {"Cochimi"},
["cok"] = {"Santa Teresa Cora"},
["col"] = {"Columbia-Wenatchi"},
["com"] = {"Comançheeish"},
["con"] = {"Cofán"},
["coo"] = {"Comox"},
["cop"] = {"Coptish"},
["coq"] = {"Coquille"},
["cot"] = {"Caquinte"},
["cou"] = {"Wamey"},
["cov"] = {"Cao Miao"},
["cow"] = {"Cowlitz"},
["cox"] = {"Nanti"},
["coz"] = {"Chochotec"},
["cpa"] = {"Palantla Chinantec"},
["cpb"] = {"Ucayali-Yurúa Ashéninka"},
["cpc"] = {"Ajyíninka Apurucayali"},
["cpe"] = {"creeoleyn as baarlaghyn brisht bunnit er y Vaarle"},
["cpf"] = {"creeoleyn as baarlaghyn brisht bunnit er y Rangish"},
["cpg"] = {"Greagish Cappadocia"},
["cpi"] = {"Baarle Vrisht Heenagh"},
["cpn"] = {"Cherepon"},
["cpo"] = {"Kpeego"},
["cpp"] = {"creeoleyn as baarlaghyn brisht bunnit er y Phortiugish"},
["cps"] = {"Capiznon"},
["cpu"] = {"Pichis Ashéninka"},
["cpx"] = {"Sheenish Pu-Xian"},
["cpy"] = {"Ashéninka Ucayali Yiass"},
["cqd"] = {"Chuanqiandian Cluster Miao"},
["cra"] = {"Chara"},
["crb"] = {"Caribish Ellanagh"},
["crc"] = {"Lonwolwol"},
["crd"] = {"Coeur d'Alene"},
["crf"] = {"Caramanta"},
["crg"] = {"Michif"},
["crh"] = {"Tatarish Chrimeeagh", "Turkish Chrimeeagh"},
["cri"] = {"Sãotomense"},
["crj"] = {"Creeish Hiar Yiass"},
["crk"] = {"Creeish ny Strahyn"},
["crl"] = {"Creeish Hiar Hwoaie"},
["crm"] = {"Creeish Moose"},
["crn"] = {"El Nayar Cora"},
["cro"] = {"Crowish"},
["crp"] = {"Creeoleyn as baarlaghyn brisht"},
["crq"] = {"Iyo'wujwa Chorote"},
["crr"] = {"Algonquiagh Carolina"},
["crs"] = {"Creeole Frangish Seselwa"},
["crt"] = {"Iyojwa'ja Chorote"},
["crv"] = {"Chaura"},
["crw"] = {"Chrau"},
["crx"] = {"Carrier"},
["cry"] = {"Cori"},
["crz"] = {"Cruzeño"},
["csa"] = {"Chinantec Chiltepec"},
["csb"] = {"Kashoobish"},
["csc"] = {"Çhengey Chowree Chataloanagh", "Lengua de señas catalana", "Llengua de Signes Catalana"},
["csd"] = {"Çhengey Chowree Chiangmai"},
["cse"] = {"Çhengey Chowree Heckagh"},
["csf"] = {"Çhengey Chowree Choobagh"},
["csg"] = {"Çhengey Chowree Hilleeagh"},
["csh"] = {"Chin Asho"},
["csi"] = {"Miwok Coose"},
["csj"] = {"Chin Songlai"},
["csk"] = {"Jola-Kasa"},
["csl"] = {"Çhengey Chowree Heenagh"},
["csm"] = {"Miwokish Sierra Veanagh"},
["csn"] = {"Çhengey Chowree Cholombagh"},
["cso"] = {"Chinantec Sochiapam", "Chinantec Sochiapan"},
["csp"] = {"Sheenish Pink Yiass", "Pinghua Yiass"},
["csq"] = {"Çhengey Chowree Chroitagh"},
["csr"] = {"Çhengey Chowree Choose-verçhagh"},
["css"] = {"Ohlone Yiass"},
["cst"] = {"Ohlone Hwoaie"},
["csu"] = {"çhengaghyn Soodaanagh Meanagh"},
["csv"] = {"Chin Sumtu"},
["csw"] = {"Creeish Ushlagh"},
["csx"] = {"Çhengey Chowree Chamboydagh"},
["csy"] = {"Siyin Chin"},
["csz"] = {"Coos"},
["cta"] = {"Tataltepec Chatino"},
["ctc"] = {"Chetco"},
["ctd"] = {"Chin Tedim"},
["cte"] = {"Chinantec Tepinapa"},
["ctg"] = {"Chittagonish"},
["cth"] = {"Chin Thaiphum"},
["ctl"] = {"Chinantec Tlacoatzintepec"},
["ctm"] = {"Chitimacha"},
["ctn"] = {"Chhintange"},
["cto"] = {"Emberá-Catío"},
["ctp"] = {"Chatino Sleitoil Heear"},
["cts"] = {"Bikol Catanduanes Heear"},
["ctt"] = {"Wayanad Chetti"},
["ctu"] = {"Chol"},
["cty"] = {"Moundadan Chetty"},
["ctz"] = {"Chatino Zacatepec"},
["cua"] = {"Cua"},
["cub"] = {"Cubeo"},
["cuc"] = {"Usila Chinantec"},
["cuh"] = {"Chuka", "Gichuka"},
["cui"] = {"Cuiba"},
["cuj"] = {"Mashco Piro"},
["cuk"] = {"San Blas Kuna"},
["cul"] = {"Culina", "Kulina"},
["cuo"] = {"Cumanagoto"},
["cup"] = {"Cupeño"},
["cuq"] = {"Cun"},
["cur"] = {"Chhulung"},
["cus"] = {"çhengaghyn Cushitagh"},
["cut"] = {"Teutila Cuicatec"},
["cuu"] = {"Tai Ya"},
["cuv"] = {"Cuvok"},
["cuw"] = {"Chukwa"},
["cux"] = {"Tepeuxila Cuicatec"},
["cuy"] = {"Cuitlatec"},
["cvg"] = {"Chug"},
["cvn"] = {"Valle Nacional Chinantec"},
["cwa"] = {"Kabwa"},
["cwb"] = {"Maindo"},
["cwd"] = {"Creeish ny Keylljyn"},
["cwe"] = {"Kwere"},
["cwg"] = {"Chewong", "Cheq Wong"},
["cwt"] = {"Kuwaataay"},
["cxh"] = {"Cha'ari"},
["cya"] = {"Nopala Chatino"},
["cyb"] = {"Cayubaba"},
["cyo"] = {"Cuyonon"},
["czh"] = {"Sheenish Huizhou"},
["czk"] = {"Knaanic"},
["czn"] = {"Zenzontepec Chatino"},
["czo"] = {"Sheenish Min Zhong"},
["czt"] = {"Zotung Chin"},
["daa"] = {"Dangaléat"},
["dac"] = {"Dambi"},
["dad"] = {"Marik"},
["dae"] = {"Duupa"},
["dag"] = {"Dagbani"},
["dah"] = {"Gwahatike"},
["dai"] = {"Day"},
["daj"] = {"Dar Fur Daju"},
["dak"] = {"Dakota"},
["dal"] = {"Dahalo"},
["dam"] = {"Damakawa"},
["dao"] = {"Daai Chin"},
["daq"] = {"Dandami Maria"},
["dar"] = {"Dargwa"},
["das"] = {"Daho-Doo"},
["dau"] = {"Dar Sila Daju"},
["dav"] = {"Taita", "Dawida"},
["daw"] = {"Davawenyo"},
["dax"] = {"Dayi"},
["day"] = {"çhengaghyn Land Dayak"},
["daz"] = {"Dao"},
["dba"] = {"Bangime"},
["dbb"] = {"Deno"},
["dbd"] = {"Dadiya"},
["dbe"] = {"Dabe"},
["dbf"] = {"Edopi"},
["dbg"] = {"Dogul Dom Dogon"},
["dbi"] = {"Doka"},
["dbj"] = {"Ida'an"},
["dbl"] = {"Dyirbal"},
["dbm"] = {"Duguri"},
["dbn"] = {"Duriankere"},
["dbo"] = {"Dulbu"},
["dbp"] = {"Duwai"},
["dbq"] = {"Daba"},
["dbr"] = {"Dabarre"},
["dbt"] = {"Ben Tey Dogon"},
["dbu"] = {"Bondum Dom Dogon"},
["dbv"] = {"Dungu"},
["dbw"] = {"Bankan Tey Dogon"},
["dby"] = {"Dibiyaso"},
["dcc"] = {"Deccan"},
["dcr"] = {"Negerhollands"},
["dda"] = {"Dadi Dadi"},
["ddd"] = {"Dongotono"},
["dde"] = {"Doondo"},
["ddg"] = {"Fataluku"},
["ddi"] = {"West Goodenough"},
["ddj"] = {"Jaru"},
["ddn"] = {"Dendi (Benin)"},
["ddo"] = {"Dido"},
["ddr"] = {"Dhudhuroa"},
["dds"] = {"Donno So Dogon"},
["ddw"] = {"Dawera-Daweloor"},
["dec"] = {"Dagik"},
["ded"] = {"Dedua"},
["dee"] = {"Dewoin"},
["def"] = {"Dezfuli"},
["deg"] = {"Degema"},
["deh"] = {"Dehwari"},
["dei"] = {"Demisa"},
["dek"] = {"Dek"},
["del"] = {"Delaware"},
["dem"] = {"Dem"},
["den"] = {"Slavish (Athapascagh)"},
["dep"] = {"Pidgin Delaware"},
["deq"] = {"Dendi (Pobblaght yn Affrick Veanagh)"},
["der"] = {"Deori"},
["des"] = {"Desano"},
["dev"] = {"Domung"},
["dez"] = {"Dengese"},
["dga"] = {"Dagaare Yiass"},
["dgb"] = {"Bunoge Dogon"},
["dgc"] = {"Casiguran Dumagat Agta"},
["dgd"] = {"Dagaari Dioula"},
["dge"] = {"Degenan"},
["dgg"] = {"Doga"},
["dgh"] = {"Dghwede"},
["dgi"] = {"Dagara Hwoaie"},
["dgk"] = {"Dagba"},
["dgl"] = {"Andaandi", "Dongolawi"},
["dgn"] = {"Dagoman"},
["dgo"] = {"Dogri (çhengey er lheh)"},
["dgr"] = {"Dogrib", "Tłı̨chǫ"},
["dgs"] = {"Dogoso"},
["dgt"] = {"Ndra'ngith"},
["dgw"] = {"Daungwurrung"},
["dgx"] = {"Doghoro"},
["dgz"] = {"Daga"},
["dhd"] = {"Dhundari"},
["dhg"] = {"Dhangu-Djangu", "Dhangu", "Djangu"},
["dhi"] = {"Dhimal"},
["dhl"] = {"Dhalandji"},
["dhm"] = {"Zemba"},
["dhn"] = {"Dhanki"},
["dho"] = {"Dhodia"},
["dhr"] = {"Dhargari"},
["dhs"] = {"Dhaiso"},
["dhu"] = {"Dhurga"},
["dhv"] = {"Dehu", "Drehu"},
["dhw"] = {"Dhanwar (Nepaal)"},
["dhx"] = {"Dhungaloo"},
["dia"] = {"Dia"},
["dib"] = {"Dinka Yiass Veanagh"},
["dic"] = {"Lakota Dida"},
["did"] = {"Didinga"},
["dif"] = {"Dieri", "Diyari"},
["dig"] = {"Digo", "Chidigo"},
["dih"] = {"Kumiai"},
["dii"] = {"Dimbong"},
["dij"] = {"Dai"},
["dik"] = {"Dinka Heear Yiass"},
["dil"] = {"Dilling"},
["dim"] = {"Dime"},
["din"] = {"Dinka"},
["dio"] = {"Dibo"},
["dip"] = {"Dinka Hiar Yiass"},
["diq"] = {"Dimli (çhengey er lheh)"},
["dir"] = {"Dirim"},
["dis"] = {"Dimasa"},
["diu"] = {"Diriku"},
["diw"] = {"Dinka Heear Hwoaie"},
["dix"] = {"Dixon Reef"},
["diy"] = {"Diuwe"},
["diz"] = {"Ding"},
["dja"] = {"Djadjawurrung"},
["djb"] = {"Djinba"},
["djc"] = {"Dar Daju Daju"},
["djd"] = {"Djamindjung", "Ngaliwurru"},
["dje"] = {"Zarma"},
["djf"] = {"Djangun"},
["dji"] = {"Djinang"},
["djj"] = {"Djeebbana"},
["djk"] = {"Creeole Maroon Hiar", "Businenge Tongo", "Nenge"},
["djm"] = {"Jamsay Dogon"},
["djn"] = {"Jawoyn", "Djauan"},
["djo"] = {"Jangkang"},
["djr"] = {"Djambarrpuyngu"},
["dju"] = {"Kapriman"},
["djw"] = {"Djawi"},
["dka"] = {"Dakpakha"},
["dkg"] = {"Kadung"},
["dkk"] = {"Dakka"},
["dkr"] = {"Kuijau"},
["dks"] = {"Dinka Hiar Yiass"},
["dkx"] = {"Mazagway"},
["dlg"] = {"Dolgan"},
["dlk"] = {"Dahalik"},
["dlm"] = {"Dalmaatish"},
["dln"] = {"Darlong"},
["dma"] = {"Duma"},
["dmb"] = {"Mombo Dogon"},
["dmc"] = {"Gavak"},
["dmd"] = {"Madhi Madhi"},
["dme"] = {"Dugwor"},
["dmf"] = {"Medefaidrin"},
["dmg"] = {"Kinabatangan Heose"},
["dmk"] = {"Domaaki"},
["dml"] = {"Dameli"},
["dmm"] = {"Dama"},
["dmn"] = {"çhengaghyn Mande"},
["dmo"] = {"Kemedzung"},
["dmr"] = {"Damar Hiar"},
["dms"] = {"Dampelas"},
["dmu"] = {"Dubu", "Tebi"},
["dmv"] = {"Dumpas"},
["dmw"] = {"Mudburra"},
["dmx"] = {"Dema"},
["dmy"] = {"Demta", "Sowari"},
["dna"] = {"Dani yn Upper Grand Valley"},
["dnd"] = {"Daonda"},
["dne"] = {"Ndendeule"},
["dng"] = {"Dungan"},
["dni"] = {"Dani yn Lower Grand Valley"},
["dnj"] = {"Dan"},
["dnk"] = {"Dengka"},
["dnn"] = {"Dzùùngoo"},
["dno"] = {"Ndrulo", "Lendu Hwoaie"},
["dnr"] = {"Danaru"},
["dnt"] = {"Dani yn Mid Grand Valley"},
["dnu"] = {"Danau"},
["dnv"] = {"Danu"},
["dnw"] = {"Dani Heear"},
["dny"] = {"Dení"},
["doa"] = {"Dom"},
["dob"] = {"Dobu"},
["doc"] = {"Dong Hwoaie"},
["doe"] = {"Doe"},
["dof"] = {"Domu"},
["doh"] = {"Dong"},
["doi"] = {"Dogri (mooar-hengey)"},
["dok"] = {"Dondo"},
["dol"] = {"Doso"},
["don"] = {"Toura (Papooey Guinea Noa)"},
["doo"] = {"Dongo"},
["dop"] = {"Lukpa"},
["doq"] = {"Çhengey Chowree Ghominicagh"},
["dor"] = {"Dori'o"},
["dos"] = {"Dogosé"},
["dot"] = {"Dass"},
["dov"] = {"Dombe"},
["dow"] = {"Doyayo"},
["dox"] = {"Bussa"},
["doy"] = {"Dompo"},
["doz"] = {"Dorze"},
["dpp"] = {"Papar"},
["dra"] = {"çhengaghyn Dravidagh"},
["drb"] = {"Dair"},
["drc"] = {"Minderico"},
["drd"] = {"Darmiya"},
["dre"] = {"Dolpo"},
["drg"] = {"Rungus"},
["dri"] = {"C'Lela"},
["drl"] = {"Paakantyi"},
["drn"] = {"Damar Heear"},
["dro"] = {"Daro-Matu Melanau"},
["drq"] = {"Dura"},
["drs"] = {"Gedeo"},
["drt"] = {"Drents"},
["dru"] = {"Rukai"},
["dry"] = {"Darai"},
["dsb"] = {"Sorbish Eeghtyragh"},
["dse"] = {"Çhengey Chowree Ollanagh"},
["dsh"] = {"Daasanach"},
["dsi"] = {"Disa"},
["dsk"] = {"Dokshi"},
["dsl"] = {"Çhengey Chowree Ghanvargagh"},
["dsn"] = {"Dusner"},
["dso"] = {"Desiya"},
["dsq"] = {"Tadaksahak"},
["dsz"] = {"Çh Chowree Mardin"},
["dta"] = {"Daur"},
["dtb"] = {"Labuk-Kinabatangan Kadazan"},
["dtd"] = {"Ditidaht"},
["dth"] = {"Adithinngithigh"},
["dti"] = {"Ana Tinga Dogon"},
["dtk"] = {"Tene Kan Dogon"},
["dtm"] = {"Tomo Kan Dogon"},
["dtn"] = {"Daatsʼíin"},
["dto"] = {"Tommo So Dogon"},
["dtp"] = {"Kadazan Dusun", "Dusun Veanagh"},
["dtr"] = {"Lotud"},
["dts"] = {"Toro So Dogon"},
["dtt"] = {"Toro Tegu Dogon"},
["dtu"] = {"Tebul Ure Dogon"},
["dty"] = {"Dotyali"},
["dua"] = {"Duala"},
["dub"] = {"Dubli"},
["duc"] = {"Duna"},
["due"] = {"Umiray Dumaget Agta"},
["duf"] = {"Dumbea", "Drubea"},
["dug"] = {"Duruma", "Chiduruma"},
["duh"] = {"Dungra Bhil"},
["dui"] = {"Dumun"},
["duk"] = {"Uyajitaya"},
["dul"] = {"Alabat Island Agta"},
["dum"] = {"Ollanish Veanagh (ca. 1050-1350)"},
["dun"] = {"Dusun Deyah"},
["duo"] = {"Dupaninan Agta"},
["dup"] = {"Duano"},
["duq"] = {"Dusun Malang"},
["dur"] = {"Dii"},
["dus"] = {"Dumi"},
["duu"] = {"Drung"},
["duv"] = {"Duvle"},
["duw"] = {"Dusun Witu"},
["dux"] = {"Duungooma"},
["duy"] = {"Dicamay Agta"},
["duz"] = {"Duli-Gey"},
["dva"] = {"Duau"},
["dwa"] = {"Diri"},
["dwk"] = {"Dawik Kui"},
["dwr"] = {"Dawro"},
["dws"] = {"Dutton World Speedwords"},
["dwu"] = {"Dhuwal"},
["dww"] = {"Dawawa"},
["dwy"] = {"Dhuwaya"},
["dwz"] = {"Dewas Rai"},
["dya"] = {"Dyan"},
["dyb"] = {"Dyaberdyaber"},
["dyd"] = {"Dyugun"},
["dyg"] = {"Villa Viciosa Agta"},
["dyi"] = {"Djimini Senoufo"},
["dym"] = {"Yanda Dom Dogon"},
["dyn"] = {"Dyangadi", "Dhanggatti"},
["dyo"] = {"Jola-Fonyi"},
["dyr"] = {"Dyarim"},
["dyu"] = {"Dyulish"},
["dyy"] = {"Djabugay", "Dyaabugay"},
["dza"] = {"Tunzu"},
["dzd"] = {"Daza"},
["dze"] = {"Djiwarli"},
["dzg"] = {"Dazaga"},
["dzl"] = {"Dzalakha"},
["dzn"] = {"Dzando"},
["eaa"] = {"Karenggapa"},
["ebc"] = {"Beginci"},
["ebg"] = {"Ebughu"},
["ebk"] = {"Bontok Hiar"},
["ebo"] = {"Teke-Ebo"},
["ebr"] = {"Ebrié"},
["ebu"] = {"Embu", "Kiembu"},
["ecr"] = {"Eteocretan"},
["ecs"] = {"Çhengey Chowree Ecuadoragh"},
["ecy"] = {"Eteocheeprish"},
["eee"] = {"E"},
["efa"] = {"Efai"},
["efe"] = {"Efe"},
["efi"] = {"Efik"},
["ega"] = {"Ega"},
["egl"] = {"Emilianish"},
["egm"] = {"Benamanga"},
["ego"] = {"Eggon"},
["egx"] = {"çhengaghyn Egyptagh"},
["egy"] = {"Egyptish (Shenn)"},
["ehs"] = {"Çhengey Chowree Miyakubo"},
["ehu"] = {"Ehueun"},
["eip"] = {"Eipomek"},
["eit"] = {"Eitiep"},
["eiv"] = {"Askopan"},
["eja"] = {"Ejamat"},
["eka"] = {"Ekajuk"},
["eke"] = {"Ekit"},
["ekg"] = {"Ekari"},
["eki"] = {"Eki"},
["ekk"] = {"Estoinish"},
["ekl"] = {"Kol (y Vangladesh)", "Kol"},
["ekm"] = {"Elip"},
["eko"] = {"Koti"},
["ekp"] = {"Ekpeye"},
["ekr"] = {"Yace"},
["eky"] = {"Kayah Hiar"},
["ele"] = {"Elepi"},
["elh"] = {"El Hugeirat"},
["eli"] = {"Nding"},
["elk"] = {"Elkei"},
["elm"] = {"Eleme"},
["elo"] = {"El Molo"},
["elu"] = {"Elu"},
["elx"] = {"Elamish"},
["ema"] = {"Emai-Iuleha-Ora"},
["emb"] = {"Embaloh"},
["eme"] = {"Emerillon"},
["emg"] = {"Meohang Hiar"},
["emi"] = {"Mussau-Emira"},
["emk"] = {"Maninkish Hiar"},
["emm"] = {"Mamulique"},
["emn"] = {"Emanish"},
["emp"] = {"Emberá Hwoaie"},
["emq"] = {"Minyagish Hiar"},
["ems"] = {"Yupik Lhoob y Cheayn Sheealtagh"},
["emu"] = {"Muria Hiar"},
["emw"] = {"Emplawas"},
["emx"] = {"Erromintxela"},
["emy"] = {"Mayish Epigrafagh"},
["emz"] = {"Mbessa"},
["ena"] = {"Apali"},
["enb"] = {"Markweeta"},
["enc"] = {"En"},
["end"] = {"Ende"},
["enf"] = {"Enetsish ny Keylljyn"},
["enh"] = {"Enetsish y Tundrey"},
["enl"] = {"Enlhet"},
["enm"] = {"Baarle Veanagh (1100-1500)"},
["enn"] = {"Engenni"},
["eno"] = {"Enggano"},
["enq"] = {"Enga"},
["enr"] = {"Emumu", "Emem"},
["enu"] = {"Enu"},
["env"] = {"Enwan (Steat Edo)"},
["enw"] = {"Enwan (Steat Akwa Ibom)"},
["enx"] = {"Enxet"},
["eot"] = {"Beti (y Clyst Iuaagagh)"},
["epi"] = {"Epie"},
["era"] = {"Eravallan"},
["erg"] = {"Sie"},
["erh"] = {"Eruwa"},
["eri"] = {"Ogea"},
["erk"] = {"Efate Yiass"},
["ero"] = {"Horpa"},
["err"] = {"Erre"},
["ers"] = {"Ersu"},
["ert"] = {"Eritai"},
["erw"] = {"Erokwanas"},
["ese"] = {"Ese Ejja"},
["esg"] = {"Aheri Gondi"},
["esh"] = {"Eshtehardi"},
["esi"] = {"Inupiatun Alaska Hwoaie"},
["esk"] = {"Inupiatun Alaska Heear Hwoaie"},
["esl"] = {"Çhengey Chowree yn Egypt"},
["esm"] = {"Esuma"},
["esn"] = {"Çhengey Chowree Halvadoragh"},
["eso"] = {"Çhengey Chowree Estaanagh"},
["esq"] = {"Esselen"},
["ess"] = {"Yupik y Çhibbeyr Veanagh"},
["esu"] = {"Yupik Veanagh"},
["esx"] = {"çhengaghyn Eskimogh-Aleutagh"},
["esy"] = {"Eskayan"},
["etb"] = {"Etebi"},
["etc"] = {"Etchemin"},
["eth"] = {"Çhengey Chowree Eetoipagh"},
["etn"] = {"Eton (Vanuatu)"},
["eto"] = {"Eton (Cameroon)"},
["etr"] = {"Edolo"},
["ets"] = {"Yekhee"},
["ett"] = {"Etruscish"},
["etu"] = {"Ejagham"},
["etx"] = {"Eten"},
["etz"] = {"Semimi"},
["eud"] = {"Eudeve"},
["euq"] = {"Bascagh (kynney)"},
["eve"] = {"Evenish"},
["evh"] = {"Uvbie"},
["evn"] = {"Evenkish"},
["ewo"] = {"Ewondo"},
["ext"] = {"Estremadurish"},
["eya"] = {"Eyak"},
["eyo"] = {"Keiyo"},
["eza"] = {"Ezaa"},
["eze"] = {"Uzekwe"},
["faa"] = {"Fasu"},
["fab"] = {"Fa d'Ambu"},
["fad"] = {"Wagi"},
["faf"] = {"Fagani"},
["fag"] = {"Finongan"},
["fah"] = {"Baissa Fali"},
["fai"] = {"Faiwol"},
["faj"] = {"Faita"},
["fak"] = {"Fang (Cameroon)"},
["fal"] = {"Fali Yiass"},
["fam"] = {"Fam"},
["fan"] = {"Fang (Guinea Chryss ny Cruinney)"},
["fap"] = {"Paloor"},
["far"] = {"Fataleka"},
["fat"] = {"Fanti"},
["fau"] = {"Fayu"},
["fax"] = {"Fala"},
["fay"] = {"Fars Heear Yiass"},
["faz"] = {"Fars Heear Hwoaie"},
["fbl"] = {"Bikol Albay Heear"},
["fcs"] = {"Çhengey Chowree Québec"},
["fer"] = {"Feroge"},
["ffi"] = {"Foia Foia"},
["ffm"] = {"Maasina Fulfulde"},
["fgr"] = {"Fongoro"},
["fia"] = {"Nobiin"},
["fie"] = {"Fyer"},
["fif"] = {"Faifi"},
["fil"] = {"Philippeenish"},
["fip"] = {"Fipa"},
["fir"] = {"Firan"},
["fit"] = {"Finnlynnish Tornedal", "Meänkieli"},
["fiu"] = {"çhengaghyn Finn-Oogragh"},
["fiw"] = {"Fiwaga"},
["fkk"] = {"Kirya-Konzəl"},
["fkv"] = {"Finnlynnish Kven"},
["fla"] = {"Kalispel-Pend d'Oreille"},
["flh"] = {"Foau"},
["fli"] = {"Fali"},
["fll"] = {"Fali Hwoaie"},
["fln"] = {"Flinders Island"},
["flr"] = {"Fuliiru"},
["fly"] = {"Flaaitaal", "Tsotsitaal"},
["fmp"] = {"Fe'fe'"},
["fmu"] = {"Muria Heear Foddey"},
["fnb"] = {"Fanbak"},
["fng"] = {"Fanagalo"},
["fni"] = {"Fania"},
["fod"] = {"Foodo"},
["foi"] = {"Foi"},
["fom"] = {"Foma"},
["fon"] = {"Fon"},
["for"] = {"Fore"},
["fos"] = {"Siraya"},
["fox"] = {"çhengaghyn Formosagh"},
["fpe"] = {"Creeole Baarle Fernando Po"},
["fqs"] = {"Fas"},
["frc"] = {"Frangish Cajun"},
["frd"] = {"Fordata"},
["frk"] = {"Frankish"},
["frm"] = {"Frangish Veanagh (ca. 1400-1600)"},
["fro"] = {"Shenn Rangish (842-ca. 1400)"},
["frp"] = {"Arpitanish", "Francoprovençal"},
["frq"] = {"Forak"},
["frr"] = {"Freeshlannish Hwoaie"},
["frs"] = {"Freeshlannish Hiar"},
["frt"] = {"Fortsenal"},
["fse"] = {"Çhengey Cowree Innlynnagh"},
["fsl"] = {"Çhengey Chowree Rangagh"},
["fss"] = {"Çhengey Chowree Finnlynn-y Toolynn", "finlandssvenskt teckenspråk", "suomenruotsalainen viittomakieli"},
["fub"] = {"Adamawa Fulfulde"},
["fuc"] = {"Pulaarish"},
["fud"] = {"Futuna Hiar"},
["fue"] = {"Borgu Fulfulde"},
["fuf"] = {"Pularish"},
["fuh"] = {"Fulfulde y Neegeyr Heear"},
["fui"] = {"Fulfulde Bagirmi"},
["fuj"] = {"Ko"},
["fum"] = {"Fum"},
["fun"] = {"Fulniô"},
["fuq"] = {"Fulfulde y Neegeyr Hiar Veanagh"},
["fur"] = {"Friulish"},
["fut"] = {"Futuna-Aniwa"},
["fuu"] = {"Furu"},
["fuv"] = {"Fulfulde y Naigeer"},
["fuy"] = {"Fuyug"},
["fvr"] = {"Fur"},
["fwa"] = {"Fwâi"},
["fwe"] = {"Fwe"},
["gaa"] = {"Ga"},
["gab"] = {"Gabri"},
["gac"] = {"Andamanish Vooar Vestit"},
["gad"] = {"Gaddang"},
["gae"] = {"Guarequena"},
["gaf"] = {"Gende"},
["gag"] = {"Gagauzish"},
["gah"] = {"Alekano"},
["gai"] = {"Borei"},
["gaj"] = {"Gadsup"},
["gak"] = {"Gamkonora"},
["gal"] = {"Galolen"},
["gam"] = {"Kandawo"},
["gan"] = {"Sheenish Gan"},
["gao"] = {"Gants"},
["gap"] = {"Gal"},
["gaq"] = {"Gata'"},
["gar"] = {"Galeya"},
["gas"] = {"Adiwasi Garasia"},
["gat"] = {"Kenati"},
["gau"] = {"Mudhili Gadaba"},
["gaw"] = {"Nobonob"},
["gax"] = {"Borana-Arsi-Guji Oromo"},
["gay"] = {"Gayo"},
["gaz"] = {"Oromoish Veanagh Heear"},
["gba"] = {"Gbaya (Pobblaght yn Affrick Veanagh)"},
["gbb"] = {"Kaytetye"},
["gbd"] = {"Karajarri"},
["gbe"] = {"Niksek"},
["gbf"] = {"Gaikundi"},
["gbg"] = {"Gbanziri"},
["gbh"] = {"Defi Gbe"},
["gbi"] = {"Galela"},
["gbj"] = {"Bodo Gadaba"},
["gbk"] = {"Gaddi"},
["gbl"] = {"Gamit"},
["gbm"] = {"Garhwali"},
["gbn"] = {"Mo'da"},
["gbo"] = {"Grebo Hwoaie"},
["gbp"] = {"Gbaya-Bossangoa"},
["gbq"] = {"Gbaya-Bozoum"},
["gbr"] = {"Gbagyi"},
["gbs"] = {"Gbesi Gbe"},
["gbu"] = {"Gagadu"},
["gbv"] = {"Gbanu"},
["gbw"] = {"Gabi-Gabi"},
["gbx"] = {"Xwla Gbe Hiar"},
["gby"] = {"Gbari"},
["gbz"] = {"Darish Horoastrianagh"},
["gcc"] = {"Mali"},
["gcd"] = {"Ganggalida"},
["gce"] = {"Galice"},
["gcf"] = {"Creeole Frangish Guadeloupe"},
["gcl"] = {"Creeole Baarle Grenadagh"},
["gcn"] = {"Gaina"},
["gcr"] = {"Creeole Frangish Geeaanagh"},
["gct"] = {"Germaanish Colonia Tovar"},
["gda"] = {"Gade Lohar"},
["gdb"] = {"Pottangi Ollar Gadaba"},
["gdc"] = {"Gugu Badhun"},
["gdd"] = {"Gedaged"},
["gde"] = {"Gude"},
["gdf"] = {"Guduf-Gava"},
["gdg"] = {"Ga'dang"},
["gdh"] = {"Gadjerawang", "Gajirrabeng"},
["gdi"] = {"Gundi"},
["gdj"] = {"Gurdjar"},
["gdk"] = {"Gadang"},
["gdl"] = {"Dirasha"},
["gdm"] = {"Laal"},
["gdn"] = {"Umanakaina"},
["gdo"] = {"Ghodoberi"},
["gdq"] = {"Mehri"},
["gdr"] = {"Wipi"},
["gds"] = {"Çhengey CHowree Ghandruk"},
["gdt"] = {"Kungardutyi"},
["gdu"] = {"Gudu"},
["gdx"] = {"Godwari"},
["gea"] = {"Geruma"},
["geb"] = {"Kire"},
["gec"] = {"Gboloo Grebo"},
["ged"] = {"Gade"},
["gef"] = {"Gerai"},
["geg"] = {"Gengle"},
["geh"] = {"Germaanish utteragh", "Hutterisch"},
["gei"] = {"Gebe"},
["gej"] = {"Gen"},
["gek"] = {"Ywom"},
["gel"] = {"ut-Ma'in"},
["gem"] = {"çhengaghyn Germaanic"},
["geq"] = {"Geme"},
["ges"] = {"Geser-Gorom"},
["gev"] = {"Eviya"},
["gew"] = {"Gera"},
["gex"] = {"Garre"},
["gey"] = {"Enya"},
["gez"] = {"Geez"},
["gfk"] = {"Patpatar"},
["gft"] = {"Gafat"},
["gga"] = {"Gao"},
["ggb"] = {"Gbii"},
["ggd"] = {"Gugadj"},
["gge"] = {"Gurr-goni"},
["ggg"] = {"Gurgula"},
["ggk"] = {"Kungarakany"},
["ggl"] = {"Ganglau"},
["ggt"] = {"Gitua"},
["ggu"] = {"Gagu", "Gban"},
["ggw"] = {"Gogodala"},
["gha"] = {"Ghadamès"},
["ghc"] = {"Gaelg Yerno-Albinagh"},
["ghe"] = {"Ghale Yiass"},
["ghh"] = {"Ghale Hwoaie"},
["ghk"] = {"Karenish Geko"},
["ghl"] = {"Ghulfan"},
["ghn"] = {"Ghanongga"},
["gho"] = {"Ghomara"},
["ghr"] = {"Ghera"},
["ghs"] = {"Guhu-Samane"},
["ght"] = {"Kuke", "Kutang Ghale"},
["gia"] = {"Kija"},
["gib"] = {"Gibanawa"},
["gic"] = {"Gail"},
["gid"] = {"Gidar"},
["gie"] = {"Gaɓogbo", "Guébie"},
["gig"] = {"Goaria"},
["gih"] = {"Githabul"},
["gii"] = {"Girirra"},
["gil"] = {"Gilbertish"},
["gim"] = {"Gimi (yn Ard-Heer Hiar)"},
["gin"] = {"Hinukh"},
["gip"] = {"Gimi (y Vretyn Noa Heear)"},
["giq"] = {"Gelao Eayney"},
["gir"] = {"Gelao Jiarg"},
["gis"] = {"Giziga Hwoaie"},
["git"] = {"Gitxsan"},
["giu"] = {"Mulao"},
["giw"] = {"Gelao Bane"},
["gix"] = {"Gilima"},
["giy"] = {"Giyug"},
["giz"] = {"Giziga Yiass"},
["gjk"] = {"Kachi Koli"},
["gjm"] = {"Gunditjmara"},
["gjn"] = {"Gonja"},
["gjr"] = {"Kriol Gurindji"},
["gju"] = {"Gujari"},
["gka"] = {"Guya"},
["gkd"] = {"Magɨ (Queiggey Madang)"},
["gke"] = {"Ndai"},
["gkn"] = {"Gokana"},
["gko"] = {"Kok-Nar"},
["gkp"] = {"Kpelle yn Ghuinea"},
["gku"] = {"ǂUngkue"},
["glb"] = {"Belning"},
["glc"] = {"Bon Gula"},
["gld"] = {"Nanai"},
["glh"] = {"Pashai Heear Hwoaie", "Pashayi Heear Hwoaie"},
["glj"] = {"Gula Iro"},
["glk"] = {"Gilaki"},
["gll"] = {"Garlali"},
["glo"] = {"Galambu"},
["glr"] = {"Glaro-Twabo"},
["glu"] = {"Gula (Shad)"},
["glw"] = {"Glavda"},
["gly"] = {"Gule"},
["gma"] = {"Gambera"},
["gmb"] = {"Gula'alaa"},
["gmd"] = {"Mághdì"},
["gme"] = {"çhengaghyn Germaanic Hiar"},
["gmg"] = {"Magɨyi"},
["gmh"] = {"Ard-Ghermaanish Veanagh (ca. 1050-1500)"},
["gml"] = {"Germaanish Injil Veanagh"},
["gmm"] = {"Gbaya-Mbodomo"},
["gmn"] = {"Gimnime"},
["gmq"] = {"çhengaghyn Germaanic Hwoaie"},
["gmr"] = {"Mirning", "Mirniny"},
["gmu"] = {"Gumalu"},
["gmv"] = {"Gamo"},
["gmw"] = {"çhengaghyn Germaanagh Heear"},
["gmx"] = {"Magoma"},
["gmy"] = {"Greagish Vycenaeagh"},
["gmz"] = {"Mgbolizhia"},
["gna"] = {"Kaansa"},
["gnb"] = {"Gangte"},
["gnc"] = {"Guançhish"},
["gnd"] = {"Zulgo-Gemzek"},
["gne"] = {"Ganang"},
["gng"] = {"Ngangam"},
["gnh"] = {"Lere"},
["gni"] = {"Gooniyandi"},
["gnj"] = {"Ngen"},
["gnk"] = {"ǁGana"},
["gnl"] = {"Gangulu"},
["gnm"] = {"Ginuman"},
["gnn"] = {"Gumatj"},
["gno"] = {"Gondi Hwoaie"},
["gnq"] = {"Gana"},
["gnr"] = {"Gureng Gureng"},
["gnt"] = {"Guntai"},
["gnu"] = {"Gnau"},
["gnw"] = {"Guaranish Voliviagh Heear"},
["gnz"] = {"Ganzi"},
["goa"] = {"Guro"},
["gob"] = {"Playero"},
["goc"] = {"Gorakor"},
["god"] = {"Godié"},
["goe"] = {"Gongduk"},
["gof"] = {"Gofa"},
["gog"] = {"Gogo"},
["goh"] = {"Shenn Ard-Ghermaanish (ca. 750-1050)"},
["goi"] = {"Gobasi"},
["goj"] = {"Gowlan"},
["gok"] = {"Gowli"},
["gol"] = {"Gola"},
["gom"] = {"Goan Konkani"},
["gon"] = {"Gondi"},
["goo"] = {"Gone Dau"},
["gop"] = {"Yeretuar"},
["goq"] = {"Gorap"},
["gor"] = {"Gorontalo"},
["gos"] = {"Gronings"},
["got"] = {"Gothish"},
["gou"] = {"Gavar"},
["gov"] = {"Goo"},
["gow"] = {"Gorowa"},
["gox"] = {"Gobu"},
["goy"] = {"Goundo"},
["goz"] = {"Gozarkhani"},
["gpa"] = {"Gupa-Abawa"},
["gpe"] = {"Baarle Vrisht Ghanaiagh"},
["gpn"] = {"Taiap"},
["gqa"] = {"Ga'anda"},
["gqi"] = {"Guiqiong"},
["gqn"] = {"Guana (y Vrasseel)"},
["gqr"] = {"Gor"},
["gqu"] = {"Qau"},
["gra"] = {"Garasia Rajput"},
["grb"] = {"Grebo"},
["grc"] = {"Shenn Ghreagish (derrey 1453)"},
["grd"] = {"Guruntum-Mbaaru"},
["grg"] = {"Madi"},
["grh"] = {"Gbiri-Niragu"},
["gri"] = {"Ghari"},
["grj"] = {"Grebo Yiass"},
["grk"] = {"çhengaghyn Greagagh"},
["grm"] = {"Kota Marudu Talantang"},
["gro"] = {"Groma"},
["grq"] = {"Gorovu"},
["grr"] = {"Taznatit"},
["grs"] = {"Gresi"},
["grt"] = {"Garo"},
["gru"] = {"Kistane"},
["grv"] = {"Grebo Veanagh"},
["grw"] = {"Gweda"},
["grx"] = {"Guriaso"},
["gry"] = {"Grebo Barclayville"},
["grz"] = {"Guramalum"},
["gse"] = {"Çhengey Chowree Ghanaiagh"},
["gsg"] = {"Çhengey Chowree Ghermaanagh"},
["gsl"] = {"Gusilay"},
["gsm"] = {"Çhengey Chowree Ghuatemalagh"},
["gsn"] = {"Nema", "Gusan"},
["gso"] = {"Gbaya Heear Yiass"},
["gsp"] = {"Wasembo"},
["gss"] = {"Çhengey Chowree Ghreagagh"},
["gsw"] = {"Germaanish Elveeishagh", "Alemannish", "Alsaasish"},
["gta"] = {"Guató"},
["gtu"] = {"Aghu-Tharnggala"},
["gua"] = {"Shiki"},
["gub"] = {"Guajajára"},
["guc"] = {"Wayuu"},
["gud"] = {"Yocoboué Dida"},
["gue"] = {"Gurindji"},
["guf"] = {"Gupapuyngu"},
["gug"] = {"Guaranish Pharaguayagh"},
["guh"] = {"Guahibo"},
["gui"] = {"Guaranish Voliviagh Hiar"},
["guk"] = {"Gumuz"},
["gul"] = {"Creeole Baarle Gullah"},
["gum"] = {"Guambiano"},
["gun"] = {"Mbyá Guaraní"},
["guo"] = {"Guayabero"},
["gup"] = {"Gunwinggu"},
["guq"] = {"Aché"},
["gur"] = {"Farefare"},
["gus"] = {"Çhengey Chowree Guineagh"},
["gut"] = {"Maléku Jaíka"},
["guu"] = {"Yanomamö"},
["guw"] = {"Gun"},
["gux"] = {"Gourmanchéma"},
["guz"] = {"Gusii", "Ekegusii"},
["gva"] = {"Guana (y Pharaguay)"},
["gvc"] = {"Guanano"},
["gve"] = {"Duwet"},
["gvf"] = {"Golin"},
["gvj"] = {"Guajá"},
["gvl"] = {"Gulay"},
["gvm"] = {"Gurmana"},
["gvn"] = {"Kuku-Yalanji"},
["gvo"] = {"Gavião Do Jiparaná"},
["gvp"] = {"Pará Gavião"},
["gvr"] = {"Gurung"},
["gvs"] = {"Gumawana"},
["gvy"] = {"Guyani"},
["gwa"] = {"Mbato"},
["gwb"] = {"Gwa"},
["gwc"] = {"Gawri", "Kalami"},
["gwd"] = {"Gawwada"},
["gwe"] = {"Gweno"},
["gwf"] = {"Gowro"},
["gwg"] = {"Moo"},
["gwi"] = {"Gwichʼin"},
["gwj"] = {"ǀGwi"},
["gwm"] = {"Awngthim"},
["gwn"] = {"Gwandara"},
["gwr"] = {"Gwere"},
["gwt"] = {"Gawar-Bati"},
["gwu"] = {"Guwamu"},
["gww"] = {"Kwini"},
["gwx"] = {"Gua"},
["gxx"] = {"Wè Yiass"},
["gya"] = {"Gbaya Heear Hwoaie"},
["gyb"] = {"Garus"},
["gyd"] = {"Kayardild"},
["gye"] = {"Gyem"},
["gyf"] = {"Gungabula"},
["gyg"] = {"Gbayi"},
["gyi"] = {"Gyele"},
["gyl"] = {"Gayil"},
["gym"] = {"Ngäbere"},
["gyn"] = {"Creeole Baarle Geeaanagh"},
["gyo"] = {"Gyalsumdo"},
["gyr"] = {"Guarayu"},
["gyy"] = {"Gunya"},
["gyz"] = {"Geji", "Gyaazi"},
["gza"] = {"Ganza"},
["gzi"] = {"Gazi"},
["gzn"] = {"Gane"},
["haa"] = {"Han"},
["hab"] = {"Çhengey Chowree Hanoi"},
["hac"] = {"Guranish"},
["had"] = {"Hatam"},
["hae"] = {"Oromoish Hiar"},
["haf"] = {"Çhengey Chowree Haiphong"},
["hag"] = {"Hanga"},
["hah"] = {"Hahon"},
["hai"] = {"Haida"},
["haj"] = {"Hajong"},
["hak"] = {"Sheenish Hakka"},
["hal"] = {"Halang"},
["ham"] = {"Hewa"},
["han"] = {"Hangaza"},
["hao"] = {"Hakö"},
["hap"] = {"Hupla"},
["haq"] = {"Ha"},
["har"] = {"Harari"},
["has"] = {"Haisla"},
["hav"] = {"Havu"},
["haw"] = {"Hawaiish"},
["hax"] = {"Haida Yiass"},
["hay"] = {"Haya"},
["haz"] = {"Hazaragi"},
["hba"] = {"Hamba"},
["hbb"] = {"Huba"},
["hbn"] = {"Heiban"},
["hbo"] = {"Shenn Ewnish"},
["hbu"] = {"Habu"},
["hca"] = {"Creeole Hindish Andamanagh"},
["hch"] = {"Huichol"},
["hdn"] = {"Haida Hwoaie"},
["hds"] = {"Çhengey Chowree Hondooragh"},
["hdy"] = {"Hadiyya"},
["hea"] = {"Miao Qiandong Hwoaie"},
["hed"] = {"Herdé"},
["heg"] = {"Helong"},
["heh"] = {"Hehe"},
["hei"] = {"Heiltsuk"},
["hem"] = {"Hemba"},
["hgm"] = {"Haiǁom"},
["hgw"] = {"Haigwai"},
["hhi"] = {"Hoia Hoia"},
["hhr"] = {"Kerak"},
["hhy"] = {"Hoyahoya"},
["hia"] = {"Lamang"},
["hib"] = {"Hibito"},
["hid"] = {"Hidatsa"},
["hif"] = {"Hindish Fiji"},
["hig"] = {"Kamwe"},
["hih"] = {"Pamosu"},
["hii"] = {"Hindurish"},
["hij"] = {"Hijuk"},
["hik"] = {"Seit-Kaitetu"},
["hil"] = {"Hiligaynonish"},
["him"] = {"çhengaghyn Himachalagh", "çhengaghyn Paharagh Heear"},
["hio"] = {"Tsoa"},
["hir"] = {"Himarimã"},
["hit"] = {"Hittish"},
["hiw"] = {"Hiw"},
["hix"] = {"Hixkaryána"},
["hji"] = {"Haji"},
["hka"] = {"Kahe"},
["hke"] = {"Hunde"},
["hkh"] = {"Khah", "Poguli"},
["hkk"] = {"Hunjara-Kaina Ke"},
["hkn"] = {"Mel-Khaonh"},
["hks"] = {"Çhengey Chowree Hong Kong", "Heung Kong Sau Yue"},
["hla"] = {"Halia"},
["hlb"] = {"Halbi"},
["hld"] = {"Halang Doan"},
["hle"] = {"Hlersu"},
["hlt"] = {"Matu Chin"},
["hlu"] = {"Luwish Yalloo-ocklagh"},
["hma"] = {"Hmongish Mashan Yiass", "Miaoish Mashan Yiass"},
["hmb"] = {"Humburi Senni Songhay"},
["hmc"] = {"Hmongish Huishui Veanagh", "Miaoish Huishui Veanagh"},
["hmd"] = {"Miaoish Vooar-Ornaidagh", "A-hmaos", "Miaoish Da-Hua"},
["hme"] = {"Hmongish Huishui Hiar", "Miaoish Huishui Hiar"},
["hmf"] = {"Hmongish Don"},
["hmg"] = {"Hmongish Guiyang Heear Yiass"},
["hmh"] = {"Hmongish Huishui Heear Yiass", "Miaoish Huishui Heear Yiass"},
["hmi"] = {"Hmongish Huishui Hwoaie", "Miaoish Huishui Hwoaie"},
["hmj"] = {"Ge", "Gejia"},
["hmk"] = {"Maek"},
["hml"] = {"Hmongish Luopohe", "Miaoish Luopohe"},
["hmm"] = {"Hmongish Mashan Veanagh", "Miaoish Mashan Veanagh"},
["hmn"] = {"Hmongish", "Mongish"},
["hmp"] = {"Hmongish Mashan Hwoaie", "Miaoish Mashan Hwoaie"},
["hmq"] = {"Miaoish Qiandong Hiar"},
["hmr"] = {"Hmar"},
["hms"] = {"Miaoish Qiandong Yiass"},
["hmt"] = {"Hamtai"},
["hmu"] = {"Hamap"},
["hmv"] = {"Hmong Dô"},
["hmw"] = {"Hmongish Mashan Heear", "Miaoish Mashan Heear"},
["hmx"] = {"çhengaghyn Hmong-Mien"},
["hmy"] = {"Hmongish Guiyang Yiass", "Miaoish Guiyang Yiass"},
["hmz"] = {"Hmongish Shua", "Miaoish Heenit"},
["hna"] = {"Mina (Cameroon)"},
["hnd"] = {"Hindko Yiass"},
["hne"] = {"Chhattisgarhi"},
["hng"] = {"Hungu"},
["hnh"] = {"ǁAni"},
["hni"] = {"Hani"},
["hnj"] = {"Hmongish Njua", "Mong Leng", "Mong Njua"},
["hnn"] = {"Hanunoo"},
["hno"] = {"Hindko Hwoaie"},
["hns"] = {"Hindustaanish Charibagh"},
["hnu"] = {"Hung"},
["hoa"] = {"Hoava"},
["hob"] = {"Marish (Queiggey Madang)"},
["hoc"] = {"Ho"},
["hod"] = {"Holma"},
["hoe"] = {"Horom"},
["hoh"] = {"Hobyót"},
["hoi"] = {"Holikachuk"},
["hoj"] = {"Hadothish", "Harotish"},
["hok"] = {"çhengaghyn Hokagh"},
["hol"] = {"Holu"},
["hom"] = {"Homa"},
["hoo"] = {"Holoholo"},
["hop"] = {"Hopi"},
["hor"] = {"Horo"},
["hos"] = {"Çhengey Chowree Chaayr Ho Chi Minh"},
["hot"] = {"Hote", "Malê"},
["hov"] = {"Hovongan"},
["how"] = {"Honi"},
["hoy"] = {"Holiya"},
["hoz"] = {"Hozo"},
["hpo"] = {"Hpon"},
["hps"] = {"Glare Chowree Hawai'i (HSL)", "Çhengey Chowree Hawaiish Vrisht"},
["hra"] = {"Hrangkhol"},
["hrc"] = {"Niwer Mil"},
["hre"] = {"Hre"},
["hrk"] = {"Haruku"},
["hrm"] = {"Miaoish Eairkagh"},
["hro"] = {"Haroi"},
["hrp"] = {"Nhirrpi"},
["hrt"] = {"Hértevin"},
["hru"] = {"Hruso"},
["hrw"] = {"Warwar Feni"},
["hrx"] = {"Hunsrikish"},
["hrz"] = {"Harzanish"},
["hsb"] = {"Sorbish Eaghtyragh"},
["hsh"] = {"Glare Chowree Ungaaragh"},
["hsl"] = {"Glare Chowree Hausagh"},
["hsn"] = {"Sheenish Xiang"},
["hss"] = {"Harsusi"},
["hti"] = {"Hoti"},
["hto"] = {"Minica Huitoto"},
["hts"] = {"Hadza"},
["htu"] = {"Hitu"},
["htx"] = {"Hittish Veanagh"},
["hub"] = {"Huambisa"},
["huc"] = {"ǂHua", "ǂʼAmkhoe"},
["hud"] = {"Huaulu"},
["hue"] = {"San Francisco Del Mar Huave"},
["huf"] = {"Humene"},
["hug"] = {"Huachipaeri"},
["huh"] = {"Huilliche"},
["hui"] = {"Huli"},
["huj"] = {"Hmongish Guiyang Hwoaie", "Miaoish Guiyang Hwoaie"},
["huk"] = {"Hulung"},
["hul"] = {"Hula"},
["hum"] = {"Hungana"},
["huo"] = {"Hu"},
["hup"] = {"Hupa"},
["huq"] = {"Tsat"},
["hur"] = {"Halkomelem"},
["hus"] = {"Huastecish"},
["hut"] = {"Humla"},
["huu"] = {"Murui Huitoto"},
["huv"] = {"San Mateo Del Mar Huave"},
["huw"] = {"Hukumina"},
["hux"] = {"Nüpode Huitoto"},
["huy"] = {"Hulaulá"},
["huz"] = {"Hunzibish"},
["hvc"] = {"Çhengey Chultoor Vodoun Haitagh"},
["hve"] = {"San Dionisio Del Mar Huave"},
["hvk"] = {"Haveke"},
["hvn"] = {"Sabu"},
["hvv"] = {"Santa María Del Mar Huave"},
["hwa"] = {"Wané"},
["hwc"] = {"Creeole Baarle Hawaiianagh", "Hawaiish Vrisht"},
["hwo"] = {"Hwana"},
["hya"] = {"Hya"},
["hyw"] = {"Armeanish Heear"},
["hyx"] = {"Armeanagh (kynney)"},
["iai"] = {"Iaai"},
["ian"] = {"Iatmul"},
["iar"] = {"Purari"},
["iba"] = {"Iban"},
["ibb"] = {"Ibibio"},
["ibd"] = {"Iwaidja"},
["ibe"] = {"Akpes"},
["ibg"] = {"Ibanag"},
["ibh"] = {"Bih"},
["ibl"] = {"Ibaloi"},
["ibm"] = {"Agoi"},
["ibn"] = {"Ibino"},
["ibr"] = {"Ibuoro"},
["ibu"] = {"Ibu"},
["iby"] = {"Ibani"},
["ica"] = {"Ede Ica"},
["ich"] = {"Etkywan"},
["icl"] = {"Çhengey Chowree Eeslynnagh"},
["icr"] = {"Creeole San Andrés–Providencia"},
["ida"] = {"Idakho-Isukha-Tiriki", "Luidakho-Luisukha-Lutirichi"},
["idb"] = {"Portiugish Injinagh"},
["idc"] = {"Idon", "Ajiya"},
["idd"] = {"Ede Idaca"},
["ide"] = {"Idere"},
["idi"] = {"Idi"},
["idr"] = {"Indri"},
["ids"] = {"Idesa"},
["idt"] = {"Idaté"},
["idu"] = {"Idoma"},
["ifa"] = {"Amganad Ifugao"},
["ifb"] = {"Batad Ifugao", "Ayangan Ifugao"},
["ife"] = {"Ifè"},
["iff"] = {"Ifo"},
["ifk"] = {"Tuwali Ifugao"},
["ifm"] = {"Teke-Fuumu"},
["ifu"] = {"Mayoyao Ifugao"},
["ify"] = {"Keley-I Kallahan"},
["igb"] = {"Ebira"},
["ige"] = {"Igede"},
["igg"] = {"Igana"},
["igl"] = {"Igala"},
["igm"] = {"Kanggape"},
["ign"] = {"Ignaciano"},
["igo"] = {"Isebe"},
["igs"] = {"Interglossa"},
["igw"] = {"Igwe"},
["ihb"] = {"Iha Vrisht"},
["ihi"] = {"Ihievbe"},
["ihp"] = {"Iha"},
["ihw"] = {"Bidhawal"},
["iin"] = {"Thiin"},
["iir"] = {"çhengaghyn Ind-Eeraanagh"},
["ijc"] = {"Izon"},
["ije"] = {"Biseni"},
["ijj"] = {"Ede Ije"},
["ijn"] = {"Kalabari"},
["ijo"] = {"çhengaghyn Ijo"},
["ijs"] = {"Ijo Hiar Yiass"},
["ike"] = {"Inuktitut Hiar y Chanadey"},
["ikh"] = {"Ikhin-Arokho"},
["iki"] = {"Iko"},
["ikk"] = {"Ika"},
["ikl"] = {"Ikulu"},
["iko"] = {"Olulumo-Ikom"},
["ikp"] = {"Ikpeshi"},
["ikr"] = {"Ikaranggal"},
["iks"] = {"Çhengey Chowree Inuitagh"},
["ikt"] = {"Inuinnaqtun", "Inuktitut Heear y Chanadey"},
["ikv"] = {"Iku-Gora-Ankwa"},
["ikw"] = {"Ikwere"},
["ikx"] = {"Ik"},
["ikz"] = {"Ikizu"},
["ila"] = {"Ile Ape"},
["ilb"] = {"Ila"},
["ilg"] = {"Garig-Ilgar"},
["ili"] = {"Ili Turki"},
["ilk"] = {"Ilongot"},
["ilm"] = {"Iranun (y Valaysia)"},
["ilo"] = {"Iloko"},
["ilp"] = {"Iranun (ny h-Ellanyn Philippeenagh)"},
["ils"] = {"Çhengey Chowree Eddyr-ashoonagh"},
["ilu"] = {"Ili'uun"},
["ilv"] = {"Ilue"},
["ima"] = {"Mala Malasar"},
["imi"] = {"Anamgura"},
["iml"] = {"Miluk"},
["imn"] = {"Imonda"},
["imo"] = {"Imbongu"},
["imr"] = {"Imroing"},
["ims"] = {"Marsish"},
["imt"] = {"Imotong"},
["imy"] = {"Milyan"},
["inb"] = {"Inga"},
["inc"] = {"çhengaghyn Indagh"},
["ine"] = {"çhengaghyn Ind-Oarpagh"},
["ing"] = {"Degexit'an"},
["inh"] = {"Ingushish"},
["inj"] = {"Inga yn Jungyl"},
["inl"] = {"Çhengey Chowree Indoneeshagh"},
["inm"] = {"Minaeish"},
["inn"] = {"Isinai"},
["ino"] = {"Inoke-Yate"},
["inp"] = {"Iñapari"},
["ins"] = {"Çhengey Chowree Injinagh"},
["int"] = {"Intha"},
["inz"] = {"Ineseño"},
["ior"] = {"Inor"},
["iou"] = {"Tuma-Irumu"},
["iow"] = {"Iowa-Oto"},
["ipi"] = {"Ipili"},
["ipo"] = {"Ipiko"},
["iqu"] = {"Iquito"},
["iqw"] = {"Ikwo"},
["ira"] = {"çhengaghyn Eeraanagh"},
["ire"] = {"Iresim"},
["irh"] = {"Irarutu"},
["iri"] = {"Rigwe", "Irigwe"},
["irk"] = {"Iraqw"},
["irn"] = {"Irántxe"},
["iro"] = {"çhengaghyn Iroquoiagh"},
["irr"] = {"Ir"},
["iru"] = {"Irula"},
["irx"] = {"Kamberau"},
["iry"] = {"Iraya"},
["isa"] = {"Isabi"},
["isc"] = {"Isconahua"},
["isd"] = {"Isnag"},
["ise"] = {"Çhengey Chowree Iddaalagh"},
["isg"] = {"Çhengey Chowree Yernagh"},
["ish"] = {"Esan"},
["isi"] = {"Nkem-Nkum"},
["isk"] = {"Ishkashimi"},
["ism"] = {"Masimasi"},
["isn"] = {"Isanzu"},
["iso"] = {"Isoko"},
["isr"] = {"Çhengey Chowree Israelagh"},
["ist"] = {"Istriotish"},
["isu"] = {"Isu (Rheynn Menchum)"},
["itb"] = {"Binongan Itneg"},
["itc"] = {"çhengaghyn Iddaalagh"},
["itd"] = {"Tidung Yiass"},
["ite"] = {"Itene"},
["iti"] = {"Inlaod Itneg"},
["itk"] = {"Iddaalish Ewagh"},
["itl"] = {"Itelmenish"},
["itm"] = {"Itu Mbon Uzo"},
["ito"] = {"Itonama"},
["itr"] = {"Iteri"},
["its"] = {"Isekiri"},
["itt"] = {"Maeng Itneg"},
["itv"] = {"Itawit"},
["itw"] = {"Ito"},
["itx"] = {"Itik"},
["ity"] = {"Moyadan Itneg"},
["itz"] = {"Itzá"},
["ium"] = {"Iu Mien"},
["ivb"] = {"Ibatan"},
["ivv"] = {"Ivatan"},
["iwk"] = {"I-Wak"},
["iwm"] = {"Iwam"},
["iwo"] = {"Iwur"},
["iws"] = {"Sepik Iwam"},
["ixc"] = {"Ixcatecish"},
["ixl"] = {"Ixil"},
["iya"] = {"Iyayu"},
["iyo"] = {"Mesaka"},
["iyx"] = {"Yaka (y Congo)"},
["izh"] = {"Ingrish"},
["izm"] = {"Kizamani"},
["izr"] = {"Izere"},
["izz"] = {"Izii"},
["jaa"] = {"Jamamadí"},
["jab"] = {"Hyam"},
["jac"] = {"Popti'", "Jakalteko"},
["jad"] = {"Jahanka"},
["jae"] = {"Yabem"},
["jaf"] = {"Jara"},
["jah"] = {"Jah Hut"},
["jaj"] = {"Zazao"},
["jak"] = {"Jakun"},
["jal"] = {"Yalahatan"},
["jam"] = {"Creeole Baarle Jamaicagh"},
["jan"] = {"Jandai"},
["jao"] = {"Yanyuwa"},
["jaq"] = {"Yaqay"},
["jas"] = {"Javish y Chaladoan Noa"},
["jat"] = {"Jakati"},
["jau"] = {"Yaur"},
["jax"] = {"Malaish Jambi"},
["jay"] = {"Yan-nhangu", "Nhangu"},
["jaz"] = {"Jawe"},
["jbe"] = {"Berberish Ewagh"},
["jbi"] = {"Badjiri"},
["jbj"] = {"Arandai"},
["jbk"] = {"Barikewa"},
["jbm"] = {"Bijim"},
["jbn"] = {"Nafusi"},
["jbo"] = {"Lojban"},
["jbr"] = {"Jofotek-Bromnya"},
["jbt"] = {"Jabutí"},
["jbu"] = {"Jukun Takum"},
["jbw"] = {"Yawijibaya"},
["jcs"] = {"Çhengey Chowree Heeragh Yamaicagh"},
["jct"] = {"Krymchak"},
["jda"] = {"Jad"},
["jdg"] = {"Jadgali"},
["jdt"] = {"Tatish Ewagh"},
["jeb"] = {"Jebero"},
["jee"] = {"Jerung"},
["jeh"] = {"Jeh"},
["jei"] = {"Yei"},
["jek"] = {"Jeri Kuo"},
["jel"] = {"Yelmek"},
["jen"] = {"Dza"},
["jer"] = {"Jere"},
["jet"] = {"Manem"},
["jeu"] = {"Jonkor Bourmataguil"},
["jgb"] = {"Ngbee"},
["jge"] = {"Shorshish Ewagh"},
["jgk"] = {"Gwak"},
["jgo"] = {"Ngomba"},
["jhi"] = {"Jehai"},
["jhs"] = {"Çhengey Chowree Jhankot"},
["jia"] = {"Jina"},
["jib"] = {"Jibu"},
["jic"] = {"Tol"},
["jid"] = {"Bu (Steat Kaduna)"},
["jie"] = {"Jilbe"},
["jig"] = {"Jingulu", "Djingili"},
["jih"] = {"sTodsde", "Shangzhai"},
["jii"] = {"Jiiddu"},
["jil"] = {"Jilim"},
["jim"] = {"Jimi (Cameroon)"},
["jio"] = {"Jiamao"},
["jiq"] = {"Guanyinqiao", "Lavrung"},
["jit"] = {"Jita"},
["jiu"] = {"Jinuo Youle"},
["jiv"] = {"Shuar"},
["jiy"] = {"Jinuo Buyuan"},
["jje"] = {"Jejueo"},
["jjr"] = {"Bankal"},
["jka"] = {"Kaera"},
["jkm"] = {"Karenish Mobwa"},
["jko"] = {"Kubo"},
["jkp"] = {"Karenish Paku"},
["jkr"] = {"Koro (yn Injey)"},
["jks"] = {"Çhengey Chowree Amami Koniya"},
["jku"] = {"Labir"},
["jle"] = {"Ngile"},
["jls"] = {"Çhengey Chowree Yamaicagh"},
["jma"] = {"Dima"},
["jmb"] = {"Zumbun"},
["jmc"] = {"Machame"},
["jmd"] = {"Yamdena"},
["jmi"] = {"Jimi (y Naigeer)"},
["jml"] = {"Jumli"},
["jmn"] = {"Makuri Naga"},
["jmr"] = {"Kamara"},
["jms"] = {"Mashi (y Naigeer)"},
["jmw"] = {"Mouwase"},
["jmx"] = {"Mixtecish Juxtlahuaca Heear"},
["jna"] = {"Jangshung"},
["jnd"] = {"Jandavra"},
["jng"] = {"Yangman"},
["jni"] = {"Janji"},
["jnj"] = {"Yemsa"},
["jnl"] = {"Rawat"},
["jns"] = {"Jaunsari"},
["job"] = {"Joba"},
["jod"] = {"Wojenaka"},
["jog"] = {"Jogi"},
["jor"] = {"Jorá"},
["jos"] = {"Çhengey Chowree Yordaanagh"},
["jow"] = {"Jowulu"},
["jpa"] = {"Aramaaish Phalasteenagh Ewagh"},
["jpr"] = {"Pershish Ewagh"},
["jpx"] = {"Shapaanagh (kynney)"},
["jqr"] = {"Jaqaru"},
["jra"] = {"Jarai"},
["jrb"] = {"Arabish Ewagh"},
["jrr"] = {"Jiru"},
["jrt"] = {"Jakattoe"},
["jru"] = {"Japrería"},
["jsl"] = {"Çhengey Chowree Hapaanagh"},
["jua"] = {"Júma"},
["jub"] = {"Wannu"},
["juc"] = {"Jurchen"},
["jud"] = {"Worodougou"},
["juh"] = {"Hõne"},
["jui"] = {"Ngadjuri"},
["juk"] = {"Wapan"},
["jul"] = {"Jirel"},
["jum"] = {"Jumjum"},
["jun"] = {"Juang"},
["juo"] = {"Jiba"},
["jup"] = {"Hupdë"},
["jur"] = {"Jurúna"},
["jus"] = {"Çhengey Chowree Jumla"},
["jut"] = {"Jutish"},
["juu"] = {"Ju"},
["juw"] = {"Wãpha"},
["juy"] = {"Juray"},
["jvd"] = {"Javindo"},
["jvn"] = {"Javish Charibagh"},
["jwi"] = {"Jwira-Pepesa"},
["jya"] = {"Jiarong"},
["jye"] = {"Arabish Yemenagh Ewagh"},
["jyy"] = {"Jaya"},
["kaa"] = {"Kara-Kalpakish", "Karakalpakish"},
["kab"] = {"Kabylish"},
["kac"] = {"Kachin", "Jingpho"},
["kad"] = {"Adara"},
["kae"] = {"Ketangalan"},
["kaf"] = {"Katso"},
["kag"] = {"Kajaman"},
["kah"] = {"Kara (Pobblaght yn Affrick Veanagh)"},
["kai"] = {"Karekare"},
["kaj"] = {"Jju"},
["kak"] = {"Kalanguya", "Kayapa Kallahan"},
["kam"] = {"Kamba (y Cheinney)"},
["kao"] = {"Xaasongaxango"},
["kap"] = {"Bezhta"},
["kaq"] = {"Capanahua"},
["kar"] = {"çhengaghyn Karenagh"},
["kav"] = {"Katukína"},
["kaw"] = {"Kawish"},
["kax"] = {"Kao"},
["kay"] = {"Kamayurá"},
["kba"] = {"Kalarko"},
["kbb"] = {"Kaxuiâna"},
["kbc"] = {"Kadiwéu"},
["kbd"] = {"Kabardish"},
["kbe"] = {"Kanju"},
["kbg"] = {"Khamba"},
["kbh"] = {"Camsá"},
["kbi"] = {"Kaptiau"},
["kbj"] = {"Kari"},
["kbk"] = {"Grass Koiari"},
["kbl"] = {"Kanembu"},
["kbm"] = {"Iwal"},
["kbn"] = {"Kare (Pobblaght yn Affrick Veanagh)"},
["kbo"] = {"Keliko"},
["kbp"] = {"Kabiyè"},
["kbq"] = {"Kamano"},
["kbr"] = {"Kafa"},
["kbs"] = {"Kande"},
["kbt"] = {"Abadi"},
["kbu"] = {"Kabutra"},
["kbv"] = {"Dera (yn Indoneesh)"},
["kbw"] = {"Kaiep"},
["kbx"] = {"Ap Ma"},
["kby"] = {"Manga Kanuri"},
["kbz"] = {"Duhwa"},
["kca"] = {"Khanty"},
["kcb"] = {"Kawacha"},
["kcc"] = {"Lubila"},
["kcd"] = {"Ngkâlmpw Kanum"},
["kce"] = {"Kaivi"},
["kcf"] = {"Ukaan"},
["kcg"] = {"Tyap"},
["kch"] = {"Vono"},
["kci"] = {"Kamantanish"},
["kcj"] = {"Kobiana"},
["kck"] = {"Kalanga"},
["kcl"] = {"Kela (Papeey Guinea Noa)", "Kala"},
["kcm"] = {"Gula (Pobblaght yn Affrick Veanagh)"},
["kcn"] = {"Nubi"},
["kco"] = {"Kinalakna"},
["kcp"] = {"Kanga"},
["kcq"] = {"Kamo"},
["kcr"] = {"Katla"},
["kcs"] = {"Koenoem"},
["kct"] = {"Kaian"},
["kcu"] = {"Kami (Tanzania)"},
["kcv"] = {"Kete"},
["kcw"] = {"Kabwari"},
["kcx"] = {"Kachama-Ganjule"},
["kcy"] = {"Korandje"},
["kcz"] = {"Konongo"},
["kda"] = {"Worimi"},
["kdc"] = {"Kutu"},
["kdd"] = {"Yankunytjatjara"},
["kde"] = {"Makonde"},
["kdf"] = {"Mamusi"},
["kdg"] = {"Seba"},
["kdh"] = {"Tem"},
["kdi"] = {"Kumam"},
["kdj"] = {"Karamojong"},
["kdk"] = {"Numèè", "Kwényi"},
["kdl"] = {"Tsikimba"},
["kdm"] = {"Kagoma"},
["kdn"] = {"Kunda"},
["kdo"] = {"çhengaghyn Kordofaniagh"},
["kdp"] = {"Kaningdon-Nindem"},
["kdq"] = {"Koch"},
["kdr"] = {"Karaimish"},
["kdt"] = {"Kuy"},
["kdu"] = {"Kadaru"},
["kdw"] = {"Koneraw"},
["kdx"] = {"Kam"},
["kdy"] = {"Keder", "Keijar"},
["kdz"] = {"Kwaja"},
["kea"] = {"Kabuverdianu"},
["keb"] = {"Kélé"},
["kec"] = {"Keiga"},
["ked"] = {"Kerewe"},
["kee"] = {"Keres Hiar"},
["kef"] = {"Kpessi"},
["keg"] = {"Tese"},
["keh"] = {"Keak"},
["kei"] = {"Kei"},
["kej"] = {"Kadar"},
["kek"] = {"Kekchí"},
["kel"] = {"Kela (Pobblaght Gheynlagh y Chongo)"},
["kem"] = {"Kemak"},
["ken"] = {"Kenyang"},
["keo"] = {"Kakwa"},
["kep"] = {"Kaikadi"},
["keq"] = {"Kamar"},
["ker"] = {"Kera"},
["kes"] = {"Kugbo"},
["ket"] = {"Ket"},
["keu"] = {"Akebu"},
["kev"] = {"Kanikkaran"},
["kew"] = {"Kewa Heear"},
["kex"] = {"Kukna"},
["key"] = {"Kupia"},
["kez"] = {"Kukele"},
["kfa"] = {"Kodava"},
["kfb"] = {"Kolamish Heear Hwoaie"},
["kfc"] = {"Konda-Dora"},
["kfd"] = {"Korra Koraga"},
["kfe"] = {"Kota (yn Injey)"},
["kff"] = {"Koya"},
["kfg"] = {"Kudiya"},
["kfh"] = {"Kurichiya"},
["kfi"] = {"Kurumba Kannada"},
["kfj"] = {"Kemiehua"},
["kfk"] = {"Kinnaurish"},
["kfl"] = {"Kung"},
["kfm"] = {"Khunsarish"},
["kfn"] = {"Kuk"},
["kfo"] = {"Koro (y Clyst Iuaagagh)"},
["kfp"] = {"Korwa"},
["kfq"] = {"Korku"},
["kfr"] = {"Kachhish", "Kutchish"},
["kfs"] = {"Bilaspurish"},
["kft"] = {"Kanjarish"},
["kfu"] = {"Katkarish"},
["kfv"] = {"Kurmukarish"},
["kfw"] = {"Kharam Naga"},
["kfx"] = {"Kullu Pahari"},
["kfy"] = {"Kumaoni"},
["kfz"] = {"Koromfé"},
["kga"] = {"Koyaga"},
["kgb"] = {"Kawe"},
["kge"] = {"Komering"},
["kgf"] = {"Kube"},
["kgg"] = {"Kusunda"},
["kgi"] = {"Çhengey Chowree Selangor"},
["kgj"] = {"Gamale Kham"},
["kgk"] = {"Kaiwá"},
["kgl"] = {"Kunggari"},
["kgn"] = {"Karingani"},
["kgo"] = {"Krongo"},
["kgp"] = {"Kaingang"},
["kgq"] = {"Kamoro"},
["kgr"] = {"Abun"},
["kgs"] = {"Kumbainggar"},
["kgt"] = {"Somyev"},
["kgu"] = {"Kobol"},
["kgv"] = {"Karas"},
["kgw"] = {"Karon Dori"},
["kgx"] = {"Kamaru"},
["kgy"] = {"Kyerung"},
["kha"] = {"Khasi"},
["khb"] = {"Lü"},
["khc"] = {"Tukang Besi North"},
["khd"] = {"Bädi Kanum"},
["khe"] = {"Korowai"},
["khf"] = {"Khuen"},
["khg"] = {"Khams Tibetan"},
["khh"] = {"Kehu"},
["khi"] = {"çhengaghyn Khoisan"},
["khj"] = {"Kuturmi"},
["khk"] = {"Mongoilish Halh"},
["khl"] = {"Lusi"},
["khn"] = {"Khandesi"},
["kho"] = {"Khotanish", "Sakan"},
["khp"] = {"Kapori", "Kapauri"},
["khq"] = {"Koyra Chiini Songhay"},
["khr"] = {"Kharia"},
["khs"] = {"Kasua"},
["kht"] = {"Khamti"},
["khu"] = {"Nkhumbi"},
["khv"] = {"Khvarshi"},
["khw"] = {"Khowar"},
["khx"] = {"Kanu"},
["khy"] = {"Kele (Pobblaght Gheynlagh y Chongo)"},
["khz"] = {"Keapara"},
["kia"] = {"Kim"},
["kib"] = {"Koalib"},
["kic"] = {"Kickapoo"},
["kid"] = {"Koshin"},
["kie"] = {"Kibet"},
["kif"] = {"Magar Kham Hiar"},
["kig"] = {"Kimaama", "Kimaghima"},
["kih"] = {"Kilmeri"},
["kii"] = {"Kitsai"},
["kij"] = {"Kilivila"},
["kil"] = {"Kariya"},
["kim"] = {"Karagas"},
["kio"] = {"Kiowa"},
["kip"] = {"Sheshi Kham"},
["kiq"] = {"Kosadle", "Kosare"},
["kis"] = {"Kis"},
["kit"] = {"Agob"},
["kiu"] = {"Kirmanjki (çhengey er lheh)"},
["kiv"] = {"Kimbu"},
["kiw"] = {"Kiwai Hiar Hwoaie"},
["kix"] = {"Khiamniungan Naga"},
["kiy"] = {"Kirikiri"},
["kiz"] = {"Kisi"},
["kja"] = {"Mlap"},
["kjb"] = {"Q'anjob'al", "Kanjobal"},
["kjc"] = {"Konjo Slystagh"},
["kjd"] = {"Kiwai Yiass"},
["kje"] = {"Kisar"},
["kjg"] = {"Khmu"},
["kjh"] = {"Khakas"},
["kji"] = {"Zabana"},
["kjj"] = {"Khinalugh"},
["kjk"] = {"Konjo Sleitoil"},
["kjl"] = {"Magar Kham Heear"},
["kjm"] = {"Kháng"},
["kjn"] = {"Kunjen"},
["kjo"] = {"Kinnaurish Harijan"},
["kjp"] = {"Karenish Hiar Pwo"},
["kjq"] = {"Keres Heear"},
["kjr"] = {"Kurudu"},
["kjs"] = {"Kewa Hiar"},
["kjt"] = {"Karenish Phrae Pwo"},
["kju"] = {"Kashaya"},
["kjv"] = {"Çhengey Lettyragh Kaikavagh"},
["kjx"] = {"Ramopa"},
["kjy"] = {"Erave"},
["kjz"] = {"Bumthangkha"},
["kka"] = {"Kakanda"},
["kkb"] = {"Kwerisa"},
["kkc"] = {"Odoodee"},
["kkd"] = {"Kinuku"},
["kke"] = {"Kakabe"},
["kkf"] = {"Kalaktang Monpa"},
["kkg"] = {"Kalinga Ghlion Mabaka"},
["kkh"] = {"Khün"},
["kki"] = {"Kagulu"},
["kkj"] = {"Kako"},
["kkk"] = {"Kokota"},
["kkl"] = {"Kosarek Yale"},
["kkm"] = {"Kiong"},
["kkn"] = {"Kon Keu"},
["kko"] = {"Karko"},
["kkp"] = {"Gugubera", "Koko-Bera"},
["kkq"] = {"Kaeku"},
["kkr"] = {"Kir-Balar"},
["kks"] = {"Giiwo"},
["kkt"] = {"Koi"},
["kku"] = {"Tumi"},
["kkv"] = {"Kangean"},
["kkw"] = {"Teke-Kukuya"},
["kkx"] = {"Kohin"},
["kky"] = {"Guugu Yimidhirr", "Guguyimidjir"},
["kkz"] = {"Kaska"},
["kla"] = {"Klamath-Modoc"},
["klb"] = {"Kiliwa"},
["klc"] = {"Kolbila"},
["kld"] = {"Gamilaraay"},
["kle"] = {"Kulung (Nepaal)"},
["klf"] = {"Kendeje"},
["klg"] = {"Tagakaulo"},
["klh"] = {"Weliki"},
["kli"] = {"Kalumpang"},
["klj"] = {"Khalaj"},
["klk"] = {"Kono (y Naigeer)"},
["kll"] = {"Kagan Kalagan"},
["klm"] = {"Migum"},
["kln"] = {"Kalenjin"},
["klo"] = {"Kapya"},
["klp"] = {"Kamasa"},
["klq"] = {"Rumu"},
["klr"] = {"Khaling"},
["kls"] = {"Kalasha"},
["klt"] = {"Nukna"},
["klu"] = {"Klao"},
["klv"] = {"Maskelynes"},
["klw"] = {"Tado", "Lindu"},
["klx"] = {"Koluwawa"},
["kly"] = {"Kalao"},
["klz"] = {"Kabola"},
["kma"] = {"Konni"},
["kmb"] = {"Kimbundu"},
["kmc"] = {"Dong Yiass"},
["kmd"] = {"Majukayang Kalinga"},
["kme"] = {"Bakole"},
["kmf"] = {"Kare (Papooe Guinea Noa)"},
["kmg"] = {"Kâte"},
["kmh"] = {"Kalam"},
["kmi"] = {"Kami (y Naigeer)"},
["kmj"] = {"Kumarbhag Paharia"},
["kmk"] = {"Limos Kalinga"},
["kml"] = {"Tanudan Kalinga"},
["kmm"] = {"Kom (yn Injey)"},
["kmn"] = {"Awtuw"},
["kmo"] = {"Kwoma"},
["kmp"] = {"Gimme"},
["kmq"] = {"Kwama"},
["kmr"] = {"Kurdish Hwoaie"},
["kms"] = {"Kamasau"},
["kmt"] = {"Kemtuik"},
["kmu"] = {"Kanite"},
["kmv"] = {"Creeole Frangish Karipúna"},
["kmw"] = {"Komo (Pobblaght Gheynlagh y Chongo)"},
["kmx"] = {"Waboda"},
["kmy"] = {"Koma"},
["kmz"] = {"Turkish Khorasan"},
["kna"] = {"Dera (y Naigeer)"},
["knb"] = {"Lubuagan Kalinga"},
["knc"] = {"Kanurish Veanagh"},
["knd"] = {"Konda"},
["kne"] = {"Kankanaey"},
["knf"] = {"Mankanya"},
["kng"] = {"Koongo"},
["kni"] = {"Kanufi"},
["knj"] = {"Kanjobal Heear"},
["knk"] = {"Kuranko"},
["knl"] = {"Keninjal"},
["knm"] = {"Kanamarí"},
["knn"] = {"Konkani (çhengey er lheh)"},
["kno"] = {"Kono (Sierra Leone)"},
["knp"] = {"Kwanja"},
["knq"] = {"Kintaq"},
["knr"] = {"Kaningra"},
["kns"] = {"Kensiu"},
["knt"] = {"Panoan Katukína"},
["knu"] = {"Kono (y Ghuinea)"},
["knv"] = {"Tabo"},
["knw"] = {"Kung-Ekoka"},
["knx"] = {"Kendayan", "Salako"},
["kny"] = {"Kanyok"},
["knz"] = {"Kalamsé"},
["koa"] = {"Konomala"},
["koc"] = {"Kpati"},
["kod"] = {"Kodi"},
["koe"] = {"Kacipo-Bale Suri"},
["kof"] = {"Kubi"},
["kog"] = {"Cogui", "Kogi"},
["koh"] = {"Koyo"},
["koi"] = {"Komish Phermagh"},
["kok"] = {"Konkanish (mooar-hengey)"},
["kol"] = {"Kol (Papooey Guinea Noa)"},
["koo"] = {"Konzo"},
["kop"] = {"Waube"},
["koq"] = {"Kota (Gabon)"},
["kos"] = {"Kosraeish"},
["kot"] = {"Lagwan"},
["kou"] = {"Koke"},
["kov"] = {"Kudu-Camo"},
["kow"] = {"Kugama"},
["koy"] = {"Koyukon"},
["koz"] = {"Korak"},
["kpa"] = {"Kutto"},
["kpb"] = {"Mullu Kurumba"},
["kpc"] = {"Curripaco"},
["kpd"] = {"Koba"},
["kpe"] = {"Kpelle"},
["kpf"] = {"Komba"},
["kpg"] = {"Kapingamarangi"},
["kph"] = {"Kplang"},
["kpi"] = {"Kofei"},
["kpj"] = {"Karajá"},
["kpk"] = {"Kpan"},
["kpl"] = {"Kpala"},
["kpm"] = {"Koho"},
["kpn"] = {"Kepkiriwát"},
["kpo"] = {"Ikposo"},
["kpq"] = {"Korupun-Sela"},
["kpr"] = {"Korafe-Yegha"},
["kps"] = {"Tehit"},
["kpt"] = {"Karata"},
["kpu"] = {"Kafoa"},
["kpv"] = {"Komish Hyriagh"},
["kpw"] = {"Kobon"},
["kpx"] = {"Koialish Sleitoil"},
["kpy"] = {"Koryakish"},
["kpz"] = {"Kupsabiny"},
["kqa"] = {"Mum"},
["kqb"] = {"Kovai"},
["kqc"] = {"Doromu-Koki"},
["kqd"] = {"Koy Sanjaq Surat"},
["kqe"] = {"Kalagan"},
["kqf"] = {"Kakabai"},
["kqg"] = {"Khe"},
["kqh"] = {"Kisankasa"},
["kqi"] = {"Koitabu"},
["kqj"] = {"Koromira"},
["kqk"] = {"Kotafon Gbe"},
["kql"] = {"Kyenele"},
["kqm"] = {"Khisa"},
["kqn"] = {"Kaonde"},
["kqo"] = {"Krahn Hiar"},
["kqp"] = {"Kimré"},
["kqq"] = {"Krenak"},
["kqr"] = {"Kimaragang"},
["kqs"] = {"Kissi Hwoaie"},
["kqt"] = {"Kadazan yn Awin Klias"},
["kqu"] = {"Seroa"},
["kqv"] = {"Okolod"},
["kqw"] = {"Kandas"},
["kqx"] = {"Mser"},
["kqy"] = {"Koorete"},
["kqz"] = {"Korana"},
["kra"] = {"Kumhali"},
["krb"] = {"Karkin"},
["krc"] = {"Karaçhayish-Balkarish"},
["krd"] = {"Kairui-Midiki"},
["kre"] = {"Panará"},
["krf"] = {"Koro (Vanuatu)"},
["krh"] = {"Kurama"},
["kri"] = {"Krio"},
["krj"] = {"Kinaray-A"},
["krk"] = {"Kerek"},
["krl"] = {"Karelish"},
["krn"] = {"Sapo"},
["kro"] = {"çhengaghyn Kru"},
["krp"] = {"Durop"},
["krr"] = {"Krung"},
["krs"] = {"Gbaya (y Toodaan)"},
["krt"] = {"Tumari Kanuri"},
["kru"] = {"Kurukh"},
["krv"] = {"Kavet"},
["krw"] = {"Krahn Heear"},
["krx"] = {"Karon"},
["kry"] = {"Kryts"},
["krz"] = {"Sota Kanum"},
["ksb"] = {"Shambala"},
["ksc"] = {"Kalinga Yiass"},
["ksd"] = {"Kuanua"},
["kse"] = {"Kuni"},
["ksf"] = {"Bafia"},
["ksg"] = {"Kusaghe"},
["ksh"] = {"Kölsch"},
["ksi"] = {"Krisa", "I'saka"},
["ksj"] = {"Uare"},
["ksk"] = {"Kansa"},
["ksl"] = {"Kumalu"},
["ksm"] = {"Kumba"},
["ksn"] = {"Kasiguranin"},
["kso"] = {"Kofa"},
["ksp"] = {"Kaba"},
["ksq"] = {"Kwaami"},
["ksr"] = {"Borong"},
["kss"] = {"Kisi Yiass"},
["kst"] = {"Winyé"},
["ksu"] = {"Khamyang"},
["ksv"] = {"Kusu"},
["ksw"] = {"Karenish S'gaw"},
["ksx"] = {"Kedang"},
["ksy"] = {"Kharia Thar"},
["ksz"] = {"Kodaku"},
["kta"] = {"Katua"},
["ktb"] = {"Kambaata"},
["ktc"] = {"Kholok"},
["ktd"] = {"Kokata", "Kukatha"},
["kte"] = {"Nubri"},
["ktf"] = {"Kwami"},
["ktg"] = {"Kalkutung"},
["kth"] = {"Karanga"},
["kti"] = {"Muyu Hwoaie"},
["ktj"] = {"Plapo Krumen"},
["ktk"] = {"Kaniet"},
["ktl"] = {"Koroshi"},
["ktm"] = {"Kurti"},
["ktn"] = {"Karitiâna"},
["kto"] = {"Kuot"},
["ktp"] = {"Kaduo"},
["ktq"] = {"Katabaga"},
["kts"] = {"Muyu Yiass"},
["ktt"] = {"Ketum"},
["ktu"] = {"Kitubish (Pobblaght Gheynlagh y Chongo)"},
["ktv"] = {"Katu Hiar"},
["ktw"] = {"Kato"},
["ktx"] = {"Kaxararí"},
["kty"] = {"Kango (Slyst Bas-Uélé)"},
["ktz"] = {"Juǀʼhoan", "Juǀʼhoansi"},
["kub"] = {"Kutep"},
["kuc"] = {"Kwinsu"},
["kud"] = {"'Auhelawa"},
["kue"] = {"Kuman (Papooey Guinea Noa)"},
["kuf"] = {"Katu Heear"},
["kug"] = {"Kupa"},
["kuh"] = {"Kushi"},
["kui"] = {"Kuikúro-Kalapálo", "Kalapalo"},
["kuj"] = {"Kuria"},
["kuk"] = {"Kepo'"},
["kul"] = {"Kulere"},
["kum"] = {"Kumykish"},
["kun"] = {"Kunama"},
["kuo"] = {"Kumukio"},
["kup"] = {"Kunimaipa"},
["kuq"] = {"Karipuna"},
["kus"] = {"Kusaal"},
["kut"] = {"Kutenai"},
["kuu"] = {"Kuskokwim Eaghtyragh"},
["kuv"] = {"Kur"},
["kuw"] = {"Kpagua"},
["kux"] = {"Kukatja"},
["kuy"] = {"Kuuku-Ya'u"},
["kuz"] = {"Kunza"},
["kva"] = {"Bagvalal"},
["kvb"] = {"Kubu"},
["kvc"] = {"Kove"},
["kvd"] = {"Kui (yn Indoneesh)"},
["kve"] = {"Kalabakanish"},
["kvf"] = {"Kabalai"},
["kvg"] = {"Kuni-Boazi"},
["kvh"] = {"Komodo"},
["kvi"] = {"Kwang"},
["kvj"] = {"Psikye"},
["kvk"] = {"Çhengey Chowree Choreeagh"},
["kvl"] = {"Kayaw"},
["kvm"] = {"Kendem"},
["kvn"] = {"Border Kuna"},
["kvo"] = {"Dobel"},
["kvp"] = {"Kompane"},
["kvq"] = {"Karenish Geba"},
["kvr"] = {"Kerinci"},
["kvt"] = {"Karenish Lahta", "Lahta"},
["kvu"] = {"Karenish Yinbaw"},
["kvv"] = {"Kola"},
["kvw"] = {"Wersing"},
["kvx"] = {"Parkari Koli"},
["kvy"] = {"Karenish Yintale", "Yintale"},
["kvz"] = {"Tsakwambo", "Tsaukambo"},
["kwa"] = {"Dâw"},
["kwb"] = {"Kwa"},
["kwc"] = {"Likwala"},
["kwd"] = {"Kwaio"},
["kwe"] = {"Kwerba"},
["kwf"] = {"Kwara'ae"},
["kwg"] = {"Sara Kaba Deme"},
["kwh"] = {"Kowiai"},
["kwi"] = {"Awa-Cuaiquer"},
["kwj"] = {"Kwanga"},
["kwk"] = {"Kwakiutl"},
["kwl"] = {"Kofyar"},
["kwm"] = {"Kwambish"},
["kwn"] = {"Kwangalish"},
["kwo"] = {"Kwomtarish"},
["kwp"] = {"Kodia"},
["kwr"] = {"Kwer"},
["kws"] = {"Kwese"},
["kwt"] = {"Kwesten"},
["kwu"] = {"Kwakum"},
["kwv"] = {"Sara Kaba Náà"},
["kww"] = {"Kwintish"},
["kwx"] = {"Khirwar"},
["kwy"] = {"Kongo San Salvador"},
["kwz"] = {"Kwadi"},
["kxa"] = {"Kairiru"},
["kxb"] = {"Krobu"},
["kxc"] = {"Konso", "Khonso"},
["kxd"] = {"Brunei"},
["kxf"] = {"Manumanaw Karen", "Manumanaw"},
["kxh"] = {"Karo (yn Eetoip)"},
["kxi"] = {"Keningau Murut"},
["kxj"] = {"Kulfa"},
["kxk"] = {"Karenish Zayein"},
["kxm"] = {"Khmerish Hwoaie"},
["kxn"] = {"Kanowit-Tanjong Melanau"},
["kxo"] = {"Kanoé"},
["kxp"] = {"Wadiyara Koli"},
["kxq"] = {"Smärky Kanum"},
["kxr"] = {"Koro (Papooey Guinea Noa)"},
["kxs"] = {"Kangjia"},
["kxt"] = {"Koiwat"},
["kxv"] = {"Kuvi"},
["kxw"] = {"Konai"},
["kxx"] = {"Likuba"},
["kxy"] = {"Kayong"},
["kxz"] = {"Kerewo"},
["kya"] = {"Kwaya"},
["kyb"] = {"Butbut Kalinga"},
["kyc"] = {"Kyaka"},
["kyd"] = {"Karey"},
["kye"] = {"Krache"},
["kyf"] = {"Kouya"},
["kyg"] = {"Keyagana"},
["kyh"] = {"Karok"},
["kyi"] = {"Kiput"},
["kyj"] = {"Karao"},
["kyk"] = {"Kamayo"},
["kyl"] = {"Kalapuya"},
["kym"] = {"Kpatili"},
["kyn"] = {"Binukidnon Hwoaie"},
["kyo"] = {"Kelon"},
["kyp"] = {"Kang"},
["kyq"] = {"Kenga"},
["kyr"] = {"Kuruáya"},
["kys"] = {"Baram Kayan"},
["kyt"] = {"Kayagar"},
["kyu"] = {"Kayah Heear"},
["kyv"] = {"Kayort"},
["kyw"] = {"Kudmali"},
["kyx"] = {"Rapoisi"},
["kyy"] = {"Kambaira"},
["kyz"] = {"Kayabí"},
["kza"] = {"Karaboro Heear"},
["kzb"] = {"Kaibobo"},
["kzc"] = {"Bondoukou Kulango"},
["kzd"] = {"Kadai"},
["kze"] = {"Kosena"},
["kzf"] = {"Da'a Kaili"},
["kzg"] = {"Kikai"},
["kzi"] = {"Kelabit"},
["kzk"] = {"Kazukuru"},
["kzl"] = {"Kayeli"},
["kzm"] = {"Kais"},
["kzn"] = {"Kokola"},
["kzo"] = {"Kaningi"},
["kzp"] = {"Kaidipang"},
["kzq"] = {"Kaike"},
["kzr"] = {"Karang"},
["kzs"] = {"Sugut Dusun"},
["kzu"] = {"Kayupulau"},
["kzv"] = {"Komyandaret"},
["kzw"] = {"Karirí-Xocó"},
["kzx"] = {"Kamarian"},
["kzy"] = {"Kango (Slyst Tshopo)"},
["kzz"] = {"Kalabra"},
["laa"] = {"Subanen Yiass"},
["lab"] = {"Linnagh A"},
["lac"] = {"Lacandon"},
["lad"] = {"Ladinoish"},
["lae"] = {"Pattani"},
["laf"] = {"Lafofa"},
["lag"] = {"Rangi"},
["lah"] = {"Lahnda"},
["lai"] = {"Lambya"},
["laj"] = {"Lango (Ooganda)"},
["lal"] = {"Lalia"},
["lam"] = {"Lamba"},
["lan"] = {"Laru"},
["lap"] = {"Laka (Shad)"},
["laq"] = {"Qabiao"},
["lar"] = {"Larteh"},
["las"] = {"Lama (y Togo)"},
["lau"] = {"Laba"},
["law"] = {"Lauje"},
["lax"] = {"Tiwa"},
["lay"] = {"Lama Bai"},
["laz"] = {"Aribwatsa"},
["lbb"] = {"Label"},
["lbc"] = {"Lakkia"},
["lbe"] = {"Lakish"},
["lbf"] = {"Tinani"},
["lbg"] = {"Laopang"},
["lbi"] = {"La'bi"},
["lbj"] = {"Ladakhi"},
["lbk"] = {"Bontok Veanagh"},
["lbl"] = {"Bikol Libon"},
["lbm"] = {"Lodhi"},
["lbn"] = {"Rmeet"},
["lbo"] = {"Laven"},
["lbq"] = {"Wampar"},
["lbr"] = {"Lohorung"},
["lbs"] = {"Çhengey Chowree Leebagh"},
["lbt"] = {"Lachi"},
["lbu"] = {"Labu"},
["lbv"] = {"Lavatbura-Lamusong"},
["lbw"] = {"Tolaki"},
["lbx"] = {"Lawangan"},
["lby"] = {"Lamalama", "Lamu-Lamu"},
["lbz"] = {"Lardil"},
["lcc"] = {"Legenyem"},
["lcd"] = {"Lola"},
["lce"] = {"Loncong", "Sekak"},
["lcf"] = {"Lubu"},
["lch"] = {"Luchazi"},
["lcl"] = {"Lisela"},
["lcm"] = {"Tungag"},
["lcp"] = {"Lawa Heear"},
["lcq"] = {"Luhu"},
["lcs"] = {"Lisabata-Nuniali"},
["lda"] = {"Kla-Dan"},
["ldb"] = {"Dũya"},
["ldd"] = {"Lurish"},
["ldg"] = {"Lenyima"},
["ldh"] = {"Lamja-Dengsa-Tola"},
["ldi"] = {"Laari"},
["ldj"] = {"Lemoro"},
["ldk"] = {"Leelau"},
["ldl"] = {"Kaan"},
["ldm"] = {"Landoma"},
["ldn"] = {"Láadan"},
["ldo"] = {"Loo"},
["ldp"] = {"Tso"},
["ldq"] = {"Lufu"},
["lea"] = {"Lega-Shabunda"},
["leb"] = {"Lala-Bisa"},
["lec"] = {"Leco"},
["led"] = {"Lendu"},
["lee"] = {"Lyélé"},
["lef"] = {"Lelemi"},
["leh"] = {"Lenje"},
["lei"] = {"Lemio"},
["lej"] = {"Lengola"},
["lek"] = {"Leipon"},
["lel"] = {"Lele (Pobblaght Gheynlagh y Chongo)"},
["lem"] = {"Nomaande"},
["len"] = {"Lenca"},
["leo"] = {"Leti (Cameroon)"},
["lep"] = {"Lepcha"},
["leq"] = {"Lembena"},
["ler"] = {"Lenkau"},
["les"] = {"Lese"},
["let"] = {"Lesing-Gelimi", "Amio-Gelimi"},
["leu"] = {"Kara (Papooey Guinea Noa)"},
["lev"] = {"Lamma"},
["lew"] = {"Ledo Kaili"},
["lex"] = {"Luang"},
["ley"] = {"Lemolang"},
["lez"] = {"Lesgish"},
["lfa"] = {"Lefa"},
["lfn"] = {"Lingua Franca Nova"},
["lga"] = {"Lungga"},
["lgb"] = {"Laghu"},
["lgg"] = {"Lugbara"},
["lgh"] = {"Laghuu"},
["lgi"] = {"Lengilu"},
["lgk"] = {"Lingarak", "Neverver"},
["lgl"] = {"Wala"},
["lgm"] = {"Lega-Mwenga"},
["lgn"] = {"T'apo", "Opuuo"},
["lgo"] = {"Lango (y Toodaan Yiass)"},
["lgq"] = {"Logba"},
["lgr"] = {"Lengo"},
["lgs"] = {"Çhengey Chowree Ghuinea-Bissau", "Língua Gestual Guineense"},
["lgt"] = {"Pahi"},
["lgu"] = {"Longgu"},
["lgz"] = {"Ligenza"},
["lha"] = {"Laha (Viet Nam)"},
["lhh"] = {"Laha (yn Indoneesh)"},
["lhi"] = {"Lahu Shi"},
["lhl"] = {"Lahul Lohar"},
["lhm"] = {"Lhomi"},
["lhn"] = {"Lahanan"},
["lhp"] = {"Lhokpu"},
["lhs"] = {"Mlahsö"},
["lht"] = {"Lo-Toga"},
["lhu"] = {"Lahu"},
["lia"] = {"Limba Veanagh Heear"},
["lib"] = {"Likum"},
["lic"] = {"Hlai"},
["lid"] = {"Nyindrou"},
["lie"] = {"Likila"},
["lif"] = {"Limbu"},
["lig"] = {"Ligbi"},
["lih"] = {"Lihir"},
["lij"] = {"Ligoorish"},
["lik"] = {"Lika"},
["lil"] = {"Lillooet"},
["lio"] = {"Liki"},
["lip"] = {"Sekpele"},
["liq"] = {"Libido"},
["lir"] = {"Baarle Laibeeragh"},
["lis"] = {"Lisu"},
["liu"] = {"Logorik"},
["liv"] = {"Liv"},
["liw"] = {"Col"},
["lix"] = {"Liabuku"},
["liy"] = {"Banda-Bambari"},
["liz"] = {"Libinza"},
["lja"] = {"Golpa"},
["lje"] = {"Rampi"},
["lji"] = {"Laiyolo"},
["ljl"] = {"Li'o"},
["ljp"] = {"Lampung Api"},
["ljw"] = {"Yirandali"},
["ljx"] = {"Yuru"},
["lka"] = {"Lakalei"},
["lkb"] = {"Kabras", "Lukabaras"},
["lkc"] = {"Kucong"},
["lkd"] = {"Lakondê"},
["lke"] = {"Kenyi"},
["lkh"] = {"Lakha"},
["lki"] = {"Laki"},
["lkj"] = {"Remun"},
["lkl"] = {"Laeko-Libuat"},
["lkm"] = {"Kalaamaya"},
["lkn"] = {"Lakon", "Vure"},
["lko"] = {"Khayo", "Olukhayo"},
["lkr"] = {"Päri"},
["lks"] = {"Kisa", "Olushisa"},
["lkt"] = {"Lakota"},
["lku"] = {"Kungkari"},
["lky"] = {"Lokoya"},
["lla"] = {"Lala-Roba"},
["llb"] = {"Lolo"},
["llc"] = {"Lele (y Ghuinea)"},
["lld"] = {"Ladin"},
["lle"] = {"Lele (Papooey Guinea Noa)"},
["llf"] = {"Hermit"},
["llg"] = {"Lole"},
["llh"] = {"Lamu"},
["lli"] = {"Teke-Laali"},
["llj"] = {"Ladji Ladji"},
["llk"] = {"Lelak"},
["lll"] = {"Lilau"},
["llm"] = {"Lasalimu"},
["lln"] = {"Lele (Shad)"},
["llp"] = {"Efate Hwoaie"},
["llq"] = {"Lolak"},
["lls"] = {"Çhengey Chowree Litaanagh"},
["llu"] = {"Lau"},
["llx"] = {"Lauan"},
["lma"] = {"Limba Hiar"},
["lmb"] = {"Merei"},
["lmc"] = {"Limilngan"},
["lmd"] = {"Lumun"},
["lme"] = {"Pévé"},
["lmf"] = {"Lembata Yiass"},
["lmg"] = {"Lamogai"},
["lmh"] = {"Lambichhong"},
["lmi"] = {"Lombi"},
["lmj"] = {"Lembata Heear"},
["lmk"] = {"Lamkang"},
["lml"] = {"Hano"},
["lmn"] = {"Lambadi"},
["lmo"] = {"Lombardish"},
["lmp"] = {"Limbum"},
["lmq"] = {"Lamatuka"},
["lmr"] = {"Lamalera"},
["lmu"] = {"Lamenu"},
["lmv"] = {"Lomaiviti"},
["lmw"] = {"Lake Miwok"},
["lmx"] = {"Laimbue"},
["lmy"] = {"Lamboya"},
["lna"] = {"Langbashe"},
["lnb"] = {"Mbalanhu"},
["lnd"] = {"Lundayeh", "Lun Bawang"},
["lng"] = {"Langobardish"},
["lnh"] = {"Lanoh"},
["lni"] = {"Daantanai'"},
["lnj"] = {"Leningitij"},
["lnl"] = {"Banda Veanagh Yiass"},
["lnm"] = {"Langam"},
["lnn"] = {"Lorediakarkar"},
["lns"] = {"Lamnso'"},
["lnu"] = {"Longuda"},
["lnw"] = {"Lanima"},
["lnz"] = {"Lonzo"},
["loa"] = {"Loloda"},
["lob"] = {"Lobi"},
["loc"] = {"Inonhan"},
["loe"] = {"Saluan"},
["lof"] = {"Logol"},
["log"] = {"Logo"},
["loh"] = {"Laarim", "Narim"},
["loi"] = {"Loma (y Clyst Iuaagagh)"},
["loj"] = {"Lou"},
["lok"] = {"Loko"},
["lol"] = {"Mongo"},
["lom"] = {"Loma (y Laibeer)"},
["lon"] = {"Lombwe Malawi"},
["loo"] = {"Lombo"},
["lop"] = {"Lopa"},
["loq"] = {"Lobala"},
["lor"] = {"Téén"},
["los"] = {"Loniu"},
["lot"] = {"Otuho"},
["lou"] = {"Creeole Louisiana"},
["lov"] = {"Lopi"},
["low"] = {"Tampias Lobu"},
["lox"] = {"Loun"},
["loy"] = {"Loke"},
["loz"] = {"Lozish"},
["lpa"] = {"Lelepa"},
["lpe"] = {"Lepki"},
["lpn"] = {"Long Phuri Naga"},
["lpo"] = {"Lipo"},
["lpx"] = {"Lopit"},
["lqr"] = {"Logir"},
["lra"] = {"Rara Bakati'"},
["lrc"] = {"Lurish Hwoaie"},
["lre"] = {"Lauryssish"},
["lrg"] = {"Laragia"},
["lri"] = {"Marachi", "Olumarachi"},
["lrk"] = {"Loarki"},
["lrl"] = {"Lari"},
["lrm"] = {"Marama", "Olumarama"},
["lrn"] = {"Lorang"},
["lro"] = {"Laro"},
["lrr"] = {"Yamphu Yiass"},
["lrt"] = {"Malayish Larantuka"},
["lrv"] = {"Larevat"},
["lrz"] = {"Lemerig"},
["lsa"] = {"Lasgerdi"},
["lsb"] = {"Çhengey Chowree Vurundeeagh", "Langue des Signes Burundaise"},
["lsc"] = {"Çhengey Chowree Albarradas", "Lengua de señas Albarradas"},
["lsd"] = {"Lishana Deni"},
["lse"] = {"Lusengo"},
["lsh"] = {"Lish"},
["lsi"] = {"Lashi"},
["lsl"] = {"Çhengey Chowree Latvagh"},
["lsm"] = {"Saamia", "Olusamia"},
["lsn"] = {"Çhengey Chowree Hibetagh"},
["lso"] = {"Çhengey Chowree Laosaghe"},
["lsp"] = {"Çhengey Chowree Phanamaagh", "Lengua de Señas Panameñas"},
["lsr"] = {"Aruop"},
["lss"] = {"Lasi"},
["lst"] = {"Çhengey Chowree yn Trinaid as Tobago"},
["lsv"] = {"Çhengey Chowree Sivia"},
["lsw"] = {"Çhengey Chowree Heshellagh", "Lalang Siny Seselwa", "Langue des Signes Seychelloise"},
["lsy"] = {"Çhengey Chowree Wirrishagh"},
["ltc"] = {"Sheenish Veanagh Yeianagh"},
["ltg"] = {"Latgalish"},
["lth"] = {"Thur"},
["lti"] = {"Leti (yn Indoneesh)"},
["ltn"] = {"Latundê"},
["lto"] = {"Tsotso", "Olutsotso"},
["lts"] = {"Tachoni", "Lutachoni"},
["ltu"] = {"Latu"},
["lua"] = {"Luba-Lulua"},
["luc"] = {"Aringa"},
["lud"] = {"Ludish"},
["lue"] = {"Luvale"},
["luf"] = {"Laua"},
["lui"] = {"Luiseno"},
["luj"] = {"Luna"},
["luk"] = {"Lunanakha"},
["lul"] = {"Olu'bo"},
["lum"] = {"Luimbi"},
["lun"] = {"Lunda"},
["luo"] = {"Luo (y Cheinney as Tanzania)", "Dholuo"},
["lup"] = {"Lumbu"},
["luq"] = {"Lucumi"},
["lur"] = {"Laura"},
["lus"] = {"Lushai"},
["lut"] = {"Lushootseed"},
["luu"] = {"Lumba-Yakkha"},
["luv"] = {"Luwati"},
["luw"] = {"Luo (Cameroon)"},
["luy"] = {"Luyia", "Oluluyia"},
["luz"] = {"Lurish Yiass"},
["lva"] = {"Maku'a"},
["lvi"] = {"Lavi"},
["lvk"] = {"Lavukaleve"},
["lvl"] = {"Lwel"},
["lvs"] = {"Latvish Stundayrtit"},
["lvu"] = {"Levuka"},
["lwa"] = {"Lwalu"},
["lwe"] = {"Lewo Eleng"},
["lwg"] = {"Wanga", "Oluwanga"},
["lwh"] = {"Lachi Bane"},
["lwl"] = {"Lawa Hiar"},
["lwm"] = {"Laomish"},
["lwo"] = {"Luwo"},
["lws"] = {"Çhengey Chowree Malawi"},
["lwt"] = {"Lewotobi"},
["lwu"] = {"Lawu"},
["lww"] = {"Lewo"},
["lxm"] = {"Lakurumau"},
["lya"] = {"Layakha"},
["lyg"] = {"Lyngngam"},
["lyn"] = {"Luyana"},
["lzh"] = {"Sheenish Lettyragh"},
["lzl"] = {"Litzlitz"},
["lzn"] = {"Leinong Naga"},
["lzz"] = {"Laz"},
["maa"] = {"Mazatecish Tecóatl San Jerónimo"},
["mab"] = {"Mixtecish Yutanduchi"},
["mad"] = {"Madurish"},
["mae"] = {"Bo-Rukul"},
["maf"] = {"Mafa"},
["mag"] = {"Magahi"},
["mai"] = {"Maithilish"},
["maj"] = {"Mazatecish Jalapa De Díaz"},
["mak"] = {"Makasar"},
["mam"] = {"Mam"},
["man"] = {"Mandingo", "Manding"},
["map"] = {"çhengaghyn Austroneeshagh"},
["maq"] = {"Mazatecish Chiquihuitlán"},
["mas"] = {"Masai"},
["mat"] = {"Matlatzinca San Francisco"},
["mau"] = {"Mazatecish Huautla"},
["mav"] = {"Sateré-Mawé"},
["maw"] = {"Mampruli"},
["max"] = {"Malayish Maluku Hwoaie"},
["maz"] = {"Mazahua Veanagh"},
["mba"] = {"Higaonon"},
["mbb"] = {"Manobo Bukidnon Heear"},
["mbc"] = {"Macushi"},
["mbd"] = {"Manobo Dibabawon"},
["mbe"] = {"Molale"},
["mbf"] = {"Malayish Baba"},
["mbh"] = {"Mangseng"},
["mbi"] = {"Manobo Ilianen"},
["mbj"] = {"Nadëb"},
["mbk"] = {"Malol"},
["mbl"] = {"Maxakalí"},
["mbm"] = {"Ombamba"},
["mbn"] = {"Macaguán"},
["mbo"] = {"Mbo (Cameroon)"},
["mbp"] = {"Malayo"},
["mbq"] = {"Maisin"},
["mbr"] = {"Nukak Makú"},
["mbs"] = {"Manobo Sarangani"},
["mbt"] = {"Manobo Matigsalug"},
["mbu"] = {"Mbula-Bwazza"},
["mbv"] = {"Mbulungish"},
["mbw"] = {"Maring"},
["mbx"] = {"Mari (Queiggey East Sepik)"},
["mby"] = {"Memoni"},
["mbz"] = {"Mixtecish Amoltepec"},
["mca"] = {"Maca"},
["mcb"] = {"Machiguenga"},
["mcc"] = {"Bitur"},
["mcd"] = {"Sharanahua"},
["mce"] = {"Mixtecish Itundujia"},
["mcf"] = {"Matsés"},
["mcg"] = {"Mapoyo"},
["mch"] = {"Maquiritari"},
["mci"] = {"Mese"},
["mcj"] = {"Mvanip"},
["mck"] = {"Mbunda"},
["mcl"] = {"Macaguaje"},
["mcm"] = {"Creeole Portiugish Malaccagh"},
["mcn"] = {"Masana"},
["mco"] = {"Coatlán Mixe"},
["mcp"] = {"Makaa"},
["mcq"] = {"Ese"},
["mcr"] = {"Menya"},
["mcs"] = {"Mambai"},
["mct"] = {"Mengisa"},
["mcu"] = {"Mambila Chameroon"},
["mcv"] = {"Minanibai"},
["mcw"] = {"Mawa (Shad)"},
["mcx"] = {"Mpiemo"},
["mcy"] = {"Watut Yiass"},
["mcz"] = {"Mawan"},
["mda"] = {"Mada (y Naigeer)"},
["mdb"] = {"Morigi"},
["mdc"] = {"Male (Papooey Guinea Noa)"},
["mdd"] = {"Mbum"},
["mde"] = {"Maba (Shad)"},
["mdf"] = {"Moksha"},
["mdg"] = {"Massalat"},
["mdh"] = {"Maguindanaon"},
["mdi"] = {"Mamvu"},
["mdj"] = {"Mangbetu"},
["mdk"] = {"Mangbutu"},
["mdl"] = {"Çhengey Chowree Valtagh"},
["mdm"] = {"Mayogo"},
["mdn"] = {"Mbati"},
["mdp"] = {"Mbala"},
["mdq"] = {"Mbole"},
["mdr"] = {"Mandar"},
["mds"] = {"Maria (Papooey Guinea Noa)"},
["mdt"] = {"Mbere"},
["mdu"] = {"Mboko"},
["mdv"] = {"Mixtecish Monteverde Santa Lucía"},
["mdw"] = {"Mbosi"},
["mdx"] = {"Dizin"},
["mdy"] = {"Male (yn Eetoipt)"},
["mdz"] = {"Suruí Do Pará"},
["mea"] = {"Menka"},
["meb"] = {"Ikobi"},
["mec"] = {"Marra"},
["med"] = {"Melpa"},
["mee"] = {"Mengen"},
["mef"] = {"Megam"},
["meh"] = {"Mixtecish Tlaxiaco Heear Yiass"},
["mei"] = {"Midob"},
["mej"] = {"Meyah"},
["mek"] = {"Mekeo"},
["mel"] = {"Melanau Veanagh"},
["mem"] = {"Mangala"},
["men"] = {"Mende (Sierra Leone)"},
["meo"] = {"Malayish Kedah"},
["mep"] = {"Miriwoong"},
["meq"] = {"Merey"},
["mer"] = {"Meru"},
["mes"] = {"Masmaje"},
["met"] = {"Mato"},
["meu"] = {"Motu"},
["mev"] = {"Mano"},
["mew"] = {"Maaka"},
["mey"] = {"Hassaniyya"},
["mez"] = {"Menominee"},
["mfa"] = {"Malayish Pattani Malay"},
["mfb"] = {"Bangka"},
["mfc"] = {"Mba"},
["mfd"] = {"Mendankwe-Nkwen"},
["mfe"] = {"Creeole Mwirrishagh"},
["mff"] = {"Naki"},
["mfg"] = {"Mogofin"},
["mfh"] = {"Matal"},
["mfi"] = {"Wandala"},
["mfj"] = {"Mefele"},
["mfk"] = {"Mofu Hwoaie"},
["mfl"] = {"Putai"},
["mfm"] = {"Marghi Yiass"},
["mfn"] = {"Mbembe Cross River"},
["mfo"] = {"Mbe"},
["mfp"] = {"Malayish Makassar"},
["mfq"] = {"Moba"},
["mfr"] = {"Marrithiyel"},
["mfs"] = {"Çhengey Chowree Veksicagh"},
["mft"] = {"Mokerang"},
["mfu"] = {"Mbwela"},
["mfv"] = {"Mandjak"},
["mfw"] = {"Mulaha"},
["mfx"] = {"Melo"},
["mfy"] = {"Mayo"},
["mfz"] = {"Mabaan"},
["mga"] = {"Yernish Veanagh (900-1200)"},
["mgb"] = {"Mararit"},
["mgc"] = {"Morokodo"},
["mgd"] = {"Moru"},
["mge"] = {"Mango"},
["mgf"] = {"Maklew"},
["mgg"] = {"Mpumpong"},
["mgh"] = {"Makhuwa-Meetto"},
["mgi"] = {"Lijili"},
["mgj"] = {"Abureni"},
["mgk"] = {"Mawes"},
["mgl"] = {"Maleu-Kilenge"},
["mgm"] = {"Mambae"},
["mgn"] = {"Mbangi"},
["mgo"] = {"Meta'"},
["mgp"] = {"Magar Hiar"},
["mgq"] = {"Malila"},
["mgr"] = {"Mambwe-Lungu"},
["mgs"] = {"Manda (Tanzania)"},
["mgt"] = {"Mongol"},
["mgu"] = {"Mailu"},
["mgv"] = {"Matengo"},
["mgw"] = {"Matumbi"},
["mgy"] = {"Mbunga"},
["mgz"] = {"Mbugwe"},
["mha"] = {"Manda (yn Injey)"},
["mhb"] = {"Mahongwe"},
["mhc"] = {"Mocho"},
["mhd"] = {"Mbugu"},
["mhe"] = {"Besisi", "Mah Meri"},
["mhf"] = {"Mamaa"},
["mhg"] = {"Margu"},
["mhi"] = {"Ma'di"},
["mhj"] = {"Mogholi"},
["mhk"] = {"Mungaka"},
["mhl"] = {"Mauwake"},
["mhm"] = {"Makhuwa-Moniga"},
["mhn"] = {"Mócheno"},
["mho"] = {"Mashi (y Tambia)"},
["mhp"] = {"Malayish Bali"},
["mhq"] = {"Mandan"},
["mhr"] = {"Mari Hiar"},
["mhs"] = {"Buru (yn Indoneesh)"},
["mht"] = {"Mandahuaca"},
["mhu"] = {"Digaro-Mishmi", "Darang Deng"},
["mhw"] = {"Mbukushu"},
["mhx"] = {"Maru", "Lhaovo"},
["mhy"] = {"Ma'anyan"},
["mhz"] = {"Mor (Elanyn Mor)"},
["mia"] = {"Miami"},
["mib"] = {"Mixtecish Atatláhuca"},
["mic"] = {"Mi'kmaq", "Micmacish"},
["mid"] = {"Mandaish"},
["mie"] = {"Mixtecish Ocotepec"},
["mif"] = {"Mofu-Gudur"},
["mig"] = {"Mixtecish San Miguel El Grande"},
["mih"] = {"Mixtecish Chayuco"},
["mii"] = {"Mixtecish Chigmecatitlán"},
["mij"] = {"Abar", "Mungbam"},
["mik"] = {"Mikasuki"},
["mil"] = {"Mixtecish Peñoles"},
["mim"] = {"Mixtecish Alacatlatzala"},
["min"] = {"Minangkabau"},
["mio"] = {"Mixtecish Pinotepa Nacional"},
["mip"] = {"Mixtecish Apasco-Apoala"},
["miq"] = {"Mískito"},
["mir"] = {"Isthmus Mixe"},
["mis"] = {"çhengaghyn gyn coad"},
["mit"] = {"Mixtecish Puebla Yiassc"},
["miu"] = {"Mixtecish Cacaloxtepec"},
["miw"] = {"Akoye"},
["mix"] = {"Mixtecish Mixtepec"},
["miy"] = {"Mixtecish Ayutla"},
["miz"] = {"Mixtecish Coatzospan"},
["mjb"] = {"Makalero"},
["mjc"] = {"Mixtecish San Juan Colorado"},
["mjd"] = {"Maidu Heear Hwoaie"},
["mje"] = {"Muskum"},
["mjg"] = {"Tu"},
["mjh"] = {"Mwera (Nyasa)"},
["mji"] = {"Kim Mun"},
["mjj"] = {"Mawak"},
["mjk"] = {"Matukar"},
["mjl"] = {"Mandeali"},
["mjm"] = {"Medebur"},
["mjn"] = {"Ma (Papooey Guinea Noa)"},
["mjo"] = {"Malankuravan"},
["mjp"] = {"Malapandaram"},
["mjq"] = {"Malaryan"},
["mjr"] = {"Malavedan"},
["mjs"] = {"Miship"},
["mjt"] = {"Sauria Paharia"},
["mju"] = {"Manna-Dora"},
["mjv"] = {"Mannan"},
["mjw"] = {"Karbi"},
["mjx"] = {"Mahali"},
["mjy"] = {"Mohicanish"},
["mjz"] = {"Majhi"},
["mka"] = {"Mbre"},
["mkb"] = {"Mal Paharia"},
["mkc"] = {"Siliput"},
["mke"] = {"Mawchi"},
["mkf"] = {"Miya"},
["mkg"] = {"Mak (y Çheen)"},
["mkh"] = {"çhengaghyn Mon-Khmeragh"},
["mki"] = {"Dhatki"},
["mkj"] = {"Mokilish"},
["mkk"] = {"Byep"},
["mkl"] = {"Mokole"},
["mkm"] = {"Moklen"},
["mkn"] = {"Malayish Kupang"},
["mko"] = {"Mingang Doso"},
["mkp"] = {"Moikodi"},
["mkq"] = {"Bay Miwok"},
["mkr"] = {"Malas"},
["mks"] = {"Mixtecish Silacayoapan"},
["mkt"] = {"Vamale"},
["mku"] = {"Konyanka Maninka"},
["mkv"] = {"Mafea"},
["mkw"] = {"Kitubish (y Congo)"},
["mkx"] = {"Minobo Kinamiging"},
["mky"] = {"Makish Hiar"},
["mkz"] = {"Makasae"},
["mla"] = {"Malo"},
["mlb"] = {"Mbule"},
["mlc"] = {"Cao Lan"},
["mle"] = {"Manambu"},
["mlf"] = {"Mal"},
["mlh"] = {"Mape"},
["mli"] = {"Malimpung"},
["mlj"] = {"Miltu"},
["mlk"] = {"Ilwana", "Kiwilwana"},
["mll"] = {"Malua Bay"},
["mlm"] = {"Mulam"},
["mln"] = {"Malango"},
["mlo"] = {"Mlomp"},
["mlp"] = {"Bargam"},
["mlq"] = {"Maninkish Heear"},
["mlr"] = {"Vame"},
["mls"] = {"Masalit"},
["mlu"] = {"To'abaita"},
["mlv"] = {"Motlav", "Mwotlap"},
["mlw"] = {"Moloko"},
["mlx"] = {"Malfaxal", "Naha'ai"},
["mlz"] = {"Malaynon"},
["mma"] = {"Mama"},
["mmb"] = {"Momina"},
["mmc"] = {"Mazahua Michoacán"},
["mmd"] = {"Maonan"},
["mme"] = {"Mae"},
["mmf"] = {"Mundat"},
["mmg"] = {"Ambrym Hwoaie"},
["mmh"] = {"Mehináku"},
["mmi"] = {"Musar"},
["mmj"] = {"Majhwar"},
["mmk"] = {"Mukha-Dora"},
["mml"] = {"Man Met"},
["mmm"] = {"Maii"},
["mmn"] = {"Mamanwa"},
["mmo"] = {"Mangga Buang"},
["mmp"] = {"Siawi"},
["mmq"] = {"Musak"},
["mmr"] = {"Miaoish Xiangxi Heear"},
["mmt"] = {"Malalamai"},
["mmu"] = {"Mmaala"},
["mmv"] = {"Miriti"},
["mmw"] = {"Emae"},
["mmx"] = {"Madak"},
["mmy"] = {"Migaama"},
["mmz"] = {"Mabaale"},
["mna"] = {"Mbula"},
["mnb"] = {"Muna"},
["mnc"] = {"Mançhooish"},
["mnd"] = {"Mondé"},
["mne"] = {"Naba"},
["mnf"] = {"Mundanish"},
["mng"] = {"Mnong Hiar"},
["mnh"] = {"Mono (Pobblaght Gheynlagh y Chongo)"},
["mni"] = {"Manipurish"},
["mnj"] = {"Munji"},
["mnk"] = {"Mandinkish"},
["mnl"] = {"Tiale"},
["mnm"] = {"Mapena"},
["mnn"] = {"Mnong Yiass"},
["mno"] = {"çhengaghyn Manobo"},
["mnp"] = {"Sheenish Min Bei"},
["mnq"] = {"Minriq"},
["mnr"] = {"Mono (SUA)"},
["mns"] = {"Mansi"},
["mnu"] = {"Mer"},
["mnv"] = {"Rennell-Bellona"},
["mnw"] = {"Mon"},
["mnx"] = {"Manikion"},
["mny"] = {"Manyawa"},
["mnz"] = {"Moni"},
["moa"] = {"Mwan"},
["moc"] = {"Mocoví"},
["mod"] = {"Mobilish"},
["moe"] = {"Innu", "Montagnais"},
["mog"] = {"Mongondow"},
["moh"] = {"Mohawkish"},
["moi"] = {"Mboi"},
["moj"] = {"Monzombo"},
["mok"] = {"Morori"},
["mom"] = {"Mangue"},
["moo"] = {"Monom"},
["mop"] = {"Mayish Mopán"},
["moq"] = {"Mor (Lieh-innys Bomberai)"},
["mor"] = {"Moroish"},
["mos"] = {"Mossish"},
["mot"] = {"Barí"},
["mou"] = {"Mogum"},
["mov"] = {"Mohave"},
["mow"] = {"Moi (y Congo)"},
["mox"] = {"Molima"},
["moy"] = {"Shekkacho"},
["moz"] = {"Mukulu", "Gergiko"},
["mpa"] = {"Mpoto"},
["mpb"] = {"Malak Malak", "Mullukmulluk"},
["mpc"] = {"Mangarrayi"},
["mpd"] = {"Machinere"},
["mpe"] = {"Majang"},
["mpg"] = {"Marba"},
["mph"] = {"Maung"},
["mpi"] = {"Mpade"},
["mpj"] = {"Martu Wangka", "Wangkajunga"},
["mpk"] = {"Mbara (Shad)"},
["mpl"] = {"Watut Veanagh"},
["mpm"] = {"Mixtecish Yosondúa"},
["mpn"] = {"Mindiri"},
["mpo"] = {"Miu"},
["mpp"] = {"Migabac"},
["mpq"] = {"Matís"},
["mpr"] = {"Vangunu"},
["mps"] = {"Dadibi"},
["mpt"] = {"Mian"},
["mpu"] = {"Makuráp"},
["mpv"] = {"Mungkip"},
["mpw"] = {"Mapidish"},
["mpx"] = {"Misima-Panaeati"},
["mpy"] = {"Mapia"},
["mpz"] = {"Mpi"},
["mqa"] = {"Maba (yn Indoneesh)"},
["mqb"] = {"Mbuko"},
["mqc"] = {"Mangole"},
["mqe"] = {"Matepi"},
["mqf"] = {"Momuna"},
["mqg"] = {"Mlayish Kota Bangun Kutai"},
["mqh"] = {"Mixtecish Tlazoyaltepec"},
["mqi"] = {"Mariri"},
["mqj"] = {"Mamasa"},
["mqk"] = {"Rajah Kabunsuwan Manobo"},
["mql"] = {"Mbelime"},
["mqm"] = {"Marquesish Yiass"},
["mqn"] = {"Moronene"},
["mqo"] = {"Modole"},
["mqp"] = {"Manipa"},
["mqq"] = {"Minokok"},
["mqr"] = {"Mander"},
["mqs"] = {"Makish Heear"},
["mqt"] = {"Mok"},
["mqu"] = {"Mandari"},
["mqv"] = {"Mosimo"},
["mqw"] = {"Murupi"},
["mqx"] = {"Mamuju"},
["mqy"] = {"Manggarai"},
["mqz"] = {"Pano"},
["mra"] = {"Mlabri"},
["mrb"] = {"Marino"},
["mrc"] = {"Maricopa"},
["mrd"] = {"Magar Heear"},
["mre"] = {"Çhengey Chowree Martha's Vineyard"},
["mrf"] = {"Elseng"},
["mrg"] = {"Mising"},
["mrh"] = {"Mara Chin"},
["mrj"] = {"Marish Heear"},
["mrk"] = {"Hmwaveke"},
["mrl"] = {"Mortlockish"},
["mrm"] = {"Merlav", "Mwerlap"},
["mrn"] = {"Cheke Holo"},
["mro"] = {"Mru"},
["mrp"] = {"Morouas"},
["mrq"] = {"Marquesish Hwoaie"},
["mrr"] = {"Maria (yn Injey)"},
["mrs"] = {"Maragus"},
["mrt"] = {"Marghi Veanagh"},
["mru"] = {"Mono (Cameroon)"},
["mrv"] = {"Mangareva"},
["mrw"] = {"Maranao"},
["mrx"] = {"Maremgi", "Dineor"},
["mry"] = {"Mandaya"},
["mrz"] = {"Marind"},
["msb"] = {"Masbatenyo"},
["msc"] = {"Sankaran Maninka"},
["msd"] = {"Çhengey Chowree Mayagh Yucatec"},
["mse"] = {"Musey"},
["msf"] = {"Mekwei"},
["msg"] = {"Moraid"},
["msh"] = {"Malagasish Masikoro"},
["msi"] = {"Malayish Sabah"},
["msj"] = {"Ma (Pobblaght Gheynlagh y Chongo)"},
["msk"] = {"Mansaka"},
["msl"] = {"Molof", "Poule"},
["msm"] = {"Agusan Manobo"},
["msn"] = {"Vurës"},
["mso"] = {"Mombum"},
["msp"] = {"Maritsauá"},
["msq"] = {"Caac"},
["msr"] = {"Çhengey Chowree Vongoilagh"},
["mss"] = {"Masela Heear"},
["msu"] = {"Musom"},
["msv"] = {"Maslam"},
["msw"] = {"Mansoanka"},
["msx"] = {"Moresada"},
["msy"] = {"Aruamu"},
["msz"] = {"Momare"},
["mta"] = {"Manobo Cotabato"},
["mtb"] = {"Anyin Morofo"},
["mtc"] = {"Munit"},
["mtd"] = {"Mualang"},
["mte"] = {"Mono (Ellanyn Solomon)"},
["mtf"] = {"Murik (Papooey Guinea Noa)"},
["mtg"] = {"Una"},
["mth"] = {"Munggui"},
["mti"] = {"Maiwa (Papooey Guinea Noa)"},
["mtj"] = {"Moskona"},
["mtk"] = {"Mbe'"},
["mtl"] = {"Montol"},
["mtm"] = {"Mator"},
["mtn"] = {"Matagalpa"},
["mto"] = {"Totontepec Mixe"},
["mtp"] = {"Wichí Lhamtés Nocten"},
["mtq"] = {"Muong"},
["mtr"] = {"Mewari"},
["mts"] = {"Yora"},
["mtt"] = {"Mota"},
["mtu"] = {"Mixtecish Tututepec"},
["mtv"] = {"Asaro'o"},
["mtw"] = {"Binukidnon Yiass"},
["mtx"] = {"Mixtecish Tidaá"},
["mty"] = {"Nabi"},
["mua"] = {"Mundang"},
["mub"] = {"Mubi"},
["muc"] = {"Ajumbu"},
["mud"] = {"Aleutish Mednyj"},
["mue"] = {"Media Lengua"},
["mug"] = {"Musgu"},
["muh"] = {"Mündü"},
["mui"] = {"Musi"},
["muj"] = {"Mabire"},
["muk"] = {"Mugom"},
["mul"] = {"Ymmodee çhengaghyn"},
["mum"] = {"Maiwala"},
["mun"] = {"çhengaghyn Munda"},
["muo"] = {"Nyong"},
["mup"] = {"Malvi"},
["muq"] = {"Miaoish Xiangxi Hiar"},
["mur"] = {"Murle"},
["mus"] = {"Creekish"},
["mut"] = {"Murish Heear"},
["muu"] = {"Yaaku"},
["muv"] = {"Muthuvan"},
["mux"] = {"Bo-Ung"},
["muy"] = {"Muyang"},
["muz"] = {"Mursi"},
["mva"] = {"Manam"},
["mvb"] = {"Mattole"},
["mvd"] = {"Mamboru"},
["mve"] = {"Marwari (y Phakistaan)"},
["mvf"] = {"Mongoilish Ymmyllagh"},
["mvg"] = {"Mixtecish Yucuañe"},
["mvh"] = {"Mulgi"},
["mvi"] = {"Miyako"},
["mvk"] = {"Mekmek"},
["mvl"] = {"Mbara (yn Austrail)"},
["mvn"] = {"Minaveha"},
["mvo"] = {"Marovo"},
["mvp"] = {"Duri"},
["mvq"] = {"Moere"},
["mvr"] = {"Marau"},
["mvs"] = {"Massep"},
["mvt"] = {"Mpotovoro"},
["mvu"] = {"Marfa"},
["mvv"] = {"Tagal Murut"},
["mvw"] = {"Machinga"},
["mvx"] = {"Meoswar"},
["mvy"] = {"Kohistaanish Indus"},
["mvz"] = {"Mesqan"},
["mwa"] = {"Mwatebu"},
["mwb"] = {"Juwal"},
["mwc"] = {"Are"},
["mwe"] = {"Mwera (Chimwera)"},
["mwf"] = {"Murrinh-Patha"},
["mwg"] = {"Aiklep"},
["mwh"] = {"Mouk-Aria"},
["mwi"] = {"Labo", "Ninde"},
["mwk"] = {"Maninkish Kita"},
["mwl"] = {"Mirandish"},
["mwm"] = {"Sar"},
["mwn"] = {"Nyamwanga"},
["mwo"] = {"Maewo Veanagh"},
["mwp"] = {"Kala Lagaw Ya"},
["mwq"] = {"Mün Chin"},
["mwr"] = {"Marwari"},
["mws"] = {"Mwimbi-Muthambi"},
["mwt"] = {"Moken"},
["mwu"] = {"Mittu"},
["mwv"] = {"Mentawai"},
["mww"] = {"Hmong Daw"},
["mwz"] = {"Moingi"},
["mxa"] = {"Mixtecish Oaxaca Heear Hwoaie"},
["mxb"] = {"Mixtecish Tezoatlán"},
["mxc"] = {"Manyika"},
["mxd"] = {"Modang"},
["mxe"] = {"Mele-Fila"},
["mxf"] = {"Malgbe"},
["mxg"] = {"Mbangala"},
["mxh"] = {"Mvuba"},
["mxi"] = {"Mozarabish"},
["mxj"] = {"Miju-Mishmi", "Geman Deng"},
["mxk"] = {"Monumbo"},
["mxl"] = {"Maxi Gbe"},
["mxm"] = {"Meramera"},
["mxn"] = {"Moi (yn Indoneesh)"},
["mxo"] = {"Mbowe"},
["mxp"] = {"Tlahuitoltepec Mixe"},
["mxq"] = {"Juquila Mixe"},
["mxr"] = {"Murik (y Valaysia)"},
["mxs"] = {"Mixtecish Huitepec"},
["mxt"] = {"Mixtecish Jamiltepec"},
["mxu"] = {"Mada (Cameroon)"},
["mxv"] = {"Mixtecish Metlatónoc"},
["mxw"] = {"Namo"},
["mxx"] = {"Mahou", "Mawukakan"},
["mxy"] = {"Mixtecish Nochixtlán Hiar Yiass"},
["mxz"] = {"Masela Veanagh"},
["myb"] = {"Mbay"},
["myc"] = {"Mayeka"},
["mye"] = {"Myene"},
["myf"] = {"Bambassi"},
["myg"] = {"Manta"},
["myh"] = {"Makah"},
["myj"] = {"Mangayat"},
["myk"] = {"Mamara Senoufo"},
["myl"] = {"Moma"},
["mym"] = {"Me'en"},
["myn"] = {"çhengaghyn Mayagh"},
["myo"] = {"Anfillo"},
["myp"] = {"Pirahã"},
["myr"] = {"Muniche"},
["mys"] = {"Mesmes"},
["myu"] = {"Mundurukú"},
["myv"] = {"Erzya"},
["myw"] = {"Muyuw"},
["myx"] = {"Masaaba"},
["myy"] = {"Macuna"},
["myz"] = {"Mandaish Chlassicagh"},
["mza"] = {"Mixtecish Zacatepec Santa María"},
["mzb"] = {"Tumzabt"},
["mzc"] = {"Çhengey Chowree Vadagascar"},
["mzd"] = {"Malimba"},
["mze"] = {"Morawa"},
["mzg"] = {"Çhengey Chowree Vaynaghoil"},
["mzh"] = {"Wichí Lhamtés Güisnay"},
["mzi"] = {"Mazatec Ixcatlán"},
["mzj"] = {"Manya"},
["mzk"] = {"Mambila yn Naigeer"},
["mzl"] = {"Mazatlán Mixe"},
["mzm"] = {"Mumuye"},
["mzn"] = {"Mazanderanish"},
["mzo"] = {"Matipuhy"},
["mzp"] = {"Movima"},
["mzq"] = {"Mori Atas"},
["mzr"] = {"Marúbo"},
["mzs"] = {"Macanish"},
["mzt"] = {"Mintil"},
["mzu"] = {"Inapang"},
["mzv"] = {"Manza"},
["mzw"] = {"Deg"},
["mzx"] = {"Mawayana"},
["mzy"] = {"Çhengey Chowree Vosambeeckagh"},
["mzz"] = {"Maiadomu"},
["naa"] = {"Namla"},
["nab"] = {"Nambikuára Yiass"},
["nac"] = {"Narak"},
["nae"] = {"Naka'ela"},
["naf"] = {"Nabak"},
["nag"] = {"Naga Vrisht"},
["nah"] = {"çhengaghyn Nahuatl"},
["nai"] = {"çhengaghyn Injinagh Americaanagh Hwoaie"},
["naj"] = {"Nalu"},
["nak"] = {"Nakanai"},
["nal"] = {"Nalik"},
["nam"] = {"Ngan'gityemerri"},
["nan"] = {"Sheenish Min Nan"},
["nao"] = {"Naaba"},
["nap"] = {"Naaplish"},
["naq"] = {"Khoekhoeish", "Nama (y Nameeb)"},
["nar"] = {"Iguta"},
["nas"] = {"Naasioi"},
["nat"] = {"Ca̱hungwa̱rya̱", "Hungworo"},
["naw"] = {"Nawuri"},
["nax"] = {"Nakwi"},
["nay"] = {"Ngarrindjeri"},
["naz"] = {"Nahuatl Coatepec"},
["nba"] = {"Nyemba"},
["nbb"] = {"Ndoe"},
["nbc"] = {"Chang Naga"},
["nbd"] = {"Ngbinda"},
["nbe"] = {"Konyak Naga"},
["nbg"] = {"Nagarchal"},
["nbh"] = {"Ngamo"},
["nbi"] = {"Mao Naga"},
["nbj"] = {"Ngarinyman"},
["nbk"] = {"Nake"},
["nbm"] = {"Ngbaka Ma'bo"},
["nbn"] = {"Kuri"},
["nbo"] = {"Nkukoli"},
["nbp"] = {"Nnam"},
["nbq"] = {"Nggem"},
["nbr"] = {"Numana"},
["nbs"] = {"Çhengey Chowree Nameebagh"},
["nbt"] = {"Na"},
["nbu"] = {"Rongmei Naga"},
["nbv"] = {"Ngamambo"},
["nbw"] = {"Ngbandi Yiass"},
["nby"] = {"Ningera"},
["nca"] = {"Iyo"},
["ncb"] = {"Nicobarish Veanagh"},
["ncc"] = {"Ponam"},
["ncd"] = {"Nachering"},
["nce"] = {"Yale"},
["ncf"] = {"Notsi"},
["ncg"] = {"Nisga'a"},
["nch"] = {"Nahuatl Huasteca Veanagh"},
["nci"] = {"Nahuatl Chlassicagh"},
["ncj"] = {"Nahuatl Puebla Hwoaie"},
["nck"] = {"Na-kara"},
["ncl"] = {"Nahuatl Michoacán"},
["ncm"] = {"Nambo"},
["ncn"] = {"Nauna"},
["nco"] = {"Sibe"},
["ncq"] = {"Katang Hwoaie"},
["ncr"] = {"Ncane"},
["ncs"] = {"Çhengey Chowree Nickeraagagh"},
["nct"] = {"Naga Chothe"},
["ncu"] = {"Chumburung"},
["ncx"] = {"Nahuatl Puebla Veanagh"},
["ncz"] = {"Natchez"},
["nda"] = {"Ndasa"},
["ndb"] = {"Kenswei Nsei"},
["ndc"] = {"Ndauish"},
["ndd"] = {"Nde-Nsele-Nta"},
["ndf"] = {"Nadruvish"},
["ndg"] = {"Ndengereko"},
["ndh"] = {"Ndali"},
["ndi"] = {"Samba Leko"},
["ndj"] = {"Ndamba"},
["ndk"] = {"Ndaka"},
["ndl"] = {"Ndolo"},
["ndm"] = {"Ndam"},
["ndn"] = {"Ngundi"},
["ndp"] = {"Ndo"},
["ndq"] = {"Ndombe"},
["ndr"] = {"Ndoola"},
["nds"] = {"Germaanish Injil", "Saxonish Injil"},
["ndt"] = {"Ndunga"},
["ndu"] = {"Dugun"},
["ndv"] = {"Ndut"},
["ndw"] = {"Ndobo"},
["ndx"] = {"Nduga"},
["ndy"] = {"Lutos"},
["ndz"] = {"Ndogo"},
["nea"] = {"Ngad'a Hiar"},
["neb"] = {"Toura (y Clyst Iuaagagh)"},
["nec"] = {"Nedebang"},
["ned"] = {"Nde-Gbite"},
["nee"] = {"Nêlêmwa-Nixumwak"},
["nef"] = {"Nefamese"},
["neg"] = {"Negidal"},
["neh"] = {"Nyenkha"},
["nei"] = {"Noa-Hittish"},
["nej"] = {"Neko"},
["nek"] = {"Neku"},
["nem"] = {"Nemi"},
["nen"] = {"Nengone"},
["neo"] = {"Ná-Meo"},
["neq"] = {"Mixe Veanagh Hwoaie"},
["ner"] = {"Yahadish"},
["nes"] = {"Kinnaurish Bhoti"},
["net"] = {"Nete"},
["neu"] = {"Neo"},
["nev"] = {"Nyaheun"},
["new"] = {"Newari", "Nepal Bhasa"},
["nex"] = {"Neme"},
["ney"] = {"Neyo"},
["nez"] = {"Nez Perce"},
["nfa"] = {"Dhao"},
["nfd"] = {"Ahwai"},
["nfl"] = {"Ayiwo", "Äiwoo"},
["nfr"] = {"Nafaanra"},
["nfu"] = {"Mfumte"},
["nga"] = {"Ngbaka"},
["ngb"] = {"Ngbandi Hwoaie"},
["ngc"] = {"Ngombe (Pobblaght Gheynlagh y Chongo)"},
["ngd"] = {"Ngando (Pobblaght yn Affrick Veanagh)"},
["nge"] = {"Ngemba"},
["ngf"] = {"çhengaghyn tessen-Noa-Ghuineagh"},
["ngg"] = {"Ngbaka Manza"},
["ngh"] = {"Nǁng"},
["ngi"] = {"Ngizim"},
["ngj"] = {"Ngie"},
["ngk"] = {"Dalabon"},
["ngl"] = {"Lomwe"},
["ngm"] = {"Creeole Fir Ngatik"},
["ngn"] = {"Ngwo"},
["ngp"] = {"Ngulu"},
["ngq"] = {"Ngurimi", "Ngoreme"},
["ngr"] = {"Engdewu"},
["ngs"] = {"Gvoko"},
["ngt"] = {"Kriang", "Ngeq"},
["ngu"] = {"Nahuatl Guerrero"},
["ngv"] = {"Nagumi"},
["ngw"] = {"Ngwaba"},
["ngx"] = {"Nggwahyi"},
["ngy"] = {"Tibea"},
["ngz"] = {"Ngungwel"},
["nha"] = {"Nhanda"},
["nhb"] = {"Beng"},
["nhc"] = {"Nahuatl Tabasco"},
["nhd"] = {"Chiripá", "Guaranish Ava"},
["nhe"] = {"Nahuatl Huasteca Hiar"},
["nhf"] = {"Nhuwala"},
["nhg"] = {"Nahuatl Tetelcingo"},
["nhh"] = {"Nahari"},
["nhi"] = {"Nahuatl Zacatlán-Ahuacatlán-Tepetzintla"},
["nhk"] = {"Nahuatl Isthmus-Cosoleacaque"},
["nhm"] = {"Nahuatl Morelos"},
["nhn"] = {"Nahuatl Veanagh"},
["nho"] = {"Takuu"},
["nhp"] = {"Nahuatl Isthmus-Pajapan"},
["nhq"] = {"Nahuatl Huaxcaleca"},
["nhr"] = {"Naro"},
["nht"] = {"Nahuatl Ometepec"},
["nhu"] = {"Noone"},
["nhv"] = {"Nahuatl Temascaltepec"},
["nhw"] = {"Nahuatl Huasteca Heear"},
["nhx"] = {"Nahuatl Isthmus-Mecayapan"},
["nhy"] = {"Nahuatl Oaxaca Hwoaie"},
["nhz"] = {"Nahuatl Santa María La Alta"},
["nia"] = {"Nias"},
["nib"] = {"Nakame"},
["nic"] = {"çhengaghyn Neegeyr-Kordofanagh"},
["nid"] = {"Ngandi"},
["nie"] = {"Niellim"},
["nif"] = {"Nek"},
["nig"] = {"Ngalakgan"},
["nih"] = {"Nyiha (Tanzania)"},
["nii"] = {"Nii"},
["nij"] = {"Ngaju"},
["nik"] = {"Nicobarish Yiass"},
["nil"] = {"Nila"},
["nim"] = {"Nilamba"},
["nin"] = {"Ninzo"},
["nio"] = {"Nganasanish"},
["niq"] = {"Nandi"},
["nir"] = {"Nimborish"},
["nis"] = {"Nimi"},
["nit"] = {"Kolamish Hiar Yiass"},
["niu"] = {"Niuean"},
["niv"] = {"Gilyakish"},
["niw"] = {"Nimo"},
["nix"] = {"Hema"},
["niy"] = {"Ngiti"},
["niz"] = {"Ningil"},
["nja"] = {"Nzanyi"},
["njb"] = {"Naga Nocte"},
["njd"] = {"Ndonde Hamba"},
["njh"] = {"Naga Lotha"},
["nji"] = {"Gudanji"},
["njj"] = {"Njen"},
["njl"] = {"Njalgulgule"},
["njm"] = {"Angami Naga"},
["njn"] = {"Naga Liangmai"},
["njo"] = {"Naga Ao"},
["njr"] = {"Njerep"},
["njs"] = {"Nisa"},
["njt"] = {"Ndyuka-Trio Vrisht"},
["nju"] = {"Ngadjunmaya"},
["njx"] = {"Kunyi"},
["njy"] = {"Njyem"},
["njz"] = {"Nyishi"},
["nka"] = {"Nkoya"},
["nkb"] = {"Naga Khoibu"},
["nkc"] = {"Nkongho"},
["nkd"] = {"Koireng"},
["nke"] = {"Duke"},
["nkf"] = {"Naga Inpui"},
["nkg"] = {"Nekgini"},
["nkh"] = {"Naga Khezha"},
["nki"] = {"Naga Thangal"},
["nkj"] = {"Nakai"},
["nkk"] = {"Nokuku"},
["nkm"] = {"Namat"},
["nkn"] = {"Nkangala"},
["nko"] = {"Nkonya"},
["nkp"] = {"Niuatoputapu"},
["nkq"] = {"Nkami"},
["nkr"] = {"Nukuoro"},
["nks"] = {"Asmat Hwoaie"},
["nkt"] = {"Nyika (Tanzania)"},
["nku"] = {"Bouna Kulango"},
["nkv"] = {"Nyika (Malawi as y Tambia)"},
["nkw"] = {"Nkutu"},
["nkx"] = {"Nkoroo"},
["nkz"] = {"Nkari"},
["nla"] = {"Ngombale"},
["nlc"] = {"Nalca"},
["nle"] = {"Nyala Hiar"},
["nlg"] = {"Gela"},
["nli"] = {"Grangali"},
["nlj"] = {"Nyali"},
["nlk"] = {"Ninia Yali"},
["nll"] = {"Nihali"},
["nlm"] = {"Mankiyali"},
["nlo"] = {"Ngul"},
["nlq"] = {"Naga Lao"},
["nlu"] = {"Nchumbulu"},
["nlv"] = {"Orizaba Nahuatl"},
["nlw"] = {"Walangama"},
["nlx"] = {"Nahali"},
["nly"] = {"Nyamal"},
["nlz"] = {"Nalögo"},
["nma"] = {"Naga Maram"},
["nmb"] = {"Nambas Vooar", "V'ënen Taut"},
["nmc"] = {"Ngam"},
["nmd"] = {"Ndumu"},
["nme"] = {"Naga Mzieme"},
["nmf"] = {"Naga Tangkhul (yn Injey)"},
["nmg"] = {"Kwasio"},
["nmh"] = {"Naga Monsang"},
["nmi"] = {"Nyam"},
["nmj"] = {"Ngombe (Pobblaght yn Affrick Veanagh)"},
["nmk"] = {"Namakura"},
["nml"] = {"Ndemli"},
["nmm"] = {"Manangba"},
["nmn"] = {"ǃXóõ"},
["nmo"] = {"Naga Moyon"},
["nmp"] = {"Nimanbur"},
["nmq"] = {"Nambya"},
["nmr"] = {"Nimbari"},
["nms"] = {"Letemboi"},
["nmt"] = {"Namonuito"},
["nmu"] = {"Maidu Hiar Hwoaie"},
["nmv"] = {"Ngamini"},
["nmw"] = {"Nimoa", "Rifao"},
["nmx"] = {"Nama (Papooey Guinea Noa)"},
["nmy"] = {"Namuyi"},
["nmz"] = {"Nawdm"},
["nna"] = {"Nyangumarta"},
["nnb"] = {"Nande"},
["nnc"] = {"Nancere"},
["nnd"] = {"Ambae Heear"},
["nne"] = {"Ngandyera"},
["nnf"] = {"Ngaing"},
["nng"] = {"Naga Maring"},
["nnh"] = {"Ngiemboon"},
["nni"] = {"Nuaulu Hwoaie"},
["nnj"] = {"Nyangatom"},
["nnk"] = {"Nankina"},
["nnl"] = {"Naga Rengma Hwoaie "},
["nnm"] = {"Namia"},
["nnn"] = {"Ngete"},
["nnp"] = {"Naga Wancho"},
["nnq"] = {"Ngindo"},
["nnr"] = {"Narungga"},
["nnt"] = {"Nanticoke"},
["nnu"] = {"Dwang"},
["nnv"] = {"Nugunu (yn Austrail)"},
["nnw"] = {"Nuni Yiass"},
["nny"] = {"Nyangga"},
["nnz"] = {"Nda'nda'"},
["noa"] = {"Woun Meu"},
["noc"] = {"Nuk"},
["nod"] = {"Thai Hwoaie"},
["noe"] = {"Nimadi"},
["nof"] = {"Nomane"},
["nog"] = {"Nogaish"},
["noh"] = {"Nomu"},
["noi"] = {"Noiri"},
["noj"] = {"Nonuya"},
["nok"] = {"Nooksack"},
["nol"] = {"Nomlaki"},
["non"] = {"Shenn Loghlynnish"},
["nop"] = {"Numanggang"},
["noq"] = {"Ngongo"},
["nos"] = {"Nisu Hiar"},
["not"] = {"Nomatsiguenga"},
["nou"] = {"Ewage-Notu"},
["nov"] = {"Novial"},
["now"] = {"Nyambo"},
["noy"] = {"Noy"},
["noz"] = {"Nayi"},
["npa"] = {"Nar Phu"},
["npb"] = {"Nupbikha"},
["npg"] = {"Naga Ponyo-Gongwang"},
["nph"] = {"Naga Phom"},
["npi"] = {"Nepaalish"},
["npl"] = {"Nahuatl Puebla Hiar Yiass"},
["npn"] = {"Mondropolon"},
["npo"] = {"Naga Pochuri"},
["nps"] = {"Nipsan"},
["npu"] = {"Naga Puimei"},
["npx"] = {"Noipx"},
["npy"] = {"Napu"},
["nqg"] = {"Nago Yiass"},
["nqk"] = {"Kura Ede Nago"},
["nql"] = {"Ngendelengo"},
["nqm"] = {"Ndom"},
["nqn"] = {"Nen"},
["nqo"] = {"N'Ko", "N’Ko"},
["nqq"] = {"Naga Kyan-Karyaw"},
["nqt"] = {"Nteng"},
["nqy"] = {"Naga Akyaung Ari"},
["nra"] = {"Ngom"},
["nrb"] = {"Nara"},
["nrc"] = {"Norish"},
["nre"] = {"Naga Rengma Yiass"},
["nrf"] = {"Jèrriais", "Guernésiais", "Sercquiais"},
["nrg"] = {"Narango"},
["nri"] = {"Naga Chokri"},
["nrk"] = {"Ngarla"},
["nrl"] = {"Ngarluma"},
["nrm"] = {"Narom"},
["nrn"] = {"Nornish"},
["nrp"] = {"Picenish Hwoaie"},
["nrr"] = {"Norra", "Nora"},
["nrt"] = {"Kalapuya Hwoaie"},
["nru"] = {"Narua"},
["nrx"] = {"Ngurmbur"},
["nrz"] = {"Lala"},
["nsa"] = {"Naga Sangtam"},
["nsb"] = {"Nossob Injil"},
["nsc"] = {"Nshi"},
["nsd"] = {"Nisu Yiass"},
["nse"] = {"Nsenga"},
["nsf"] = {"Nisu Heear Hwoaie"},
["nsg"] = {"Ngasa"},
["nsh"] = {"Ngoshie"},
["nsi"] = {"Çhengey Chowree Naigeeragh"},
["nsk"] = {"Naskapi"},
["nsl"] = {"Çhengey Chowree Norlynnagh"},
["nsm"] = {"Naga Sumi"},
["nsn"] = {"Nehan"},
["nso"] = {"Pedish", "Sotoish Hwoaie", "Sepedi"},
["nsp"] = {"Çhengey Chowree Nepaalagh"},
["nsq"] = {"Miwokish Sierra Hwoaie"},
["nsr"] = {"Çhengey Chowree Vooiragh"},
["nss"] = {"Nali"},
["nst"] = {"Naga Tase"},
["nsu"] = {"Nahuatl Sierra Negra"},
["nsv"] = {"Nisu Heear Yiass"},
["nsw"] = {"Navut"},
["nsx"] = {"Nsongo"},
["nsy"] = {"Nasal"},
["nsz"] = {"Nisenan"},
["ntd"] = {"Tidung Hwoaie"},
["nte"] = {"Nathembo"},
["ntg"] = {"Ngantangarra"},
["nti"] = {"Natioro"},
["ntj"] = {"Ngaanyatjarra"},
["ntk"] = {"Ikoma-Nata-Isenye"},
["ntm"] = {"Nateni"},
["nto"] = {"Ntomba"},
["ntp"] = {"Tepehuan Hwoaie"},
["ntr"] = {"Delo"},
["ntu"] = {"Natügu"},
["ntw"] = {"Nottoway"},
["ntx"] = {"Naga Tangkhul (Myanmar)"},
["nty"] = {"Mantsi"},
["ntz"] = {"Natanzi"},
["nua"] = {"Yuanga"},
["nub"] = {"çhengaghyn Nubiagh"},
["nuc"] = {"Nukuini"},
["nud"] = {"Ngala"},
["nue"] = {"Ngundu"},
["nuf"] = {"Nusu"},
["nug"] = {"Nungali"},
["nuh"] = {"Ndunda"},
["nui"] = {"Ngumbi"},
["nuj"] = {"Nyole"},
["nuk"] = {"Nuu-chah-nulth", "Nuuchahnulth"},
["nul"] = {"Nusa Laut"},
["num"] = {"Niuafo'ou"},
["nun"] = {"Anong"},
["nuo"] = {"Nguôn"},
["nup"] = {"Nupe-Nupe-Tako"},
["nuq"] = {"Nukumanu"},
["nur"] = {"Nukuria"},
["nus"] = {"Nuer"},
["nut"] = {"Nung (Viet Nam)"},
["nuu"] = {"Ngbundu"},
["nuv"] = {"Nuni Hwoaie"},
["nuw"] = {"Nguluwan"},
["nux"] = {"Mehek"},
["nuy"] = {"Nunggubuyu"},
["nuz"] = {"Nahuatl Tlamacazapa"},
["nvh"] = {"Nasarish"},
["nvm"] = {"Namiae"},
["nvo"] = {"Nyokon"},
["nwa"] = {"Nawathinehena"},
["nwb"] = {"Nyabwa"},
["nwc"] = {"Newarish Chlassicagh", "Nepal Bhasa Chlassicagh", "Shenn Newarish"},
["nwe"] = {"Ngwe"},
["nwg"] = {"Ngayawung"},
["nwi"] = {"Tanna Heear Yiass"},
["nwm"] = {"Nyamusa-Molo"},
["nwo"] = {"Nauo"},
["nwr"] = {"Nawaru"},
["nww"] = {"Ndwewe"},
["nwx"] = {"Newarish Veanagh"},
["nwy"] = {"Nottoway-Meherrin"},
["nxa"] = {"Nauete"},
["nxd"] = {"Ngando (Pobblaght Gheynlagh y Chongo)"},
["nxe"] = {"Nage"},
["nxg"] = {"Ngad'a"},
["nxi"] = {"Nindi"},
["nxk"] = {"Naga Koki"},
["nxl"] = {"Nuaulu Yiass"},
["nxm"] = {"Numidish"},
["nxn"] = {"Ngawun"},
["nxo"] = {"Ndambomo"},
["nxq"] = {"Naxi"},
["nxr"] = {"Ninggerum"},
["nxx"] = {"Nafri"},
["nyb"] = {"Nyangbo"},
["nyc"] = {"Nyanga-li"},
["nyd"] = {"Nyore", "Olunyole"},
["nye"] = {"Nyengo"},
["nyf"] = {"Giryama", "Kigiryama"},
["nyg"] = {"Nyindu"},
["nyh"] = {"Nyikina"},
["nyi"] = {"Ama (y Toodaan)"},
["nyj"] = {"Nyanga"},
["nyk"] = {"Nyaneka"},
["nyl"] = {"Nyeu"},
["nym"] = {"Nyamwezi"},
["nyn"] = {"Nyankole"},
["nyo"] = {"Nyoro"},
["nyp"] = {"Nyang'i"},
["nyq"] = {"Nayini"},
["nyr"] = {"Nyiha (Malawi)"},
["nys"] = {"Nyungar"},
["nyt"] = {"Nyawaygi"},
["nyu"] = {"Nyungwe"},
["nyv"] = {"Nyulnyul"},
["nyw"] = {"Nyaw"},
["nyx"] = {"Nganyaywana"},
["nyy"] = {"Nyakyusa-Ngonde"},
["nza"] = {"Tigon Mbembe"},
["nzb"] = {"Njebi"},
["nzd"] = {"Nzadi"},
["nzi"] = {"Nzima"},
["nzk"] = {"Nzakara"},
["nzm"] = {"Zeme Naga"},
["nzr"] = {"Dir-Nyamzak-Mbarimi"},
["nzs"] = {"Çhengey Chowree Noa-Heelynnagh"},
["nzu"] = {"Teke-Nzikou"},
["nzy"] = {"Nzakambay"},
["nzz"] = {"Nanga Dama Dogon"},
["oaa"] = {"Orok"},
["oac"] = {"Oroch"},
["oar"] = {"Shenn Aramaaish (derrey 700 RC)", "Aramaaish Henndeeagh (derrey 700 RC)"},
["oav"] = {"Shenn Avarish"},
["obi"] = {"Obispeño"},
["obk"] = {"Bontok Yiass"},
["obl"] = {"Oblo"},
["obm"] = {"Moabite"},
["obo"] = {"Obo Manobo"},
["obr"] = {"Shenn Vurmish"},
["obt"] = {"Shenn Vritaanish"},
["obu"] = {"Obulom"},
["oca"] = {"Ocaina"},
["och"] = {"Shenn Heenish"},
["ocm"] = {"Shenn Cham"},
["oco"] = {"Shenn Chornish"},
["ocu"] = {"Atzingo Matlatzinca"},
["oda"] = {"Odut"},
["odk"] = {"Od"},
["odt"] = {"Shenn Ollanish"},
["odu"] = {"Odual"},
["ofo"] = {"Ofo"},
["ofs"] = {"Shenn Reeshlannish"},
["ofu"] = {"Efutop"},
["ogb"] = {"Ogbia"},
["ogc"] = {"Ogbah"},
["oge"] = {"Shenn Horshish"},
["ogg"] = {"Ogbogolo"},
["ogo"] = {"Khana"},
["ogu"] = {"Ogbronuagum"},
["oht"] = {"Shenn Hittish"},
["ohu"] = {"Shenn Ungaarish"},
["oia"] = {"Oirata"},
["oie"] = {"Okolie"},
["oin"] = {"Inebu One"},
["ojb"] = {"OjibwaHeear Hwoaie"},
["ojc"] = {"Ojibwa Veanagh"},
["ojg"] = {"Ojibwa Hiar"},
["ojp"] = {"Shenn Hapaanish"},
["ojs"] = {"Ojibwa Severn"},
["ojv"] = {"Javish Ontong"},
["ojw"] = {"Ojibwa Heear"},
["oka"] = {"Okanagan"},
["okb"] = {"Okobo"},
["okc"] = {"Kobo"},
["okd"] = {"Okodia"},
["oke"] = {"Okpe (Edo Heear Yiass)"},
["okg"] = {"Koko Babangk"},
["okh"] = {"Koresh-e Rostam"},
["oki"] = {"Okiek"},
["okj"] = {"Oko-Juwoi"},
["okk"] = {"Kwamtim One"},
["okl"] = {"Shenn Çhengey Chowree Kent"},
["okm"] = {"Koreeish Veanagh (10oo-16oo eash)"},
["okn"] = {"Oki-No-Erabu"},
["oko"] = {"Shenn Choreeish (3oo-9oo eash)"},
["okr"] = {"Kirike"},
["oks"] = {"Oko-Eni-Osayen"},
["oku"] = {"Oku"},
["okv"] = {"Orokaiva"},
["okx"] = {"Okpe (Edo Heear Hwoaie)"},
["okz"] = {"Shenn Khmerish"},
["ola"] = {"Walungge"},
["old"] = {"Mochi"},
["ole"] = {"Olekha"},
["olk"] = {"Olkol"},
["olm"] = {"Oloma"},
["olo"] = {"Livvish"},
["olr"] = {"Olrat"},
["olt"] = {"Shenn Litaanish"},
["olu"] = {"Kuvale"},
["oma"] = {"Omaha-Ponca"},
["omb"] = {"Ambae Hiar"},
["omc"] = {"Mochica"},
["omg"] = {"Omagua"},
["omi"] = {"Omi"},
["omk"] = {"Omok"},
["oml"] = {"Ombo"},
["omn"] = {"Minoan"},
["omo"] = {"Utarmbung"},
["omp"] = {"Shenn Vanipurish"},
["omq"] = {"çhengaghyn Oto-Mangueagh"},
["omr"] = {"Shenn Varathish"},
["omt"] = {"Omotik"},
["omu"] = {"Omurano"},
["omv"] = {"çhengaghyn Omotagh"},
["omw"] = {"Tairora Yiass"},
["omx"] = {"Shenn Mon"},
["omy"] = {"Shenn Valayish"},
["ona"] = {"Ona"},
["onb"] = {"Lingao"},
["one"] = {"Oneida"},
["ong"] = {"Olo"},
["oni"] = {"Onin"},
["onj"] = {"Onjob"},
["onk"] = {"Kabore One"},
["onn"] = {"Onobasulu"},
["ono"] = {"Onondaga"},
["onp"] = {"Sartang"},
["onr"] = {"One Hwoaie"},
["ons"] = {"Ono"},
["ont"] = {"Ontenu"},
["onu"] = {"Unua"},
["onw"] = {"Shenn Nubish"},
["onx"] = {"Onin Vrisht"},
["ood"] = {"Tohono O'odham"},
["oog"] = {"Ong"},
["oon"] = {"Önge"},
["oor"] = {"Oorlams"},
["oos"] = {"Shenn Ossetish"},
["opa"] = {"Okpamheri"},
["opk"] = {"Kopkaka"},
["opm"] = {"Oksapmin"},
["opo"] = {"Opao"},
["opt"] = {"Opata"},
["opy"] = {"Ofayé"},
["ora"] = {"Oroha"},
["orc"] = {"Orma"},
["ore"] = {"Orejón"},
["org"] = {"Oring"},
["orh"] = {"Oroqen"},
["orn"] = {"Orang Kanaq"},
["oro"] = {"Orokolo"},
["orr"] = {"Oruma"},
["ors"] = {"Orang Seletar"},
["ort"] = {"Adivasi Oriya"},
["oru"] = {"Ormuri"},
["orv"] = {"Shenn Rooshish"},
["orw"] = {"Oro Win"},
["orx"] = {"Oro"},
["ory"] = {"Odish (çhengey er lheh)", "Oriyish (çhengey er lheh)"},
["orz"] = {"Ormu"},
["osa"] = {"Osage"},
["osc"] = {"Oscan"},
["osi"] = {"Osing"},
["osn"] = {"Shenn Hundanish"},
["oso"] = {"Ososo"},
["osp"] = {"Shenn Spaainish"},
["ost"] = {"Osatu"},
["osu"] = {"One Yiass"},
["osx"] = {"Shenn Haxonish"},
["ota"] = {"Turkish Ottomanagh (1500-1928)"},
["otb"] = {"Shenn Tibetish"},
["otd"] = {"Ot Danum"},
["ote"] = {"Otomi Mezquital"},
["oti"] = {"Oti"},
["otk"] = {"Shenn Turkish"},
["otl"] = {"Otomi Tilapa"},
["otm"] = {"Otomi Sleitoil Hiar"},
["otn"] = {"Otomi Tenango"},
["oto"] = {"çhengaghyn Otomagh"},
["otq"] = {"Otomi Querétaro"},
["otr"] = {"Otoro"},
["ots"] = {"Otomi Estado de México"},
["ott"] = {"Otomi Temoaya"},
["otu"] = {"Otuke"},
["otw"] = {"Ottawa"},
["otx"] = {"Otomi Texcatepec"},
["oty"] = {"Shenn Tamilish"},
["otz"] = {"Otomi Ixtenco"},
["oua"] = {"Tagargrent"},
["oub"] = {"Glio-Oubi"},
["oue"] = {"Oune"},
["oui"] = {"Shenn Uighurish"},
["oum"] = {"Ouma"},
["ovd"] = {"Elfdalish", "Övdalish"},
["owi"] = {"Owiniga"},
["owl"] = {"Shenn Vretnish"},
["oyb"] = {"Oy"},
["oyd"] = {"Oyda"},
["oym"] = {"Wayampi"},
["oyy"] = {"Oya'oya"},
["ozm"] = {"Koonzime"},
["paa"] = {"çhengaghyn Papooagh"},
["pab"] = {"Parecís"},
["pac"] = {"Pacoh"},
["pad"] = {"Paumarí"},
["pae"] = {"Pagibete"},
["paf"] = {"Paranawát"},
["pag"] = {"Pangasinan"},
["pah"] = {"Tenharim"},
["pai"] = {"Pe"},
["pak"] = {"Parakanã"},
["pal"] = {"Pahlavi"},
["pam"] = {"Pampanga", "Kapampangan"},
["pao"] = {"Paiute Hwoaie"},
["pap"] = {"Papiamento"},
["paq"] = {"Parya"},
["par"] = {"Panamint", "Timbisha"},
["pas"] = {"Papasena"},
["pau"] = {"Palauish"},
["pav"] = {"Pakaásnovos"},
["paw"] = {"Pawneeish"},
["pax"] = {"Pankararé"},
["pay"] = {"Pech"},
["paz"] = {"Pankararú"},
["pbb"] = {"Páez"},
["pbc"] = {"Patamona"},
["pbe"] = {"Popoloca Mezontla"},
["pbf"] = {"Popoloca Coyotepec"},
["pbg"] = {"Paraujano"},
["pbh"] = {"E'ñapa Woromaipu"},
["pbi"] = {"Parkwa"},
["pbl"] = {"Mak (y Naigeer)"},
["pbm"] = {"Mazatec Puebla"},
["pbn"] = {"Kpasam"},
["pbo"] = {"Papel"},
["pbp"] = {"Badyara"},
["pbr"] = {"Pangwa"},
["pbs"] = {"Pame Veanagh"},
["pbt"] = {"Pashtish Yiass"},
["pbu"] = {"Pashtish Hwoaie"},
["pbv"] = {"Pnar"},
["pby"] = {"Pyu (Papooey Guinea Noa)"},
["pca"] = {"Popoloca Ahuatempan Santa Inés"},
["pcb"] = {"Pear"},
["pcc"] = {"Bouyei"},
["pcd"] = {"Picardish"},
["pce"] = {"Ruching Palaung"},
["pcf"] = {"Paliyan"},
["pcg"] = {"Paniya"},
["pch"] = {"Pardhan"},
["pci"] = {"Duruwa"},
["pcj"] = {"Parenga"},
["pck"] = {"Paite Chin"},
["pcl"] = {"Pardhi"},
["pcm"] = {"Naigeerish Vrisht"},
["pcn"] = {"Piti"},
["pcp"] = {"Pacahuara"},
["pcw"] = {"Pyapun"},
["pda"] = {"Anam"},
["pdc"] = {"Germaanish Pennsylvania"},
["pdi"] = {"Pa Di"},
["pdn"] = {"Podena", "Fedan"},
["pdo"] = {"Padoe"},
["pdt"] = {"Plautdietsch"},
["pdu"] = {"Kayan"},
["pea"] = {"Indoneeshish Peranakan"},
["peb"] = {"Pomo Hiar"},
["ped"] = {"Mala (Papooey Guinea Noa)"},
["pee"] = {"Taje"},
["pef"] = {"Pomo Hiar Hwoaie"},
["peg"] = {"Pengo"},
["peh"] = {"Bonan"},
["pei"] = {"Chichimeca-Jonaz"},
["pej"] = {"Pomo Hwoaie"},
["pek"] = {"Penchal"},
["pel"] = {"Pekal"},
["pem"] = {"Phende"},
["peo"] = {"Shenn Phershish (ca. 600-400 RC)"},
["pep"] = {"Kunja"},
["peq"] = {"Pomo Yiass"},
["pes"] = {"Pershish Eeraanagh"},
["pev"] = {"Pémono"},
["pex"] = {"Petats"},
["pey"] = {"Petjo"},
["pez"] = {"Penan Hiar"},
["pfa"] = {"Pááfang"},
["pfe"] = {"Pere"},
["pfl"] = {"Pfaelzisch"},
["pga"] = {"Creeole Arabish Soodaanagh"},
["pgd"] = {"Gāndhārī"},
["pgg"] = {"Pangwali"},
["pgi"] = {"Pagi"},
["pgk"] = {"Rerep"},
["pgl"] = {"Yernish Vunneydagh"},
["pgn"] = {"Paelignian"},
["pgs"] = {"Pangseng"},
["pgu"] = {"Pagu"},
["pgz"] = {"Çhengey Phapooey Guinea Noa"},
["pha"] = {"Pa-Hng"},
["phd"] = {"Phudagi"},
["phg"] = {"Phuong"},
["phh"] = {"Phukha"},
["phi"] = {"çhengaghyn Philippeenagh"},
["phj"] = {"Pahari"},
["phk"] = {"Phake"},
["phl"] = {"Phalura", "Palula"},
["phm"] = {"Phimbi"},
["phn"] = {"çhengaghyn Feaneeckagh"},
["pho"] = {"Phunoi"},
["phq"] = {"Phana'"},
["phr"] = {"Pahari-Potwari"},
["pht"] = {"Thai Phu"},
["phu"] = {"Phuan"},
["phv"] = {"Pahlavanish"},
["phw"] = {"Phangduwali"},
["pia"] = {"Pima Bajo"},
["pib"] = {"Yine"},
["pic"] = {"Pinji"},
["pid"] = {"Piaroa"},
["pie"] = {"Piro"},
["pif"] = {"Pingelapish"},
["pig"] = {"Pisabo"},
["pih"] = {"Pitcairn-Norfolk"},
["pij"] = {"Pijao"},
["pil"] = {"Yom"},
["pim"] = {"Powhatanish"},
["pin"] = {"Piame"},
["pio"] = {"Piapoco"},
["pip"] = {"Pero"},
["pir"] = {"Piratapuyo"},
["pis"] = {"Pijin"},
["pit"] = {"Pitta Pitta"},
["piu"] = {"Pintupi-Luritja"},
["piv"] = {"Pileni", "Vaeakau-Taumako"},
["piw"] = {"Pimbwe"},
["pix"] = {"Piu"},
["piy"] = {"Piya-Kwonci"},
["piz"] = {"Pije"},
["pjt"] = {"Pitjantjatjara"},
["pka"] = {"Ardhamāgadhī Prākrit"},
["pkb"] = {"Pokomo", "Kipfokomo"},
["pkc"] = {"Paekche"},
["pkg"] = {"Pak-Tong"},
["pkh"] = {"Pankhu"},
["pkn"] = {"Pakanha"},
["pko"] = {"Pökoot"},
["pkp"] = {"Pukapuka"},
["pkr"] = {"Attapady Kurumba"},
["pks"] = {"Çhengey Chowree Phakistaanagh"},
["pkt"] = {"Maleng"},
["pku"] = {"Paku"},
["pla"] = {"Miani"},
["plb"] = {"Polonombauk"},
["plc"] = {"Palawano Veanagh"},
["pld"] = {"Polari"},
["ple"] = {"Palu'e"},
["plf"] = {"çhengaghyn Malayo-Pholaneeshagh Meanagh"},
["plg"] = {"Pilagá"},
["plh"] = {"Paulohi"},
["plk"] = {"Shina Kohistan"},
["pll"] = {"Shwe Palaung"},
["pln"] = {"Palenquero"},
["plo"] = {"Popoluca Oluta"},
["plq"] = {"Palaic"},
["plr"] = {"Palaka Senoufo"},
["pls"] = {"Popoloca Tlacoyalco San Marcos", "Popoloca Tlalcoyalco San Marcos"},
["plt"] = {"Malagasish yn Ard-chlaare"},
["plu"] = {"Palikúr"},
["plv"] = {"Palawano Heear Yiass"},
["plw"] = {"Palawano Brooke's Point"},
["ply"] = {"Bolyu"},
["plz"] = {"Paluan"},
["pma"] = {"Paama"},
["pmb"] = {"Pambia"},
["pmd"] = {"Pallanganmiddang"},
["pme"] = {"Pwaamei"},
["pmf"] = {"Pamona"},
["pmh"] = {"Māhārāṣṭri Prākrit"},
["pmi"] = {"Pumi Hwoaie"},
["pmj"] = {"Pumi Yiass"},
["pml"] = {"Lingua Franca"},
["pmm"] = {"Pomo"},
["pmn"] = {"Pam"},
["pmo"] = {"Pom"},
["pmq"] = {"Pame Hwoaie"},
["pmr"] = {"Paynamar"},
["pms"] = {"Piedmontish"},
["pmt"] = {"Tuamotuan"},
["pmw"] = {"Miwokish ny Strahyn"},
["pmx"] = {"Naga Poumei"},
["pmy"] = {"Malayish Phapooagh"},
["pmz"] = {"Pame Yiass"},
["pna"] = {"Punan Bah-Biau"},
["pnb"] = {"Panjabish Heear"},
["pnc"] = {"Pannei"},
["pnd"] = {"Mpinda"},
["pne"] = {"Penan Heear"},
["png"] = {"Pangu", "Pongu"},
["pnh"] = {"Penrhyn"},
["pni"] = {"Aoheng"},
["pnj"] = {"Pinjarup"},
["pnk"] = {"Paunaka"},
["pnl"] = {"Paleni"},
["pnm"] = {"Punan Batu 1"},
["pnn"] = {"Pinai-Hagahai"},
["pno"] = {"Panobo"},
["pnp"] = {"Pancana"},
["pnq"] = {"Pana (Burkina Faso)"},
["pnr"] = {"Panim"},
["pns"] = {"Ponosakan"},
["pnt"] = {"Pontish"},
["pnu"] = {"Jiongnai Bunu"},
["pnv"] = {"Pinigura"},
["pnw"] = {"Banyjima", "Panytyima"},
["pnx"] = {"Phong-Kniang"},
["pny"] = {"Pinyin"},
["pnz"] = {"Pana (Pobblaght yn Affrick Veanagh)"},
["poc"] = {"Poqomam"},
["poe"] = {"Popoloca Atzingo San Juan"},
["pof"] = {"Poke"},
["pog"] = {"Potiguára"},
["poh"] = {"Poqomchi'"},
["poi"] = {"Popoluca Sleitoil"},
["pok"] = {"Pokangá"},
["pom"] = {"Pomo Hiar Yiass"},
["pon"] = {"Pohnpeish"},
["poo"] = {"Pomo Veanagh"},
["pop"] = {"Pwapwâ"},
["poq"] = {"Popoloca Texistepec"},
["pos"] = {"Popoloca Sayula"},
["pot"] = {"Potawatomi"},
["pov"] = {"Crioulo Ghuinea Eaghtyragh"},
["pow"] = {"Popoluca Otlaltepec San Felipe"},
["pox"] = {"Polabish"},
["poy"] = {"Pogolo"},
["poz"] = {"çhengaghyn Malayo-Pholaneeshagh"},
["ppe"] = {"Papi"},
["ppi"] = {"Paipai"},
["ppk"] = {"Uma"},
["ppl"] = {"Pipil", "Nicarao"},
["ppm"] = {"Papuma"},
["ppn"] = {"Papapana"},
["ppo"] = {"Folopa"},
["ppp"] = {"Pelende"},
["ppq"] = {"Pei"},
["pps"] = {"Popoloca Temalacayuca San Luís"},
["ppt"] = {"Pare"},
["ppu"] = {"Papora"},
["pqa"] = {"Pa'a"},
["pqe"] = {"çhengaghyn Malayo-Pholaneeshagh Hiar"},
["pqm"] = {"Malecite-Passamaquoddy"},
["pqw"] = {"çhengaghyn Malayo-Pholaneeshagh Heear"},
["pra"] = {"çhengaghyn Prakrit"},
["prc"] = {"Parachi"},
["prd"] = {"Parsish-Darish"},
["pre"] = {"Principensish"},
["prf"] = {"Paranan"},
["prg"] = {"Prooshish"},
["prh"] = {"Porohanon"},
["pri"] = {"Paicî"},
["prk"] = {"Parauk"},
["prl"] = {"Çhengey Chowree Pherooagh"},
["prm"] = {"Kibiri"},
["prn"] = {"Prasuni"},
["pro"] = {"Shenn Provençal (derrey 1500)", "Shenn Ocsitaanish (derrey 1500)"},
["prq"] = {"Ashéninka Perené"},
["prr"] = {"Puri"},
["prs"] = {"Darish", "Pershish Afghaanagh"},
["prt"] = {"Phai"},
["pru"] = {"Puragi"},
["prw"] = {"Parawen"},
["prx"] = {"Purik"},
["prz"] = {"Çhengey Chowree Providencia"},
["psa"] = {"Asue Awyu"},
["psc"] = {"Çhengey Chowree Eeraanagh", "Çhengey Chowree Phershagh"},
["psd"] = {"Çhengey Chowree Injinee ny Strahyn"},
["pse"] = {"Malayish Veanagh"},
["psg"] = {"Çhengey Chowree Penang"},
["psh"] = {"Pashai Heear Yiass", "Pashayi Heear Yiass"},
["psi"] = {"Pashai Hiar Yiass", "Pashayi Hiar Yiass"},
["psl"] = {"Çhengey Chowree Phurt-verçhagh"},
["psm"] = {"Pauserna"},
["psn"] = {"Panasuan"},
["pso"] = {"Çhengey Chowree Pholynnagh"},
["psp"] = {"Çhengey Chowree Philippeenagh"},
["psq"] = {"Pasi"},
["psr"] = {"Çhengey Chowree Phortiugagh"},
["pss"] = {"Kaulong"},
["pst"] = {"Pashtish Veanagh"},
["psu"] = {"Sauraseni Prākrit"},
["psw"] = {"Port Sandwich"},
["psy"] = {"Piscataway"},
["pta"] = {"Pai Tavytera"},
["pth"] = {"Pataxó Hã-Ha-Hãe"},
["pti"] = {"Pindiini", "Wangkatha"},
["ptn"] = {"Patanish"},
["pto"] = {"Zo'é"},
["ptp"] = {"Patep"},
["ptq"] = {"Pattapu"},
["ptr"] = {"Piamatsina"},
["ptt"] = {"Enrekang"},
["ptu"] = {"Bambam"},
["ptv"] = {"Port Vato"},
["ptw"] = {"Pentlatch"},
["pty"] = {"Pathiya"},
["pua"] = {"Purepecha Sleitoil Heear"},
["pub"] = {"Purum"},
["puc"] = {"Punan Merap"},
["pud"] = {"Punan Aput"},
["pue"] = {"Puelche"},
["puf"] = {"Punan Merah"},
["pug"] = {"Phuie"},
["pui"] = {"Puinave"},
["puj"] = {"Punan Tubu"},
["pum"] = {"Puma"},
["puo"] = {"Puoc"},
["pup"] = {"Pulabu"},
["puq"] = {"Puquina"},
["pur"] = {"Puruborá"},
["put"] = {"Putoh"},
["puu"] = {"Punu"},
["puw"] = {"Puluwatish"},
["pux"] = {"Puare"},
["puy"] = {"Purisimeño"},
["pwa"] = {"Pawaia"},
["pwb"] = {"Panawa"},
["pwg"] = {"Gapapaiwa"},
["pwi"] = {"Patwin"},
["pwm"] = {"Molbog"},
["pwn"] = {"Paiwan"},
["pwo"] = {"Karenish Heear Pwo"},
["pwr"] = {"Powari"},
["pww"] = {"Karenish Hwoaie Pwo"},
["pxm"] = {"Quetzaltepec Mixe"},
["pye"] = {"Pye Krumen"},
["pym"] = {"Fyam"},
["pyn"] = {"Poyanáwa"},
["pys"] = {"Çhengey Chowree Pharaguayagh", "Lengua de Señas del Paraguay"},
["pyu"] = {"Puyuma"},
["pyx"] = {"Pyu (Myanmar)"},
["pyy"] = {"Pyen"},
["pze"] = {"Pesse"},
["pzh"] = {"Pazeh"},
["pzn"] = {"Jejara Naga", "Para Naga"},
["qua"] = {"Quapaw"},
["qub"] = {"Quechua Huallaga Huánuco"},
["quc"] = {"K'iche'", "Quiché"},
["qud"] = {"Quichua Sleitoil Calderón"},
["quf"] = {"Quechua Lambayeque"},
["qug"] = {"Quichua Sleitoil Chimborazo"},
["quh"] = {"Quechua Voliviagh Yiass"},
["qui"] = {"Quileute"},
["quk"] = {"Quechua Chachapoyas"},
["qul"] = {"Quechua Voliviagh Hwoaie"},
["qum"] = {"Sipacapense"},
["qun"] = {"Quinault"},
["qup"] = {"Quechua Pastaza Yiass"},
["quq"] = {"Quinqui"},
["qur"] = {"Quechua Yanahuanca Pasco"},
["qus"] = {"Quichua Santiago del Estero"},
["quv"] = {"Sacapulteco"},
["quw"] = {"Quichua Injil Tena"},
["qux"] = {"Quechua Yauyos"},
["quy"] = {"Quechua Ayacucho"},
["quz"] = {"Quechua Cusco"},
["qva"] = {"Quechua Ambo-Pasco"},
["qvc"] = {"Quechua Cajamarca"},
["qve"] = {"Quechua Apurímac Hiar"},
["qvh"] = {"Quechua Huánaco Huamalíes-Dos de Mayo"},
["qvi"] = {"Quichua Sleitoil Imbabura"},
["qvj"] = {"Quichua Sleitoil Loja"},
["qvl"] = {"Quechua Lima Hwoaie Cajatambo"},
["qvm"] = {"Quechua Margos-Yarowilca-Lauricocha"},
["qvn"] = {"Quechua Junín Hwoaie"},
["qvo"] = {"Quechua Injil Napo"},
["qvp"] = {"Quechua Pacaraos"},
["qvs"] = {"Quechua San Martín"},
["qvw"] = {"Quechua Huaylla Wanca"},
["qvy"] = {"Queyu"},
["qvz"] = {"Quechua Pastaza Hwoaie"},
["qwa"] = {"Quechua Ancash Corongo"},
["qwc"] = {"Quechua Chlassicagh"},
["qwe"] = {"Quechuagh (kynney)"},
["qwh"] = {"Quechua Ancash Huaylas"},
["qwm"] = {"Kumanish (y Roosh)"},
["qws"] = {"Quechua Ancash Sihuas"},
["qwt"] = {"Kwalhioqua-Tlatskanai"},
["qxa"] = {"Quechua Ancash Chiquián"},
["qxc"] = {"Quechua Chincha"},
["qxh"] = {"Quechua Huánuco Panao"},
["qxl"] = {"Quechua Sleitoil Salasaca"},
["qxn"] = {"Quechua Ancash Conchucos Hwoaie"},
["qxo"] = {"Quechua Ancash Conchucos Yiass"},
["qxp"] = {"Quechua Puno"},
["qxq"] = {"Qashqa'i"},
["qxr"] = {"Quichua Sleitoil Cañar"},
["qxs"] = {"Qiang Yiass"},
["qxt"] = {"Quechua Pasco Santa Ana de Tusi"},
["qxu"] = {"Quechua Arequipa-La Unión"},
["qxw"] = {"Quechua Jauja Wanca"},
["qya"] = {"Quenya"},
["qyp"] = {"Quiripi"},
["raa"] = {"Dungmali"},
["rab"] = {"Camling"},
["rac"] = {"Rasawa"},
["rad"] = {"Rade"},
["raf"] = {"Meohang Heear"},
["rag"] = {"Logooli", "Lulogooli"},
["rah"] = {"Rabha"},
["rai"] = {"Ramoaaina"},
["raj"] = {"Rajasthanish"},
["rak"] = {"Tulu-Bohuai"},
["ral"] = {"Ralte"},
["ram"] = {"Canela"},
["ran"] = {"Riantana"},
["rao"] = {"Rao"},
["rap"] = {"Rapanui"},
["raq"] = {"Saam"},
["rar"] = {"Rarotongan", "Maorish Ellanyn Cook"},
["ras"] = {"Tegali"},
["rat"] = {"Razajerdi"},
["rau"] = {"Raute"},
["rav"] = {"Sampang"},
["raw"] = {"Rawang"},
["rax"] = {"Rang"},
["ray"] = {"Rapa"},
["raz"] = {"Rahambuu"},
["rbb"] = {"Rumai Palaung"},
["rbk"] = {"Bontok Hwoaie"},
["rbl"] = {"Miraya Bikol"},
["rbp"] = {"Barababaraba"},
["rcf"] = {"Creeole Frangish Réunion"},
["rdb"] = {"Rudbari"},
["rea"] = {"Rerau"},
["reb"] = {"Rembong"},
["ree"] = {"Rejang Kayan"},
["reg"] = {"Kara (Tanzania)"},
["rei"] = {"Reli"},
["rej"] = {"Rejang"},
["rel"] = {"Rendille"},
["rem"] = {"Remo"},
["ren"] = {"Rengao"},
["rer"] = {"Rer Bare"},
["res"] = {"Reshe"},
["ret"] = {"Retta"},
["rey"] = {"Reyesano"},
["rga"] = {"Roria"},
["rge"] = {"Greagish Romanagh"},
["rgk"] = {"Rangkas"},
["rgn"] = {"Romagnolish"},
["rgr"] = {"Resígaro"},
["rgs"] = {"Roglai Yiass"},
["rgu"] = {"Ringgou"},
["rhg"] = {"Rohingya"},
["rhp"] = {"Yahang"},
["ria"] = {"Riang (yn Injey)"},
["rib"] = {"Çhengey Chowree Bribri"},
["rif"] = {"Tarifit"},
["ril"] = {"Riang Lang", "Riang (Myanmar)"},
["rim"] = {"Nyaturu"},
["rin"] = {"Nungu"},
["rir"] = {"Ribun"},
["rit"] = {"Ritharrngu"},
["riu"] = {"Riung"},
["rjg"] = {"Rajong"},
["rji"] = {"Raji"},
["rjs"] = {"Rajbanshi"},
["rka"] = {"Kraol"},
["rkb"] = {"Rikbaktsa"},
["rkh"] = {"Rakahanga-Manihiki"},
["rki"] = {"Rakhine"},
["rkm"] = {"Marka"},
["rkt"] = {"Rangpuri", "Kamta"},
["rkw"] = {"Arakwal"},
["rma"] = {"Rama"},
["rmb"] = {"Rembarrnga"},
["rmc"] = {"Romanish Charpathagh"},
["rmd"] = {"Danvargish Romanagh"},
["rme"] = {"Baarle Romanagh"},
["rmf"] = {"Kaloromanish Innlynnagh"},
["rmg"] = {"Norlynnish Romanagh"},
["rmh"] = {"Murkim"},
["rmi"] = {"Lomavren"},
["rmk"] = {"Romkun"},
["rml"] = {"Romanish Valtagh"},
["rmm"] = {"Romanish"},
["rmn"] = {"Romanish Valkanagh"},
["rmo"] = {"Romanish Sinte"},
["rmp"] = {"Rempi"},
["rmq"] = {"Caló"},
["rms"] = {"Çhengey Chowree Romaanagh"},
["rmt"] = {"Domari"},
["rmu"] = {"Romanish Tavringagh"},
["rmv"] = {"Romanova"},
["rmw"] = {"Romanish Vretnagh"},
["rmx"] = {"Romam"},
["rmy"] = {"Romanish Vlax"},
["rmz"] = {"Marma"},
["rnb"] = {"Çhengey Chowree Brunca"},
["rnd"] = {"Ruund"},
["rng"] = {"Ronga"},
["rnl"] = {"Ranglong"},
["rnn"] = {"Roon"},
["rnp"] = {"Rongpo"},
["rnr"] = {"Nari Nari"},
["rnw"] = {"Rungwa"},
["roa"] = {"çhengaghyn Romansagh"},
["rob"] = {"Tae'"},
["roc"] = {"Cacgia Roglai"},
["rod"] = {"Rogo"},
["roe"] = {"Ronji"},
["rof"] = {"Rombo"},
["rog"] = {"Roglai Hwoaie"},
["rol"] = {"Romblomanon"},
["rom"] = {"Romanish"},
["roo"] = {"Rotokas"},
["rop"] = {"Kriol"},
["ror"] = {"Rongga"},
["rou"] = {"Runga"},
["row"] = {"Dela-Oenale"},
["rpn"] = {"Repanbitip"},
["rpt"] = {"Rapting"},
["rri"] = {"Ririo"},
["rro"] = {"Waima"},
["rrt"] = {"Arritinngithigh"},
["rsb"] = {"Serbish Romanagh"},
["rsk"] = {"Ruthenish", "Rusnak"},
["rsl"] = {"Çhengey Chowree Rooshagh"},
["rsm"] = {"Çhengey Chowree Miriwoong"},
["rsn"] = {"Çhengey Chowree Rooandagh"},
["rsw"] = {"Rishiwa"},
["rtc"] = {"Rungtu Chin"},
["rth"] = {"Ratahan"},
["rtm"] = {"Rotuman"},
["rts"] = {"Yuratsish"},
["rtw"] = {"Rathawi"},
["rub"] = {"Gungu"},
["ruc"] = {"Ruuli"},
["rue"] = {"Rusynish"},
["ruf"] = {"Luguru"},
["rug"] = {"Roviana"},
["ruh"] = {"Ruga"},
["rui"] = {"Rufiji"},
["ruk"] = {"Che"},
["ruo"] = {"Istro-Romaanish"},
["rup"] = {"Massado-Romaanish", "Aromaanish", "Arumaanish"},
["ruq"] = {"Megleno-Romaanish"},
["rut"] = {"Rutulish"},
["ruu"] = {"Lanas Lobu"},
["ruy"] = {"Mala (y Naigeer)"},
["ruz"] = {"Ruma"},
["rwa"] = {"Rawo"},
["rwk"] = {"Rwa"},
["rwl"] = {"Ruwila"},
["rwm"] = {"Amba (Oogandey)"},
["rwo"] = {"Rawa"},
["rwr"] = {"Marwari (yn Injey)"},
["rxd"] = {"Ngardi"},
["rxw"] = {"Karuwali", "Garuwali"},
["ryn"] = {"Amami-Oshima Hwoaie"},
["rys"] = {"Yaeyama"},
["ryu"] = {"Okinawish Veanagh"},
["rzh"] = {"Rāziḥī"},
["saa"] = {"Saba"},
["sab"] = {"Buglere"},
["sac"] = {"Meskwaki"},
["sad"] = {"Sandawe"},
["sae"] = {"Sabanê"},
["saf"] = {"Safaliba"},
["sah"] = {"Yakutish"},
["sai"] = {"çhengaghyn Injinagh Americaanagh Yiass"},
["saj"] = {"Sahu"},
["sak"] = {"Sake"},
["sal"] = {"çhengaghyn Salishanagh"},
["sam"] = {"Aramaaish Hamaaragh"},
["sao"] = {"Sause"},
["saq"] = {"Samburu"},
["sar"] = {"Saraveca"},
["sas"] = {"Sasak"},
["sat"] = {"Santali"},
["sau"] = {"Saleman"},
["sav"] = {"Saafi-Saafi"},
["saw"] = {"Sawi"},
["sax"] = {"Sa"},
["say"] = {"Saya"},
["saz"] = {"Saurashtra"},
["sba"] = {"Ngambay"},
["sbb"] = {"Simbo"},
["sbc"] = {"Kele (Papooey Guinea Noa)"},
["sbd"] = {"Samo Yiass"},
["sbe"] = {"Saliba"},
["sbf"] = {"Chabu", "Shabo"},
["sbg"] = {"Seget"},
["sbh"] = {"Sori-Harengan"},
["sbi"] = {"Seti"},
["sbj"] = {"Surbakhal"},
["sbk"] = {"Safwa"},
["sbl"] = {"Botolan Sambal"},
["sbm"] = {"Sagala"},
["sbn"] = {"Sindhi Bhil"},
["sbo"] = {"Sabüm"},
["sbp"] = {"Sangu (Tanzania)"},
["sbq"] = {"Sileibi"},
["sbr"] = {"Sembakung Murut"},
["sbs"] = {"Subiya"},
["sbt"] = {"Kimki"},
["sbu"] = {"Stod Bhoti"},
["sbv"] = {"Sabine"},
["sbw"] = {"Simba"},
["sbx"] = {"Seberuang"},
["sby"] = {"Soli"},
["sbz"] = {"Sara Kaba"},
["scb"] = {"Chut"},
["sce"] = {"Dongxiang"},
["scf"] = {"Creeole Frangish San Miguel"},
["scg"] = {"Sanggau"},
["sch"] = {"Sakachep"},
["sci"] = {"Creeole Malayish Sri Lanka"},
["sck"] = {"Sadri"},
["scl"] = {"Shina"},
["scn"] = {"Shisslish"},
["sco"] = {"Baarle Albinagh"},
["scp"] = {"Hyolmo", "Helambu Sherpa"},
["scq"] = {"Sa'och"},
["scs"] = {"Slavish Hwoaie"},
["sct"] = {"Katang Yiass"},
["scu"] = {"Shumcho"},
["scv"] = {"Sheni"},
["scw"] = {"Sha"},
["scx"] = {"Sicel"},
["sda"] = {"Toraja-Sa'dan"},
["sdb"] = {"Shabak"},
["sdc"] = {"Sardeenish Hassaragh"},
["sde"] = {"Surubu"},
["sdf"] = {"Sarli"},
["sdg"] = {"Savi"},
["sdh"] = {"Kurdish Yiass"},
["sdj"] = {"Suundi"},
["sdk"] = {"Sos Kundi"},
["sdl"] = {"Çhengey Chowree Arabagh Saudi"},
["sdn"] = {"Sardeenish Ghalluragh"},
["sdo"] = {"Bukar-Sadung Bidayuh"},
["sdp"] = {"Sherdukpen"},
["sdq"] = {"Semandang"},
["sdr"] = {"Oraon Sadri"},
["sds"] = {"Sened"},
["sdt"] = {"Shuadit"},
["sdu"] = {"Sarudu"},
["sdv"] = {"çhengaghyn Soodaanagh Hiar"},
["sdx"] = {"Sibu Melanau"},
["sdz"] = {"Sallands"},
["sea"] = {"Semai"},
["seb"] = {"Shempire Senoufo"},
["sec"] = {"Sechelt"},
["sed"] = {"Sedang"},
["see"] = {"Seneca"},
["sef"] = {"Cebaara Senoufo"},
["seg"] = {"Segeju"},
["seh"] = {"Sena"},
["sei"] = {"Seri"},
["sej"] = {"Sene"},
["sek"] = {"Sekani"},
["sel"] = {"Selkup"},
["sem"] = {"çhengaghyn Shemmagh"},
["sen"] = {"Nanerigé Sénoufo"},
["seo"] = {"Suarmin"},
["sep"] = {"Sìcìté Sénoufo"},
["seq"] = {"Senara Sénoufo"},
["ser"] = {"Serrano"},
["ses"] = {"Koyraboro Senni Songhai"},
["set"] = {"Sentani"},
["seu"] = {"Serui-Laut"},
["sev"] = {"Nyarafolo Senoufo"},
["sew"] = {"Sewa Bay"},
["sey"] = {"Secoya"},
["sez"] = {"Senthang Chin"},
["sfb"] = {"Langue des signes de Belgique Francophone", "Çhengey Chowree Rangee yn Velg"},
["sfe"] = {"Subanen Hiar"},
["sfm"] = {"Miaoish Veg-ornaidagh"},
["sfs"] = {"Çhengey Chowree yn Affrick Yiass"},
["sfw"] = {"Sehwi"},
["sga"] = {"Shenn Yernish (derrey 900)"},
["sgb"] = {"Mag-antsi Ayta"},
["sgc"] = {"Kipsigis"},
["sgd"] = {"Surigaonon"},
["sge"] = {"Segai"},
["sgg"] = {"Çhengey Chowree Ghermaanagh Elveeishagh"},
["sgh"] = {"Shughni"},
["sgi"] = {"Suga"},
["sgj"] = {"Surgujia"},
["sgk"] = {"Sangkong"},
["sgm"] = {"Singa"},
["sgn"] = {"Çhengaghyn cowree"},
["sgp"] = {"Singpho"},
["sgr"] = {"Sangisari"},
["sgs"] = {"Samogitish"},
["sgt"] = {"Brokpake"},
["sgu"] = {"Salas"},
["sgw"] = {"Sebat Bet Gurage"},
["sgx"] = {"Çhengey Chowree Sierra Leone"},
["sgy"] = {"Sanglechi"},
["sgz"] = {"Sursurunga"},
["sha"] = {"Shall-Zwall"},
["shb"] = {"Ninam"},
["shc"] = {"Sonde"},
["shd"] = {"Kundal Shahi"},
["she"] = {"Sheko"},
["shg"] = {"Shua"},
["shh"] = {"Shoshoni"},
["shi"] = {"Tachelhit"},
["shj"] = {"Shatt"},
["shk"] = {"Shilluk"},
["shl"] = {"Shendu"},
["shm"] = {"Shahrudi"},
["shn"] = {"Shan"},
["sho"] = {"Shanga"},
["shp"] = {"Shipibo-Conibo"},
["shq"] = {"Sala"},
["shr"] = {"Shi"},
["shs"] = {"Shuswap"},
["sht"] = {"Shasta"},
["shu"] = {"Arabish Hadagh"},
["shv"] = {"Shehri"},
["shw"] = {"Shwai"},
["shx"] = {"She"},
["shy"] = {"Tachawit"},
["shz"] = {"Syenara Senoufo"},
["sia"] = {"Saamish Akkala"},
["sib"] = {"Sebop"},
["sid"] = {"Sidamo"},
["sie"] = {"Simaa"},
["sif"] = {"Siamou"},
["sig"] = {"Paasaal"},
["sih"] = {"Zire", "Sîshëë"},
["sii"] = {"Shom Peng"},
["sij"] = {"Numbami"},
["sik"] = {"Sikiana"},
["sil"] = {"Tumulung Sisaala"},
["sim"] = {"Mende (Papooey Guinea Noa)"},
["sio"] = {"çhengaghyn Siouagh"},
["sip"] = {"Sikkimish"},
["siq"] = {"Sonia"},
["sir"] = {"Siri"},
["sis"] = {"Siuslaw"},
["sit"] = {"çhengaghyn Sheen-Tibetagh"},
["siu"] = {"Sinagen"},
["siv"] = {"Sumariup"},
["siw"] = {"Siwai"},
["six"] = {"Sumau"},
["siy"] = {"Sivandi"},
["siz"] = {"Siwi"},
["sja"] = {"Epena"},
["sjb"] = {"Sajau Basap"},
["sjd"] = {"Saamish Kildin"},
["sje"] = {"Saamish Pite"},
["sjg"] = {"Assangori"},
["sjk"] = {"Saamish Kemi"},
["sjl"] = {"Sajalong", "Miji"},
["sjm"] = {"Mapun"},
["sjn"] = {"Sindarin"},
["sjo"] = {"Xibe"},
["sjp"] = {"Surjapuri"},
["sjr"] = {"Siar-Lak"},
["sjs"] = {"Senhaja De Srair"},
["sjt"] = {"Saamish Ter"},
["sju"] = {"Saamish Ume"},
["sjw"] = {"Shawneeish"},
["ska"] = {"Skagit"},
["skb"] = {"Saek"},
["skc"] = {"Ma Manda"},
["skd"] = {"Miwokish Sierra Yiass"},
["ske"] = {"Seke (Vanuatu)"},
["skf"] = {"Sakirabiá"},
["skg"] = {"Malagasish Sakalava"},
["skh"] = {"Sikule"},
["ski"] = {"Sika"},
["skj"] = {"Seke (Nepaal)"},
["skm"] = {"Kutong"},
["skn"] = {"Kolibugan Subanon"},
["sko"] = {"Seko Tengah"},
["skp"] = {"Sekapan"},
["skq"] = {"Sininkere"},
["skr"] = {"Saraiki", "Seraiki"},
["sks"] = {"Maia"},
["skt"] = {"Sakata"},
["sku"] = {"Sakao"},
["skv"] = {"Skou"},
["skw"] = {"Creeole Ollanish Skepi"},
["skx"] = {"Seko Padang"},
["sky"] = {"Sikaiana"},
["skz"] = {"Sekar"},
["sla"] = {"çhengaghyn Slavagh"},
["slc"] = {"Sáliba"},
["sld"] = {"Sissala"},
["sle"] = {"Sholaga"},
["slf"] = {"Çhengey Chowree Iddaalagh Elveeishagh"},
["slg"] = {"Selungai Murut"},
["slh"] = {"Salish Yiass Puget Sound"},
["sli"] = {"Sileeshish Eeghtyragh"},
["slj"] = {"Salumá"},
["sll"] = {"Salt-Yui"},
["slm"] = {"Pangutaran Sama"},
["sln"] = {"Salinan"},
["slp"] = {"Lamaholot"},
["slr"] = {"Salar"},
["sls"] = {"Çhengey Chowree Singapore"},
["slt"] = {"Sila"},
["slu"] = {"Selaru"},
["slw"] = {"Sialum"},
["slx"] = {"Salampasu"},
["sly"] = {"Selayar"},
["slz"] = {"Ma'ya"},
["sma"] = {"Saamish Yiass"},
["smb"] = {"Simbari"},
["smc"] = {"Som"},
["smf"] = {"Auwe"},
["smg"] = {"Simbali"},
["smh"] = {"Samei"},
["smi"] = {"çhengaghyn Saamagh"},
["smj"] = {"Saamish Lule"},
["smk"] = {"Bolinao"},
["sml"] = {"Sama Veanagh"},
["smm"] = {"Musasa"},
["smn"] = {"Saamish Inari"},
["smp"] = {"Samaarish"},
["smq"] = {"Samo"},
["smr"] = {"Simeulue"},
["sms"] = {"Saamish Skolt"},
["smt"] = {"Simte"},
["smu"] = {"Somray"},
["smv"] = {"Samvedi"},
["smw"] = {"Sumbawa"},
["smx"] = {"Samba"},
["smy"] = {"Semnani"},
["smz"] = {"Simeku"},
["snc"] = {"Sinaugoro"},
["sne"] = {"Bau Bidayuh"},
["snf"] = {"Noon"},
["sng"] = {"Sanga (Pobblaght Gheynlagh y Chongo)"},
["sni"] = {"Sensi"},
["snj"] = {"Riverain Sango"},
["snk"] = {"Soninke"},
["snl"] = {"Sangil"},
["snm"] = {"Ma'di Yiass"},
["snn"] = {"Siona"},
["sno"] = {"Snohomish"},
["snp"] = {"Siane"},
["snq"] = {"Sangu (Gabon)"},
["snr"] = {"Sihan"},
["sns"] = {"South West Bay", "Nahavaq"},
["snu"] = {"Senggi", "Viid"},
["snv"] = {"Sa'ban"},
["snw"] = {"Selee"},
["snx"] = {"Sam"},
["sny"] = {"Saniyo-Hiyewe"},
["snz"] = {"Kou"},
["soa"] = {"Song Thai"},
["sob"] = {"Sobei"},
["soc"] = {"So (Pobblaght Gheynlagh y Chongo)"},
["sod"] = {"Songoora"},
["soe"] = {"Songomeno"},
["sog"] = {"Sogdish"},
["soh"] = {"Aka"},
["soi"] = {"Sonha"},
["soj"] = {"Soi"},
["sok"] = {"Sokoro"},
["sol"] = {"Solos"},
["son"] = {"çhengaghyn Songhai"},
["soo"] = {"Songo"},
["sop"] = {"Songe"},
["soq"] = {"Kanasi"},
["sor"] = {"Somrai"},
["sos"] = {"Seeku"},
["sou"] = {"Thai Yiass"},
["sov"] = {"Sonsorol"},
["sow"] = {"Sowanda"},
["sox"] = {"Swo"},
["soy"] = {"Miyobe"},
["soz"] = {"Temi"},
["spb"] = {"Sepa (yn Indoneesh)"},
["spc"] = {"Sapé"},
["spd"] = {"Saep"},
["spe"] = {"Sepa (Papooey Guinea Noa)"},
["spg"] = {"Sian"},
["spi"] = {"Saponi"},
["spk"] = {"Sengo"},
["spl"] = {"Selepet"},
["spm"] = {"Akukem"},
["spn"] = {"Sanapaná"},
["spo"] = {"Spokane"},
["spp"] = {"Supyire Senoufo"},
["spq"] = {"Spaainish Loreto-Ucayali"},
["spr"] = {"Saparua"},
["sps"] = {"Saposa"},
["spt"] = {"Spiti Bhoti"},
["spu"] = {"Sapuan"},
["spv"] = {"Sambalpuri", "Kosli"},
["spx"] = {"Picenish Yiass"},
["spy"] = {"Sabaot"},
["sqa"] = {"Shama-Sambuga"},
["sqh"] = {"Shau"},
["sqj"] = {"çhengaghyn Albaanagh"},
["sqk"] = {"Çhengey Chowree Albaanagh"},
["sqm"] = {"Suma"},
["sqn"] = {"Susquehannock"},
["sqo"] = {"Sorkhei"},
["sqq"] = {"Sou"},
["sqr"] = {"Arabish Hisslagh"},
["sqs"] = {"Çhengey Chowree Sri Lanka"},
["sqt"] = {"Soqotri"},
["squ"] = {"Squamish"},
["sqx"] = {"Çhengey Chowree Kufr Qassem (KQSL)"},
["sra"] = {"Saruga"},
["srb"] = {"Sora"},
["src"] = {"Sardeenish Logudoragh"},
["sre"] = {"Sara"},
["srf"] = {"Nafi"},
["srg"] = {"Sulod"},
["srh"] = {"Sarikoli"},
["sri"] = {"Siriano"},
["srk"] = {"Serudung Murut"},
["srl"] = {"Isirawa"},
["srm"] = {"Saramaccan"},
["srn"] = {"Sranan Tongo"},
["sro"] = {"Sardeenish Campidanagh"},
["srq"] = {"Sirionó"},
["srr"] = {"Serer"},
["srs"] = {"Sarsi"},
["srt"] = {"Sauri"},
["sru"] = {"Suruí"},
["srv"] = {"Sorsoganon Yiass"},
["srw"] = {"Serua"},
["srx"] = {"Sirmauri"},
["sry"] = {"Sera"},
["srz"] = {"Shahmirzadi"},
["ssa"] = {"çhengaghyn Neelagh-Saharagh"},
["ssb"] = {"Sama Yiass"},
["ssc"] = {"Suba-Simbiti"},
["ssd"] = {"Siroi"},
["sse"] = {"Balangingi", "Bangingih Sama"},
["ssf"] = {"Thao"},
["ssg"] = {"Seimat"},
["ssh"] = {"Arabish Shihhi"},
["ssi"] = {"Sansi"},
["ssj"] = {"Sausi"},
["ssk"] = {"Sunam"},
["ssl"] = {"Sisaala Heear"},
["ssm"] = {"Semnam"},
["ssn"] = {"Waata"},
["sso"] = {"Sissano"},
["ssp"] = {"Çhengey Chowree Spaainagh"},
["ssq"] = {"So'a"},
["ssr"] = {"Çhengey Chowree Rangagh Elveeishagh"},
["sss"] = {"Sô"},
["sst"] = {"Sinasina"},
["ssu"] = {"Susuami"},
["ssv"] = {"Shark Bay"},
["ssx"] = {"Samberigi"},
["ssy"] = {"Saho"},
["ssz"] = {"Sengseng"},
["sta"] = {"Settla"},
["stb"] = {"Subanen Hwoaie"},
["std"] = {"Sentinel"},
["ste"] = {"Liana-Seti"},
["stf"] = {"Seta"},
["stg"] = {"Trieng"},
["sth"] = {"Shelta"},
["sti"] = {"Bulo Stieng"},
["stj"] = {"Matya Samo"},
["stk"] = {"Arammba"},
["stl"] = {"Stellingwerfs"},
["stm"] = {"Setaman"},
["stn"] = {"Owa"},
["sto"] = {"Stonish"},
["stp"] = {"Tepehuan Hiar Yiass"},
["stq"] = {"Saterfriesisch"},
["str"] = {"Salish ny Keyllyssyn"},
["sts"] = {"Shumashti"},
["stt"] = {"Budeh Stieng"},
["stu"] = {"Samtao"},
["stv"] = {"Silt'e"},
["stw"] = {"Satawalish"},
["sty"] = {"Tatarish Hibbeyragh"},
["sua"] = {"Sulka"},
["sub"] = {"Suku"},
["suc"] = {"Subanon Heear"},
["sue"] = {"Suena"},
["sug"] = {"Suganga"},
["sui"] = {"Suki"},
["suj"] = {"Shubi"},
["suk"] = {"Sukuma"},
["suo"] = {"Bouni"},
["suq"] = {"Tirmaga-Chai Suri", "Suri"},
["sur"] = {"Mwaghavul"},
["sus"] = {"Susu"},
["sut"] = {"Subtiaba"},
["suv"] = {"Puroik"},
["suw"] = {"Sumbwa"},
["sux"] = {"Sumerish"},
["suy"] = {"Suyá"},
["suz"] = {"Sunwar"},
["sva"] = {"Svan"},
["svb"] = {"Ulau-Suain"},
["svc"] = {"Creeole Baarle Winsenagh"},
["sve"] = {"Serili"},
["svk"] = {"Çhengey Chowree Slovackagh"},
["svm"] = {"Slavomolisano"},
["svs"] = {"Savosavo"},
["svx"] = {"Skalvish"},
["swb"] = {"Comoroish Maore"},
["swc"] = {"Swahili yn Chongo"},
["swf"] = {"Sere"},
["swg"] = {"Swabish"},
["swh"] = {"Swahili (çhengey er lheh)", "Kiswahili"},
["swi"] = {"Sui"},
["swj"] = {"Sira"},
["swk"] = {"Malawi Sena"},
["swl"] = {"Çhengey Chowree Hoolynnagh"},
["swm"] = {"Samosa"},
["swn"] = {"Sawknah"},
["swo"] = {"Shanenawa"},
["swp"] = {"Suau"},
["swq"] = {"Sharwa"},
["swr"] = {"Saweru"},
["sws"] = {"Seluwasan"},
["swt"] = {"Sawila"},
["swu"] = {"Suwawa"},
["swv"] = {"Shekhawati"},
["sww"] = {"Sowa"},
["swx"] = {"Suruahá"},
["swy"] = {"Sarua"},
["sxb"] = {"Suba"},
["sxc"] = {"Sicanish"},
["sxe"] = {"Sighu"},
["sxg"] = {"Shuhi", "Shixing"},
["sxk"] = {"Kalapuya Yiass"},
["sxl"] = {"Selian"},
["sxm"] = {"Samre"},
["sxn"] = {"Sangir"},
["sxo"] = {"Sorothaptish"},
["sxr"] = {"Saaroa"},
["sxs"] = {"Sasaru"},
["sxu"] = {"Saxonish Eaghtyragh"},
["sxw"] = {"Saxwe Gbe"},
["sya"] = {"Siang"},
["syb"] = {"Subanen Veanagh"},
["syc"] = {"Seerish Chlassicagh"},
["syd"] = {"çhengaghyn Samoyedagh"},
["syi"] = {"Seki"},
["syk"] = {"Sukur"},
["syl"] = {"Sylheti"},
["sym"] = {"Maya Samo"},
["syn"] = {"Senaya"},
["syo"] = {"Suoy"},
["syr"] = {"Seerish"},
["sys"] = {"Sinyar"},
["syw"] = {"Kagate"},
["syx"] = {"Samay"},
["syy"] = {"Çhengey Chowree ny Bedouin Al-Sayyid"},
["sza"] = {"Semelai"},
["szb"] = {"Ngalum"},
["szc"] = {"Semaq Beri"},
["sze"] = {"Seze"},
["szg"] = {"Sengele"},
["szl"] = {"Sileeshish"},
["szn"] = {"Sula"},
["szp"] = {"Suabo"},
["szs"] = {"Çhengey Chowree Ellanyn Solomon"},
["szv"] = {"Isu (Rheynn Fako)"},
["szw"] = {"Sawai"},
["szy"] = {"Sakizaya"},
["taa"] = {"Tanana Eeghtyragh"},
["tab"] = {"Tabassaranish"},
["tac"] = {"Tarahumara Injil"},
["tad"] = {"Tause"},
["tae"] = {"Tariana"},
["taf"] = {"Tapirapé"},
["tag"] = {"Tagoi"},
["tai"] = {"çhengaghyn Tai"},
["taj"] = {"Tamang Hiar"},
["tak"] = {"Tala"},
["tal"] = {"Tal"},
["tan"] = {"Tangale"},
["tao"] = {"Yami"},
["tap"] = {"Taabwa"},
["taq"] = {"Tamasheq"},
["tar"] = {"Tarahumara Veanagh"},
["tas"] = {"Tay Boi"},
["tau"] = {"Tanana Eaghtyragh"},
["tav"] = {"Tatuyo"},
["taw"] = {"Tai"},
["tax"] = {"Tamki"},
["tay"] = {"Atayal"},
["taz"] = {"Tocho"},
["tba"] = {"Aikanã"},
["tbc"] = {"Takia"},
["tbd"] = {"Kaki Ae"},
["tbe"] = {"Tanimbili"},
["tbf"] = {"Mandara"},
["tbg"] = {"Tairora Hwoaie"},
["tbh"] = {"Dharawal", "Thurawal"},
["tbi"] = {"Gaam"},
["tbj"] = {"Tiang"},
["tbk"] = {"Calamian Tagbanwa"},
["tbl"] = {"Tboli"},
["tbm"] = {"Tagbu"},
["tbn"] = {"Barro Negro Tunebo"},
["tbo"] = {"Tawala"},
["tbp"] = {"Taworta", "Diebroud"},
["tbq"] = {"çhengaghyn Tibetagh-Burmagh"},
["tbr"] = {"Tumtum"},
["tbs"] = {"Tanguat"},
["tbt"] = {"Tembo (Kitembo)"},
["tbu"] = {"Tubar"},
["tbv"] = {"Tobo"},
["tbw"] = {"Tagbanwa"},
["tbx"] = {"Kapin"},
["tby"] = {"Tabaru"},
["tbz"] = {"Ditammari"},
["tca"] = {"Ticuna"},
["tcb"] = {"Tanacross"},
["tcc"] = {"Datooga"},
["tcd"] = {"Tafi"},
["tce"] = {"Tutchone Yiass"},
["tcf"] = {"Malinaltepec Me'phaa", "Malinaltepec Tlapanec"},
["tcg"] = {"Tamagario"},
["tch"] = {"Creeole Baarle ny Turkee as Caicos"},
["tci"] = {"Wára"},
["tck"] = {"Tchitchege"},
["tcl"] = {"Taman (Myanmar)"},
["tcm"] = {"Tanahmerah"},
["tcn"] = {"Tichurong"},
["tco"] = {"Taungyo"},
["tcp"] = {"Tawr Chin"},
["tcq"] = {"Kaiy"},
["tcs"] = {"Creeole Keyllys Torres", "Yumplatok"},
["tct"] = {"T'en"},
["tcu"] = {"Tarahumara Hiar Yiass"},
["tcw"] = {"Totonac Tecpatlán"},
["tcx"] = {"Toda"},
["tcy"] = {"Tulu"},
["tcz"] = {"Chinish Thado"},
["tda"] = {"Tagdal"},
["tdb"] = {"Panchpargania"},
["tdc"] = {"Emberá-Tadó"},
["tdd"] = {"Tai Nüa"},
["tde"] = {"Tiranige Diga Dogon"},
["tdf"] = {"Talieng"},
["tdg"] = {"Tamang Heear"},
["tdh"] = {"Thulung"},
["tdi"] = {"Tomadino"},
["tdj"] = {"Tajio"},
["tdk"] = {"Tambas"},
["tdl"] = {"Sur"},
["tdm"] = {"Taruma"},
["tdn"] = {"Tondano"},
["tdo"] = {"Teme"},
["tdq"] = {"Tita"},
["tdr"] = {"Todrah"},
["tds"] = {"Doutai"},
["tdt"] = {"Tetun Dili"},
["tdv"] = {"Toro"},
["tdx"] = {"Malagasish Tandroy-Mahafaly"},
["tdy"] = {"Tadyawan"},
["tea"] = {"Temiar"},
["teb"] = {"Tetete"},
["tec"] = {"Terik"},
["ted"] = {"Tepo Krumen"},
["tee"] = {"Huehuetla Tepehua"},
["tef"] = {"Teressa"},
["teg"] = {"Teke-Tege"},
["teh"] = {"Tehuelçhish"},
["tei"] = {"Torricelli"},
["tek"] = {"Ibali Teke"},
["tem"] = {"Timne"},
["ten"] = {"Tama (y Cholombey)"},
["teo"] = {"Teso"},
["tep"] = {"Tepecano"},
["teq"] = {"Temein"},
["ter"] = {"Tereno"},
["tes"] = {"Tengger"},
["tet"] = {"Tetum"},
["teu"] = {"Soo"},
["tev"] = {"Teor"},
["tew"] = {"Tewa (SUA)"},
["tex"] = {"Tennet"},
["tey"] = {"Tulishi"},
["tez"] = {"Tetserret"},
["tfi"] = {"Tofin Gbe"},
["tfn"] = {"Tanaina"},
["tfo"] = {"Tefaro"},
["tfr"] = {"Teribe"},
["tft"] = {"Ternate"},
["tga"] = {"Sagalla"},
["tgb"] = {"Tobilung"},
["tgc"] = {"Tigak"},
["tgd"] = {"Ciwogai"},
["tge"] = {"Tamang Hiar Gorkha"},
["tgf"] = {"Chalikha"},
["tgh"] = {"Creeole Baarle Tobago"},
["tgi"] = {"Lawunuia"},
["tgj"] = {"Tagin"},
["tgn"] = {"Tandaganon"},
["tgo"] = {"Sudest"},
["tgp"] = {"Tangoa"},
["tgq"] = {"Tring"},
["tgr"] = {"Tareng"},
["tgs"] = {"Nume"},
["tgt"] = {"Tagbanwa Veanagh"},
["tgu"] = {"Tanggu"},
["tgv"] = {"Tingui-Boto"},
["tgw"] = {"Tagwana Senoufo"},
["tgx"] = {"Tagish"},
["tgy"] = {"Togoyo"},
["tgz"] = {"Tagalaka"},
["thd"] = {"Kuuk Thaayorre", "Thayore"},
["the"] = {"Chitwania Tharu"},
["thf"] = {"Thangmi"},
["thh"] = {"Tarahumara Hwoaie"},
["thi"] = {"Tai Long"},
["thk"] = {"Tharaka", "Kitharaka"},
["thl"] = {"Dangaura Tharu"},
["thm"] = {"Aheu"},
["thn"] = {"Thachanadan"},
["thp"] = {"Thompson"},
["thq"] = {"Kochila Tharu"},
["thr"] = {"Rana Tharu"},
["ths"] = {"Thakali"},
["tht"] = {"Tahltan"},
["thu"] = {"Thuri"},
["thv"] = {"Tahaggart Tamahaq"},
["thy"] = {"Tha"},
["thz"] = {"Tayart Tamajeq"},
["tia"] = {"Tamazight Tidikelt"},
["tic"] = {"Tira"},
["tif"] = {"Tifal"},
["tig"] = {"Tigre"},
["tih"] = {"Timugon Murut"},
["tii"] = {"Tiene"},
["tij"] = {"Tilung"},
["tik"] = {"Tikar"},
["til"] = {"Tillamook"},
["tim"] = {"Timbe"},
["tin"] = {"Tindi"},
["tio"] = {"Teop"},
["tip"] = {"Trimuris"},
["tiq"] = {"Tiéfo"},
["tis"] = {"Masadiit Itneg"},
["tit"] = {"Tinigua"},
["tiu"] = {"Adasen"},
["tiv"] = {"Tiv"},
["tiw"] = {"Tiwi"},
["tix"] = {"Tiwa Yiass"},
["tiy"] = {"Tiruray"},
["tiz"] = {"Tai Hongjin"},
["tja"] = {"Tajuasohn"},
["tjg"] = {"Tunjung"},
["tji"] = {"Tujia Hwoaie"},
["tjj"] = {"Tjungundji"},
["tjl"] = {"Tai Laing"},
["tjm"] = {"Timucua"},
["tjn"] = {"Tonjon"},
["tjo"] = {"Tamazight Témacine"},
["tjp"] = {"Tjupany"},
["tjs"] = {"Tujia Yiass"},
["tju"] = {"Tjurruru"},
["tjw"] = {"Djabwurrung"},
["tka"] = {"Truká"},
["tkb"] = {"Buksa"},
["tkd"] = {"Tukudede"},
["tke"] = {"Takwane"},
["tkf"] = {"Tukumanféd"},
["tkg"] = {"Malagasish Tesaka"},
["tkl"] = {"Tokelauish"},
["tkm"] = {"Takelma"},
["tkn"] = {"Toku-No-Shima"},
["tkp"] = {"Tikopia"},
["tkq"] = {"Tee"},
["tkr"] = {"Tsakhurish"},
["tks"] = {"Takestaanish"},
["tkt"] = {"Kathoriya Tharu"},
["tku"] = {"Totonac Necaxa Heose"},
["tkv"] = {"Mur Pano"},
["tkw"] = {"Teanu"},
["tkx"] = {"Tangko"},
["tkz"] = {"Takua"},
["tla"] = {"Tepehuan Heear Yiass"},
["tlb"] = {"Tobelo"},
["tlc"] = {"Totonac Yecuatla"},
["tld"] = {"Talaud"},
["tlf"] = {"Telefol"},
["tlg"] = {"Tofanma"},
["tlh"] = {"Klingon", "tlhIngan Hol"},
["tli"] = {"Tlingit"},
["tlj"] = {"Talinga-Bwisi"},
["tlk"] = {"Taloki"},
["tll"] = {"Tetela"},
["tlm"] = {"Tolomako"},
["tln"] = {"Talondo'"},
["tlo"] = {"Talodi"},
["tlp"] = {"Totonac Filomena Mata-Coahuitlán"},
["tlq"] = {"Tai Loi"},
["tlr"] = {"Talise"},
["tls"] = {"Tambotalo"},
["tlt"] = {"Sou Nama", "Teluti"},
["tlu"] = {"Tulehu"},
["tlv"] = {"Taliabu"},
["tlx"] = {"Khehek"},
["tly"] = {"Talysh"},
["tma"] = {"Tama (Shad)"},
["tmb"] = {"Katbol", "Avava"},
["tmc"] = {"Tumak"},
["tmd"] = {"Haruai"},
["tme"] = {"Tremembé"},
["tmf"] = {"Toba-Maskoy"},
["tmg"] = {"Ternateño"},
["tmh"] = {"Tamashek"},
["tmi"] = {"Tutuba"},
["tmj"] = {"Samarokena"},
["tml"] = {"Tamnim Citak"},
["tmm"] = {"Tai Thanh"},
["tmn"] = {"Taman (yn Indoneesh)"},
["tmo"] = {"Temoq"},
["tmq"] = {"Tumleo"},
["tmr"] = {"Aramaaish Vabylonagh Ewagh (ca. 200-1200 BNJ)"},
["tms"] = {"Tima"},
["tmt"] = {"Tasmate"},
["tmu"] = {"Iau"},
["tmv"] = {"Tembo (Motembo)"},
["tmw"] = {"Temuan"},
["tmy"] = {"Tami"},
["tmz"] = {"Tamanaku"},
["tna"] = {"Tacana"},
["tnb"] = {"Tunebo Heear"},
["tnc"] = {"Tanimuca-Retuarã"},
["tnd"] = {"Angosturas Tunebo"},
["tng"] = {"Tobanga"},
["tnh"] = {"Maiani"},
["tni"] = {"Tandia"},
["tnk"] = {"Kwamera"},
["tnl"] = {"Lenakel"},
["tnm"] = {"Tabla"},
["tnn"] = {"Tanna Hwoaie"},
["tno"] = {"Toromono"},
["tnp"] = {"Whitesands"},
["tnq"] = {"Taino"},
["tnr"] = {"Ménik"},
["tns"] = {"Tenis"},
["tnt"] = {"Tontemboan"},
["tnu"] = {"Tay Khang"},
["tnv"] = {"Tangchangya"},
["tnw"] = {"Tonsawang"},
["tnx"] = {"Tanema"},
["tny"] = {"Tongwe"},
["tnz"] = {"Ten'edn"},
["tob"] = {"Toba"},
["toc"] = {"Totonac Coyutla"},
["tod"] = {"Toma"},
["tof"] = {"Gizrra"},
["tog"] = {"Tonga (Nyasa)"},
["toh"] = {"Gitonga"},
["toi"] = {"Tonga (y Tambia)"},
["toj"] = {"Tojolabal"},
["tok"] = {"Toki Pona"},
["tol"] = {"Tolowa"},
["tom"] = {"Tombulu"},
["too"] = {"Totonac Xicotepec De Juárez"},
["top"] = {"Totonac Papantla"},
["toq"] = {"Toposa"},
["tor"] = {"Togbo-Vara Banda"},
["tos"] = {"Totonac Sleitoil"},
["tou"] = {"Tho"},
["tov"] = {"Taromi Eaghtyragh"},
["tow"] = {"Jemez"},
["tox"] = {"Tobian"},
["toy"] = {"Topoiyo"},
["toz"] = {"To"},
["tpa"] = {"Taupota"},
["tpc"] = {"Me'phaa Azoyú", "Tlapanec Azoyú"},
["tpe"] = {"Tippera"},
["tpf"] = {"Tarpia"},
["tpg"] = {"Kula"},
["tpi"] = {"Tok Pisin"},
["tpj"] = {"Tapieté"},
["tpk"] = {"Tupinikin"},
["tpl"] = {"Me'phaa Tlacoapa", "Tlapanec Tlacoapa"},
["tpm"] = {"Tampulma"},
["tpn"] = {"Tupinambá"},
["tpo"] = {"Tai Pao"},
["tpp"] = {"Tepehua Pisaflores"},
["tpq"] = {"Tukpa"},
["tpr"] = {"Tuparí"},
["tpt"] = {"Tepehua Tlachichilco"},
["tpu"] = {"Tampuan"},
["tpv"] = {"Tanapag"},
["tpx"] = {"Me'phaa Acatepec", "Tlapanec Acatepec"},
["tpy"] = {"Trumai"},
["tpz"] = {"Tinputz"},
["tqb"] = {"Tembé"},
["tql"] = {"Lehali"},
["tqm"] = {"Turumsa"},
["tqn"] = {"Tenino"},
["tqo"] = {"Toaripi"},
["tqp"] = {"Tomoip"},
["tqq"] = {"Tunni"},
["tqr"] = {"Torona"},
["tqt"] = {"Totonac Heear"},
["tqu"] = {"Touo"},
["tqw"] = {"Tonkawa"},
["tra"] = {"Tirahi"},
["trb"] = {"Terebu"},
["trc"] = {"Copala Triqui"},
["trd"] = {"Turi"},
["tre"] = {"Tarangan Hiar"},
["trf"] = {"Creeole Baarle Trinaidagh"},
["trg"] = {"Lishán Didán"},
["trh"] = {"Turaka"},
["tri"] = {"Trió"},
["trj"] = {"Toram"},
["trk"] = {"çhengaghyn Turkagh"},
["trl"] = {"Albinish Romanagh"},
["trm"] = {"Tregami"},
["trn"] = {"Trinitario"},
["tro"] = {"Tarao Naga"},
["trp"] = {"Kok Borok"},
["trq"] = {"Triqui San Martín Itunyoso"},
["trr"] = {"Taushiro"},
["trs"] = {"Triqui Chicahuaxtla"},
["trt"] = {"Tunggare"},
["tru"] = {"Turoyo", "Surayt"},
["trv"] = {"Sediq", "Seediq", "Taroko"},
["trw"] = {"Torwali"},
["trx"] = {"Bidayuh Tringgus-Sembaan"},
["try"] = {"Turung"},
["trz"] = {"Torá"},
["tsa"] = {"Tsaangi"},
["tsb"] = {"Tsamai"},
["tsc"] = {"Tswa"},
["tsd"] = {"Tsakonish"},
["tse"] = {"Çhengey Chowree Hooneeshagh"},
["tsg"] = {"Tausug"},
["tsh"] = {"Tsuvan"},
["tsi"] = {"Tsimshian"},
["tsj"] = {"Tshangla"},
["tsk"] = {"Tseku"},
["tsl"] = {"Ts'ün-Lao"},
["tsm"] = {"Çhengey Chowree Hurkagh", "Türk İşaret Dili"},
["tsp"] = {"Tusya Hwoaie"},
["tsq"] = {"Çhengey Chowree Thai"},
["tsr"] = {"Akei"},
["tss"] = {"Çhengey Chowree Haiwaanagh"},
["tst"] = {"Tondi Songway Kiini"},
["tsu"] = {"Tsou"},
["tsv"] = {"Tsogo"},
["tsw"] = {"Tsishingini"},
["tsx"] = {"Mubami"},
["tsy"] = {"Çhengey Chowree Tebul"},
["tsz"] = {"Purepecha"},
["tta"] = {"Tutelo"},
["ttb"] = {"Gaa"},
["ttc"] = {"Tektiteko"},
["ttd"] = {"Tauade"},
["tte"] = {"Bwanabwana"},
["ttf"] = {"Tuotomb"},
["ttg"] = {"Tutong"},
["tth"] = {"Ta'oih Heose"},
["tti"] = {"Tobati"},
["ttj"] = {"Tooro"},
["ttk"] = {"Totoro"},
["ttl"] = {"Totela"},
["ttm"] = {"Tutchone Hwoaie"},
["ttn"] = {"Towei"},
["tto"] = {"Ta'oih Injil"},
["ttp"] = {"Tombelala"},
["ttq"] = {"Tamajaq Tawallammat"},
["ttr"] = {"Tera"},
["tts"] = {"Thai Hiar Hwoaie"},
["ttt"] = {"Tatish Voslymagh"},
["ttu"] = {"Torau"},
["ttv"] = {"Titan"},
["ttw"] = {"Long Wat"},
["tty"] = {"Sikaritai"},
["ttz"] = {"Tsum"},
["tua"] = {"Wiarumus"},
["tub"] = {"Tübatulabal"},
["tuc"] = {"Mutu"},
["tud"] = {"Tuxá"},
["tue"] = {"Tuyuca"},
["tuf"] = {"Tunebo Veanagh"},
["tug"] = {"Tunia"},
["tuh"] = {"Taulil"},
["tui"] = {"Tupuri"},
["tuj"] = {"Tugutil"},
["tul"] = {"Tula"},
["tum"] = {"Tumbukish"},
["tun"] = {"Tunica"},
["tuo"] = {"Tucano"},
["tup"] = {"çhengaghyn Tupi"},
["tuq"] = {"Tedaga"},
["tus"] = {"Tuscarora"},
["tut"] = {"çhengaghyn Altaiagh"},
["tuu"] = {"Tututni"},
["tuv"] = {"Turkana"},
["tuw"] = {"çhengaghyn Tungusagh"},
["tux"] = {"Tuxináwa"},
["tuy"] = {"Tugen"},
["tuz"] = {"Turka"},
["tva"] = {"Vaghua"},
["tvd"] = {"Tsuvadi"},
["tve"] = {"Te'un"},
["tvi"] = {"Tulai"},
["tvk"] = {"Ambrym Hiar Yiass"},
["tvl"] = {"Tuvalu"},
["tvm"] = {"Tela-Masbuar"},
["tvn"] = {"Tavoyan"},
["tvo"] = {"Tidore"},
["tvs"] = {"Taveta"},
["tvt"] = {"Naga Tutsa"},
["tvu"] = {"Tunen"},
["tvw"] = {"Sedoa"},
["tvx"] = {"Taivoan"},
["tvy"] = {"Timorish Vrisht"},
["twa"] = {"Twana"},
["twb"] = {"Tawbuid Heear"},
["twc"] = {"Teshenawa"},
["twd"] = {"Twents"},
["twe"] = {"Tewa (yn Indoneesh)"},
["twf"] = {"Tiwa Hwoaie"},
["twg"] = {"Tereweng"},
["twh"] = {"Tai Dón"},
["twl"] = {"Tawara"},
["twm"] = {"Tawang Monpa"},
["twn"] = {"Twendi"},
["two"] = {"Tswapong"},
["twp"] = {"Ere"},
["twq"] = {"Tasawaq"},
["twr"] = {"Tarahumara Heear Yiass"},
["twt"] = {"Turiwára"},
["twu"] = {"Termanu"},
["tww"] = {"Tuwari"},
["twx"] = {"Tewe"},
["twy"] = {"Tawoyan"},
["txa"] = {"Tombonuo"},
["txb"] = {"Tokharish B"},
["txc"] = {"Tsetsaut"},
["txe"] = {"Totoli"},
["txg"] = {"Tangut"},
["txh"] = {"Thrackish"},
["txi"] = {"Ikpeng"},
["txj"] = {"Tarjumo"},
["txm"] = {"Tomini"},
["txn"] = {"Tarangan Heear"},
["txo"] = {"Toto"},
["txq"] = {"Tii"},
["txr"] = {"Tartessish"},
["txs"] = {"Tonsea"},
["txt"] = {"Citak"},
["txu"] = {"Kayapó"},
["txx"] = {"Tatana"},
["txy"] = {"Malagasish Tanosy"},
["tya"] = {"Tauya"},
["tye"] = {"Kyanga"},
["tyh"] = {"O'du"},
["tyi"] = {"Teke-Tsaayi"},
["tyj"] = {"Tai Do", "Tai Yo"},
["tyl"] = {"Thu Lao"},
["tyn"] = {"Kombai"},
["typ"] = {"Thaypan"},
["tyr"] = {"Tai Daeng"},
["tys"] = {"Tày Sa Pa"},
["tyt"] = {"Tày Tac"},
["tyu"] = {"Kua"},
["tyv"] = {"Tuvish"},
["tyx"] = {"Teke-Tyee"},
["tyy"] = {"Tiyaa"},
["tyz"] = {"Tày"},
["tza"] = {"Çhengey Chowree Tanzania"},
["tzh"] = {"Tzeltal"},
["tzj"] = {"Tz'utujil"},
["tzl"] = {"Talossan"},
["tzm"] = {"Tamazight Atlas Veanagh"},
["tzn"] = {"Tugun"},
["tzo"] = {"Tzotzil"},
["tzx"] = {"Tabriak"},
["uam"] = {"Uamué"},
["uan"] = {"Kuan"},
["uar"] = {"Tairuma"},
["uba"] = {"Ubang"},
["ubi"] = {"Ubi"},
["ubl"] = {"Buhi'non Bikol"},
["ubr"] = {"Ubir"},
["ubu"] = {"Umbu-Ungu"},
["uby"] = {"Ubykhish"},
["uda"] = {"Uda"},
["ude"] = {"Udihe"},
["udg"] = {"Muduga"},
["udi"] = {"Udi"},
["udj"] = {"Ujir"},
["udl"] = {"Wuzlam"},
["udm"] = {"Udmurtish"},
["udu"] = {"Uduk"},
["ues"] = {"Kioko"},
["ufi"] = {"Ufim"},
["uga"] = {"Oogaritish"},
["ugb"] = {"Kuku-Ugbanh"},
["uge"] = {"Ughele"},
["ugh"] = {"Kubachi"},
["ugn"] = {"Çhengey Chowree Oogandagh"},
["ugo"] = {"Ugong"},
["ugy"] = {"Çhengey Chowree Ooraguayagh"},
["uha"] = {"Uhami"},
["uhn"] = {"Damal"},
["uis"] = {"Uisai"},
["uiv"] = {"Iyive"},
["uji"] = {"Tanjijili"},
["uka"] = {"Kaburi"},
["ukg"] = {"Ukuriguma"},
["ukh"] = {"Ukhwejo"},
["uki"] = {"Kui (yn Injey)"},
["ukk"] = {"Muak Sa-aak"},
["ukl"] = {"Çhengey Chowree Ookraanagh"},
["ukp"] = {"Ukpe-Bayobiri"},
["ukq"] = {"Ukwa"},
["uks"] = {"Çhengey Chowree Urubú-Kaapor", "Çhengey Chowree Kaapor"},
["uku"] = {"Ukue"},
["ukv"] = {"Kuku"},
["ukw"] = {"Ukwuani-Aboh-Ndoni"},
["uky"] = {"Kuuk-Yak"},
["ula"] = {"Fungwa"},
["ulb"] = {"Ulukwumi"},
["ulc"] = {"Ulch"},
["ule"] = {"Lule"},
["ulf"] = {"Usku", "Afra"},
["uli"] = {"Ulithish"},
["ulk"] = {"Meriam Mir"},
["ull"] = {"Ullatan"},
["ulm"] = {"Ulumanda'"},
["uln"] = {"Unserdeutsch"},
["ulu"] = {"Uma' Lung"},
["ulw"] = {"Ulwa"},
["uly"] = {"Buli"},
["uma"] = {"Umatilla"},
["umb"] = {"Umbundu"},
["umc"] = {"Marrucinish"},
["umd"] = {"Umbindhamu"},
["umg"] = {"Morrobalama", "Umbuygamu"},
["umi"] = {"Ukit"},
["umm"] = {"Umon"},
["umn"] = {"Makyan Naga"},
["umo"] = {"Umotína"},
["ump"] = {"Umpila"},
["umr"] = {"Umbugarla"},
["ums"] = {"Pendau"},
["umu"] = {"Munsee"},
["una"] = {"Watut Hwoaie"},
["und"] = {"Neuoolit"},
["une"] = {"Uneme"},
["ung"] = {"Ngarinyin"},
["uni"] = {"Uni"},
["unk"] = {"Enawené-Nawé"},
["unm"] = {"Unami"},
["unn"] = {"Kurnai"},
["unr"] = {"Mundari"},
["unu"] = {"Unubahe"},
["unx"] = {"Munda"},
["unz"] = {"Unde Kaili"},
["uon"] = {"Kulon"},
["upi"] = {"Umeda"},
["upv"] = {"Uripiv-Wala-Rano-Atchin"},
["ura"] = {"Urarina"},
["urb"] = {"Urubú-Kaapor", "Kaapor"},
["urc"] = {"Urningangg"},
["ure"] = {"Uru"},
["urf"] = {"Uradhi"},
["urg"] = {"Urigina"},
["urh"] = {"Urhobo"},
["uri"] = {"Urim"},
["urj"] = {"çhengaghyn Ooralagh"},
["urk"] = {"Urak Lawoi'"},
["url"] = {"Urali"},
["urm"] = {"Urapmin"},
["urn"] = {"Uruangnirin"},
["uro"] = {"Ura (Papooey Guinea Noa)"},
["urp"] = {"Uru-Pa-In"},
["urr"] = {"Lehalurup", "Löyöp"},
["urt"] = {"Urat"},
["uru"] = {"Urumi"},
["urv"] = {"Uruava"},
["urw"] = {"Sop"},
["urx"] = {"Urimo"},
["ury"] = {"Orya"},
["urz"] = {"Uru-Eu-Wau-Wau"},
["usa"] = {"Usarufa"},
["ush"] = {"Ushojo"},
["usi"] = {"Usui"},
["usk"] = {"Usaghade"},
["usp"] = {"Uspanteco"},
["uss"] = {"us-Saare"},
["usu"] = {"Uya"},
["uta"] = {"Otank"},
["ute"] = {"Ute-Paiute Yiass"},
["uth"] = {"ut-Hun"},
["utp"] = {"Amba (Ellanyn Solomon)"},
["utr"] = {"Etulo"},
["utu"] = {"Utu"},
["uum"] = {"Urum"},
["uur"] = {"Ura (Vanuatu)"},
["uuu"] = {"U"},
["uve"] = {"Uveish Heear", "Fagauvea"},
["uvh"] = {"Uri"},
["uvl"] = {"Lote"},
["uwa"] = {"Kuku-Uwanh"},
["uya"] = {"Doko-Uyanga"},
["uzn"] = {"Oosbeckish Hwoaie"},
["uzs"] = {"Oosbeckish Yiass"},
["vaa"] = {"Vaagri Booli"},
["vae"] = {"Vale"},
["vaf"] = {"Vafsi"},
["vag"] = {"Vagla"},
["vah"] = {"Varhadi-Nagpuri"},
["vai"] = {"Vai"},
["vaj"] = {"Sekele", "ǃKung Heear Hwoaie", "Vasekele"},
["val"] = {"Vehes"},
["vam"] = {"Vanimo"},
["van"] = {"Valman"},
["vao"] = {"Vao"},
["vap"] = {"Vaiphei"},
["var"] = {"Huarijio"},
["vas"] = {"Vasavi"},
["vau"] = {"Vanuma"},
["vav"] = {"Varli"},
["vay"] = {"Wayu"},
["vbb"] = {"Babar Hiar Yiass"},
["vbk"] = {"Bontok Heear Yiass"},
["vec"] = {"Veneeshish"},
["ved"] = {"Veddah"},
["vel"] = {"Veluws"},
["vem"] = {"Vemgo-Mabas"},
["veo"] = {"Ventureño"},
["vep"] = {"Vepsish"},
["ver"] = {"Mom Jango"},
["vgr"] = {"Vaghri"},
["vgt"] = {"Vlaamse Gebarentaal", "Çhengey Chowree Landrynagh"},
["vic"] = {"Creeole Baarle Ellanyn y Voidyn"},
["vid"] = {"Vidunda"},
["vif"] = {"Vili"},
["vig"] = {"Viemo"},
["vil"] = {"Vilela"},
["vin"] = {"Vinza"},
["vis"] = {"Vishavan"},
["vit"] = {"Viti"},
["viv"] = {"Iduna"},
["vjk"] = {"Bajjika"},
["vka"] = {"Kariyarra"},
["vkj"] = {"Kujarge"},
["vkk"] = {"Kaur"},
["vkl"] = {"Kulisusu"},
["vkm"] = {"Kamakan"},
["vkn"] = {"Koro Nulu"},
["vko"] = {"Kodeoha"},
["vkp"] = {"Creeole Portiugish Korlai"},
["vkt"] = {"Malayish Tenggarong Kutai"},
["vku"] = {"Kurrama"},
["vkz"] = {"Koro Zuba"},
["vlp"] = {"Valpei"},
["vls"] = {"Vlaams"},
["vma"] = {"Martuyhunira"},
["vmb"] = {"Barbaram"},
["vmc"] = {"Mixtecish Juxtlahuaca"},
["vmd"] = {"Mudu Koraga"},
["vme"] = {"Masela Hiar"},
["vmf"] = {"Mainfränkisch"},
["vmg"] = {"Lungalunga"},
["vmh"] = {"Maraghei"},
["vmi"] = {"Miwa"},
["vmj"] = {"Mixtecish Ixtayutla"},
["vmk"] = {"Makhuwa-Shirima"},
["vml"] = {"Malgana"},
["vmm"] = {"Mixtecish Mitlatongo"},
["vmp"] = {"Mazatec Soyaltepec"},
["vmq"] = {"Mixtecish Soyaltepec"},
["vmr"] = {"Marenje"},
["vms"] = {"Moksela"},
["vmu"] = {"Muluridyi"},
["vmv"] = {"Maidu Ghlionney"},
["vmw"] = {"Makhuwa"},
["vmx"] = {"Mixtecish Tamazola"},
["vmy"] = {"Mazatec Ayautla"},
["vmz"] = {"Mazatec Mazatlán"},
["vnk"] = {"Vano", "Lovono"},
["vnm"] = {"Vinmavis", "Neve'ei"},
["vnp"] = {"Vunapu"},
["vor"] = {"Voroish"},
["vot"] = {"Votish"},
["vra"] = {"Vera'a"},
["vro"] = {"Võro"},
["vrs"] = {"Varisi"},
["vrt"] = {"Burmbar", "Banam Bay"},
["vsi"] = {"Çhengey Chowree Voldovagh"},
["vsl"] = {"Çhengey Chowree Veneswaalagh"},
["vsv"] = {"Çhengey Chowree Valensianagh", "Llengua de signes valenciana"},
["vto"] = {"Vitou"},
["vum"] = {"Vumbu"},
["vun"] = {"Vunjo"},
["vut"] = {"Vute"},
["vwa"] = {"Awa (y Çheen)"},
["waa"] = {"Walla Walla"},
["wab"] = {"Wab"},
["wac"] = {"Wasco-Wishram"},
["wad"] = {"Wamesa", "Wondama"},
["wae"] = {"Walser"},
["waf"] = {"Wakoná"},
["wag"] = {"Wa'ema"},
["wah"] = {"Watubela"},
["wai"] = {"Wares"},
["waj"] = {"Waffa"},
["wak"] = {"çhengaghyn Wakashagh"},
["wal"] = {"Wolaytta", "Wolaitta"},
["wam"] = {"Wampanoag"},
["wan"] = {"Wan"},
["wao"] = {"Wappo"},
["wap"] = {"Wapishana"},
["waq"] = {"Wagiman"},
["war"] = {"Waray (ny h-Ellanyn Philippeenagh)"},
["was"] = {"Washo"},
["wat"] = {"Kaninuwa"},
["wau"] = {"Waurá"},
["wav"] = {"Waka"},
["waw"] = {"Waiwai"},
["wax"] = {"Watam", "Marangis"},
["way"] = {"Wayana"},
["waz"] = {"Wampur"},
["wba"] = {"Warao"},
["wbb"] = {"Wabo"},
["wbe"] = {"Waritai"},
["wbf"] = {"Wara"},
["wbh"] = {"Wanda"},
["wbi"] = {"Vwanji"},
["wbj"] = {"Alagwa"},
["wbk"] = {"Waigali"},
["wbl"] = {"Wakhi"},
["wbm"] = {"Wa"},
["wbp"] = {"Warlpiri"},
["wbq"] = {"Waddar"},
["wbr"] = {"Wagdi"},
["wbs"] = {"Çhengey Chowree y Vengaal Heear"},
["wbt"] = {"Warnman"},
["wbv"] = {"Wajarri"},
["wbw"] = {"Woi"},
["wca"] = {"Yanomámi"},
["wci"] = {"Waci Gbe"},
["wdd"] = {"Wandji"},
["wdg"] = {"Wadaginam"},
["wdj"] = {"Wadjiginy"},
["wdk"] = {"Wadikali"},
["wdt"] = {"Wendat"},
["wdu"] = {"Wadjigu"},
["wdy"] = {"Wadjabangayi"},
["wea"] = {"Wewaw"},
["wec"] = {"Wè Heear"},
["wed"] = {"Wedau"},
["weg"] = {"Wergaia"},
["weh"] = {"Weh"},
["wei"] = {"Kiunum"},
["wem"] = {"Weme Gbe"},
["wen"] = {"çhengaghyn Sorbagh"},
["weo"] = {"Wemale"},
["wep"] = {"Westphalien"},
["wer"] = {"Weri"},
["wes"] = {"Cameroonish Vrisht"},
["wet"] = {"Perai"},
["weu"] = {"Rawngtu Chin"},
["wew"] = {"Wejewa"},
["wfg"] = {"Yafi", "Zorop"},
["wga"] = {"Wagaya"},
["wgb"] = {"Wagawaga"},
["wgg"] = {"Wangkangurru", "Wangganguru"},
["wgi"] = {"Wahgi"},
["wgo"] = {"Waigeo"},
["wgu"] = {"Wirangu"},
["wgy"] = {"Warrgamay"},
["wha"] = {"Sou Upaa", "Manusela"},
["whg"] = {"Wahgi Hwoaie"},
["whk"] = {"Wahau Kenyah"},
["whu"] = {"Wahau Kayan"},
["wib"] = {"Tusya Yiass"},
["wic"] = {"Wichita"},
["wie"] = {"Wik-Epa"},
["wif"] = {"Wik-Keyangan"},
["wig"] = {"Wik Ngathan"},
["wih"] = {"Wik-Me'anha"},
["wii"] = {"Minidien"},
["wij"] = {"Wik-Iiyanh"},
["wik"] = {"Wikalkan"},
["wil"] = {"Wilawila"},
["wim"] = {"Wik-Mungkan"},
["win"] = {"Ho-Chunk"},
["wir"] = {"Wiraféd"},
["wiu"] = {"Wiru"},
["wiv"] = {"Vitu"},
["wiy"] = {"Wiyot"},
["wja"] = {"Waja"},
["wji"] = {"Warji"},
["wka"] = {"Kw'adza"},
["wkb"] = {"Kumbaran"},
["wkd"] = {"Wakde", "Mo"},
["wkl"] = {"Kalanadi"},
["wkr"] = {"Keerray-Woorroong"},
["wku"] = {"Kunduvadi"},
["wkw"] = {"Wakawaka"},
["wky"] = {"Wangkayutyuru"},
["wla"] = {"Walio"},
["wlc"] = {"Comoroish Mwali"},
["wle"] = {"Wolane"},
["wlg"] = {"Kunbarlang"},
["wlh"] = {"Welaun"},
["wli"] = {"Waioli"},
["wlk"] = {"Wailaki"},
["wll"] = {"Wali (y Toodaan)"},
["wlm"] = {"Bretnish Veanagh"},
["wlo"] = {"Wolio"},
["wlr"] = {"Wailapa"},
["wls"] = {"Wallisish"},
["wlu"] = {"Wuliwuli"},
["wlv"] = {"Wichí Lhamtés Vejoz"},
["wlw"] = {"Walak"},
["wlx"] = {"Wali (y Ghaney)"},
["wly"] = {"Waling"},
["wma"] = {"Mawa (y Naigeer)"},
["wmb"] = {"Wambaya"},
["wmc"] = {"Wamas"},
["wmd"] = {"Mamaindé"},
["wme"] = {"Wambule"},
["wmg"] = {"Minyag Heear"},
["wmh"] = {"Waima'a"},
["wmi"] = {"Wamin"},
["wmm"] = {"Maiwa (yn Indoneesh)"},
["wmn"] = {"Waamwang"},
["wmo"] = {"Wom (Papooey Guinea Noa)"},
["wms"] = {"Wambon"},
["wmt"] = {"Walmajarri"},
["wmw"] = {"Mwani"},
["wmx"] = {"Womo"},
["wnb"] = {"Mokati"},
["wnc"] = {"Wantoat"},
["wnd"] = {"Wandarang"},
["wne"] = {"Waneci"},
["wng"] = {"Wanggom"},
["wni"] = {"Comoroish Ndzwani"},
["wnk"] = {"Wanukaka"},
["wnm"] = {"Wanggamala"},
["wnn"] = {"Wunumara"},
["wno"] = {"Wano"},
["wnp"] = {"Wanap"},
["wnu"] = {"Usan"},
["wnw"] = {"Wintu"},
["wny"] = {"Wanyi", "Waanyi"},
["woa"] = {"Kuwema", "Tyaraity"},
["wob"] = {"Wè Hwoaie"},
["woc"] = {"Wogeo"},
["wod"] = {"Wolani"},
["woe"] = {"Woleaish"},
["wof"] = {"Wolofish Ghambiagh"},
["wog"] = {"Wogamusin"},
["woi"] = {"Kamang"},
["wok"] = {"Longto"},
["wom"] = {"Wom (y Naigeer)"},
["won"] = {"Wongo"},
["woo"] = {"Manombai"},
["wor"] = {"Woria"},
["wos"] = {"Hundish Hanga"},
["wow"] = {"Wawonii"},
["woy"] = {"Weyto"},
["wpc"] = {"Maco"},
["wrb"] = {"Waluwarra", "Warluwara"},
["wrg"] = {"Warungu", "Gudjal"},
["wrh"] = {"Wiradjuri"},
["wri"] = {"Wariyangga"},
["wrk"] = {"Garrwa"},
["wrl"] = {"Warlmanpa"},
["wrm"] = {"Warumungu"},
["wrn"] = {"Warnang"},
["wro"] = {"Worrorra"},
["wrp"] = {"Waropen"},
["wrr"] = {"Wardaman"},
["wrs"] = {"Waris"},
["wru"] = {"Waru"},
["wrv"] = {"Waruna"},
["wrw"] = {"Gugu Warra"},
["wrx"] = {"Wae Rana"},
["wry"] = {"Merwari"},
["wrz"] = {"Waray (yn Austrail)"},
["wsa"] = {"Warembori"},
["wsg"] = {"Adilabad Gondi"},
["wsi"] = {"Wusi"},
["wsk"] = {"Waskia"},
["wsr"] = {"Owenia"},
["wss"] = {"Wasa"},
["wsu"] = {"Wasu"},
["wsv"] = {"Wotapuri-Katarqalai"},
["wtb"] = {"Matambwe"},
["wtf"] = {"Watiwa"},
["wth"] = {"Wathawurrung"},
["wti"] = {"Berta"},
["wtk"] = {"Watakataui"},
["wtm"] = {"Mewati"},
["wtw"] = {"Wotu"},
["wua"] = {"Wikngenchera"},
["wub"] = {"Wunambal"},
["wud"] = {"Wudu"},
["wuh"] = {"Wutunhua"},
["wul"] = {"Silimo"},
["wum"] = {"Wumbvu"},
["wun"] = {"Bungu"},
["wur"] = {"Wurrugu"},
["wut"] = {"Wutung"},
["wuu"] = {"Sheenish Wu"},
["wuv"] = {"Wuvulu-Aua"},
["wux"] = {"Wulna"},
["wuy"] = {"Wauyai"},
["wwa"] = {"Waama"},
["wwb"] = {"Wakabunga"},
["wwo"] = {"Wetamut", "Dorig"},
["wwr"] = {"Warrwa"},
["www"] = {"Wawa"},
["wxa"] = {"Waxianghua"},
["wxw"] = {"Wardandi"},
["wyb"] = {"Wangaaybuwan-Ngiyambaa"},
["wyi"] = {"Woiwurrung"},
["wym"] = {"Wymysorys"},
["wyn"] = {"Wyandot"},
["wyr"] = {"Wayoró"},
["wyy"] = {"Fijish Heear"},
["xaa"] = {"Arabish Andaloosagh"},
["xab"] = {"Sambe"},
["xac"] = {"Kachari"},
["xad"] = {"Adai"},
["xae"] = {"Aequish"},
["xag"] = {"Aghwan"},
["xai"] = {"Kaimbé"},
["xaj"] = {"Ararandewára"},
["xak"] = {"Máku"},
["xal"] = {"Kalmykish", "Oiratish"},
["xam"] = {"ǀXam"},
["xan"] = {"Xamtanga"},
["xao"] = {"Khao"},
["xap"] = {"Apalaçheeish"},
["xaq"] = {"Ackitaanish"},
["xar"] = {"Karami"},
["xas"] = {"Kamas"},
["xat"] = {"Katawixi"},
["xau"] = {"Kauwera"},
["xav"] = {"Xavánte"},
["xaw"] = {"Kawaiisu"},
["xay"] = {"Kayan Mahakam"},
["xbb"] = {"Burdekin Injil"},
["xbc"] = {"Bactrish"},
["xbd"] = {"Bindal"},
["xbe"] = {"Bigambal"},
["xbg"] = {"Bunganditj"},
["xbi"] = {"Kombio"},
["xbj"] = {"Birrpayi"},
["xbm"] = {"Britaanish Veanagh"},
["xbn"] = {"Kenaboi"},
["xbo"] = {"Bolgarish"},
["xbp"] = {"Bibbulman"},
["xbr"] = {"Kambera"},
["xbw"] = {"Kambiwá"},
["xby"] = {"Batjala", "Batyala"},
["xcb"] = {"Cumbrish"},
["xcc"] = {"Camunish"},
["xce"] = {"Celtibeirish"},
["xcg"] = {"Goalish Chisalpagh"},
["xch"] = {"Chemakum", "Chimakum"},
["xcl"] = {"Armeanish Chlassicagh"},
["xcm"] = {"Comecrudo"},
["xcn"] = {"Cotoname"},
["xco"] = {"Chorasmish"},
["xcr"] = {"Carian"},
["xct"] = {"Tibetish Chlassicagh"},
["xcu"] = {"Curonish"},
["xcv"] = {"Chuvantsy"},
["xcw"] = {"Coahuilteco"},
["xcy"] = {"Cayuse"},
["xda"] = {"Darkinyung"},
["xdc"] = {"Dackish"},
["xdk"] = {"Dharuk"},
["xdm"] = {"Edomish"},
["xdo"] = {"Kwandu"},
["xdq"] = {"Kaitag"},
["xdy"] = {"Dayak Valayagh"},
["xeb"] = {"Eblan"},
["xed"] = {"Hdi"},
["xeg"] = {"ǁXegwi"},
["xel"] = {"Kelo"},
["xem"] = {"Kembayan"},
["xep"] = {"Epi-Olmec"},
["xer"] = {"Xerénte"},
["xes"] = {"Kesawai"},
["xet"] = {"Xetá"},
["xeu"] = {"Keoru-Ahia"},
["xfa"] = {"Faliscish"},
["xga"] = {"Galaatish"},
["xgb"] = {"Gbin"},
["xgd"] = {"Gudang"},
["xgf"] = {"Gabrielino-Fernandeño"},
["xgg"] = {"Goreng"},
["xgi"] = {"Garingbal"},
["xgl"] = {"Galindan"},
["xgm"] = {"Dharumbal", "Guwinmal"},
["xgn"] = {"çhengaghyn Mongoilagh"},
["xgr"] = {"Garza"},
["xgu"] = {"Unggumi"},
["xgw"] = {"Guwa"},
["xha"] = {"Haramish"},
["xhc"] = {"Hunnish"},
["xhd"] = {"Hadrami"},
["xhe"] = {"Khetrani"},
["xhm"] = {"Khmerish Veanagh (1400 derrey 1850 BNJ)"},
["xhr"] = {"Hernicish"},
["xht"] = {"Hattish"},
["xhu"] = {"Hurrish"},
["xhv"] = {"Khua"},
["xib"] = {"Ibeirish"},
["xii"] = {"Xiri"},
["xil"] = {"Illyrish"},
["xin"] = {"Xinca"},
["xir"] = {"Xiriâna"},
["xis"] = {"Kisan"},
["xiv"] = {"Çhengey Ghlion yn Indus"},
["xiy"] = {"Xipaya"},
["xjb"] = {"Minjungbal"},
["xjt"] = {"Jaitmatang"},
["xka"] = {"Kalkoti"},
["xkb"] = {"Nago Hwoaie"},
["xkc"] = {"Kho'ini"},
["xkd"] = {"Kayan Mendalam"},
["xke"] = {"Kereho"},
["xkf"] = {"Khengkha"},
["xkg"] = {"Kagoro"},
["xki"] = {"Çhengey Chowree Cheinnagh"},
["xkj"] = {"Kajali"},
["xkk"] = {"Kachok", "Kaco'"},
["xkl"] = {"Kenyah Chadjin"},
["xkn"] = {"Kayan yn Awin Kayan"},
["xko"] = {"Kiorr"},
["xkp"] = {"Kabatei"},
["xkq"] = {"Koroni"},
["xkr"] = {"Xakriabá"},
["xks"] = {"Kumbewaha"},
["xkt"] = {"Kantosi"},
["xku"] = {"Kaamba"},
["xkv"] = {"Kgalagadi"},
["xkw"] = {"Kembra"},
["xkx"] = {"Karore"},
["xky"] = {"Uma' Lasan"},
["xkz"] = {"Kurtokha"},
["xla"] = {"Kamula"},
["xlb"] = {"Loup B"},
["xlc"] = {"Lyckish"},
["xld"] = {"Lydish"},
["xle"] = {"Lemnish"},
["xlg"] = {"Ligoorish (Henndeeagh)"},
["xli"] = {"Liburnish"},
["xln"] = {"Alanish"},
["xlo"] = {"Loup A"},
["xlp"] = {"Lepontish"},
["xls"] = {"Lusitaanish"},
["xlu"] = {"Luwish Yeenysagh"},
["xly"] = {"Elymish"},
["xma"] = {"Mushungulu"},
["xmb"] = {"Mbonga"},
["xmc"] = {"Makhuwa-Marrevone"},
["xmd"] = {"Mbudum"},
["xme"] = {"Medish"},
["xmf"] = {"Mingrelish"},
["xmg"] = {"Mengaka"},
["xmh"] = {"Kugu-Muminh"},
["xmj"] = {"Majera"},
["xmk"] = {"Massadoanish Henndeeagh"},
["xml"] = {"Çhengey Chowree Valaysiagh"},
["xmm"] = {"Malayish Manado"},
["xmn"] = {"Pershish Veanagh Vanichaeagh"},
["xmo"] = {"Morerebi"},
["xmp"] = {"Kuku-Mu'inh"},
["xmq"] = {"Kuku-Mangk"},
["xmr"] = {"Meroitish"},
["xms"] = {"Çhengey Chowree Varocagh"},
["xmt"] = {"Matbat"},
["xmu"] = {"Kamu"},
["xmv"] = {"Malagasish Antankarana", "Malagasish Tankarana"},
["xmw"] = {"Malagasish Tsimihety"},
["xmx"] = {"Salawati", "Maden"},
["xmy"] = {"Mayaguduna"},
["xmz"] = {"Mori Bawah"},
["xna"] = {"Arabish Hwoaie Henndeeagh"},
["xnb"] = {"Kanakanabu"},
["xnd"] = {"çhengaghyn Na-Dene"},
["xng"] = {"Mongoilish Veanagh"},
["xnh"] = {"Kuanhua"},
["xni"] = {"Ngarigu"},
["xnj"] = {"Ngoni (Tanzania)"},
["xnk"] = {"Nganakarti"},
["xnm"] = {"Ngumbarl"},
["xnn"] = {"Kankanay Hwoaie"},
["xno"] = {"Anglo-Normanish"},
["xnq"] = {"Ngoni (y Vosambeeck)"},
["xnr"] = {"Kangri"},
["xns"] = {"Kanashi"},
["xnt"] = {"Narragansett"},
["xnu"] = {"Nukunul"},
["xny"] = {"Nyiyaparli"},
["xnz"] = {"Kenzi", "Mattoki"},
["xoc"] = {"O'chi'chi'"},
["xod"] = {"Kokoda"},
["xog"] = {"Soga"},
["xoi"] = {"Kominimung"},
["xok"] = {"Xokleng"},
["xom"] = {"Komo (y Toodaan)"},
["xon"] = {"Konkomba"},
["xoo"] = {"Xukurú"},
["xop"] = {"Kopar"},
["xor"] = {"Korubo"},
["xow"] = {"Kowaki"},
["xpa"] = {"Pirriya"},
["xpb"] = {"Tasmanian Hiar Hwoaie", "Pyemmairrener"},
["xpc"] = {"Pecheneg"},
["xpd"] = {"Tasmaanish Oyster Bay"},
["xpe"] = {"Kpelle yn Laibeer"},
["xpf"] = {"Tasmaanish Hiar Yiass", "Nuenonne"},
["xpg"] = {"Phrygish"},
["xph"] = {"Tasmaanish Vean-çheerey Hwoaie", "Tyerrenoterpanner"},
["xpi"] = {"Pictish"},
["xpj"] = {"Mpalitjanh"},
["xpk"] = {"Kulina Pano"},
["xpl"] = {"Tasmaanish Port Sorell"},
["xpm"] = {"Pumpokol"},
["xpn"] = {"Kapinawá"},
["xpo"] = {"Pochutec"},
["xpp"] = {"Puyo-Paekche"},
["xpq"] = {"Moheganish-Pequot"},
["xpr"] = {"Parthish"},
["xps"] = {"Pisidish"},
["xpt"] = {"Punthamara"},
["xpu"] = {"Punish"},
["xpv"] = {"Tasmaanish Hwoaie", "Tommeginne"},
["xpw"] = {"Tasmaanish Heear Hwoaie", "Peerapper"},
["xpx"] = {"Tasmaanish Heear Yiass", "Toogee"},
["xpy"] = {"Puyo"},
["xpz"] = {"Tasmaanish Ellan Bruny"},
["xqa"] = {"Karakhanid"},
["xqt"] = {"Qatabanian"},
["xra"] = {"Krahô"},
["xrb"] = {"Karaboro Hiar"},
["xrd"] = {"Gundungurra"},
["xre"] = {"Kreye"},
["xrg"] = {"Minang"},
["xri"] = {"Krikati-Timbira"},
["xrm"] = {"Armazish"},
["xrn"] = {"Arin"},
["xrr"] = {"Raetish"},
["xrt"] = {"Aranama-Tamique"},
["xru"] = {"Marriammu"},
["xrw"] = {"Karawa"},
["xsa"] = {"Sabaean"},
["xsb"] = {"Sambal"},
["xsc"] = {"Scythish"},
["xsd"] = {"Sidetish"},
["xse"] = {"Sempan"},
["xsh"] = {"Shamang"},
["xsi"] = {"Sio"},
["xsj"] = {"Subi"},
["xsl"] = {"Slavish Yiass"},
["xsm"] = {"Kasem"},
["xsn"] = {"Sanga (y Naigeer)"},
["xso"] = {"Solano"},
["xsp"] = {"Silopi"},
["xsq"] = {"Makhuwa-Saka"},
["xsr"] = {"Sherpa"},
["xsu"] = {"Sanumá"},
["xsv"] = {"Sudovish"},
["xsy"] = {"Saisiyat"},
["xta"] = {"Mixtecish Alcozauca"},
["xtb"] = {"Mixtecish Chazumba"},
["xtc"] = {"Katcha-Kadugli-Miri"},
["xtd"] = {"Mixtecish Diuxi-Tilantongo"},
["xte"] = {"Ketengban"},
["xtg"] = {"Goalish Hessenalpagh"},
["xth"] = {"Yitha Yitha"},
["xti"] = {"Mixtecish Sinicahua"},
["xtj"] = {"Mixtecish San Juan Teita"},
["xtl"] = {"Mixtecish Tijaltepec"},
["xtm"] = {"Mixtecish Magdalena Peñasco"},
["xtn"] = {"Mixtecish Tlaxiaco Hwoaie"},
["xto"] = {"Tokharish A"},
["xtp"] = {"Mixtecish San Miguel Piedras"},
["xtq"] = {"Tumshuqese"},
["xtr"] = {"Tripoorish Leah"},
["xts"] = {"Mixtecish Sindihui"},
["xtt"] = {"Mixtecish Tacahua"},
["xtu"] = {"Mixtecish Cuyamecalco"},
["xtv"] = {"Thawa"},
["xtw"] = {"Tawandê"},
["xty"] = {"Mixtecish Yoloxochitl"},
["xua"] = {"Alu Kurumba"},
["xub"] = {"Betta Kurumba"},
["xud"] = {"Umiida"},
["xug"] = {"Kunigami"},
["xuj"] = {"Jennu Kurumba"},
["xul"] = {"Ngunawal", "Nunukul"},
["xum"] = {"Umbrish"},
["xun"] = {"Unggaranggu"},
["xuo"] = {"Kuo"},
["xup"] = {"Umpqua Heose"},
["xur"] = {"Urartish"},
["xut"] = {"Kuthant"},
["xuu"] = {"Kxoe", "Khwedam"},
["xve"] = {"Venetish"},
["xvi"] = {"Kamviri"},
["xvn"] = {"Vandalish"},
["xvo"] = {"Volscish"},
["xvs"] = {"Vestinish"},
["xwa"] = {"Kwaza"},
["xwc"] = {"Woccon"},
["xwd"] = {"Wadi Wadi"},
["xwe"] = {"Xwela Gbe"},
["xwg"] = {"Kwegu"},
["xwj"] = {"Wajuk"},
["xwk"] = {"Wangkumara"},
["xwl"] = {"Xwla Gbe Heear"},
["xwo"] = {"Oiratish Screeuit"},
["xwr"] = {"Kwerba Mamberamo"},
["xwt"] = {"Wotjobaluk"},
["xww"] = {"Wemba Wemba"},
["xxb"] = {"Boro (y Ghaney)"},
["xxk"] = {"Ke'o"},
["xxm"] = {"Minkin"},
["xxr"] = {"Koropó"},
["xxt"] = {"Tambora"},
["xya"] = {"Yaygir"},
["xyb"] = {"Yandjibara"},
["xyj"] = {"Mayi-Yapi"},
["xyk"] = {"Mayi-Kulan"},
["xyl"] = {"Yalakalore"},
["xyt"] = {"Mayi-Thakurti"},
["xyy"] = {"Yorta Yorta"},
["xzh"] = {"Zhang-Zhung"},
["xzm"] = {"Zemgalish"},
["xzp"] = {"Zapotecish Henndeeagh"},
["yaa"] = {"Yaminahua"},
["yab"] = {"Yuhup"},
["yac"] = {"Yali Pass Valley"},
["yad"] = {"Yagua"},
["yae"] = {"Pumé"},
["yaf"] = {"Yaka (Pobblaght Gheynlagh y Chongo)"},
["yag"] = {"Yámana"},
["yah"] = {"Yazgulyam"},
["yai"] = {"Yagnobi"},
["yaj"] = {"Banda-Yangere"},
["yak"] = {"Yakama"},
["yal"] = {"Yalunka"},
["yam"] = {"Yamba"},
["yan"] = {"Mayangna"},
["yao"] = {"Yao"},
["yap"] = {"Yapish"},
["yaq"] = {"Yaqui"},
["yar"] = {"Yabarana"},
["yas"] = {"Nugunu (Cameroon)"},
["yat"] = {"Yambeta"},
["yau"] = {"Yuwana"},
["yav"] = {"Yangben"},
["yaw"] = {"Yawalapití"},
["yax"] = {"Yauma"},
["yay"] = {"Agwagwune"},
["yaz"] = {"Lokaa"},
["yba"] = {"Yala"},
["ybb"] = {"Yemba"},
["ybe"] = {"Yugur Heear"},
["ybh"] = {"Yakha"},
["ybi"] = {"Yamphu"},
["ybj"] = {"Hasha"},
["ybk"] = {"Bokha"},
["ybl"] = {"Yukuben"},
["ybm"] = {"Yaben"},
["ybn"] = {"Yabaâna"},
["ybo"] = {"Yabong"},
["ybx"] = {"Yawiyo"},
["yby"] = {"Yaweyuha"},
["ych"] = {"Chesu"},
["ycl"] = {"Lolopo"},
["ycn"] = {"Yucuna"},
["ycp"] = {"Chepya"},
["ycr"] = {"Creeole Yilan"},
["yda"] = {"Yanda"},
["ydd"] = {"Ewdish Hiar"},
["yde"] = {"Yangum Dey"},
["ydg"] = {"Yidgha"},
["ydk"] = {"Yoidik"},
["yea"] = {"Ravula"},
["yec"] = {"Yeniche"},
["yee"] = {"Yimas"},
["yei"] = {"Yeni"},
["yej"] = {"Yevanish"},
["yel"] = {"Yela"},
["yer"] = {"Tarok"},
["yes"] = {"Nyankpa"},
["yet"] = {"Yetfa"},
["yeu"] = {"Yerukula"},
["yev"] = {"Yapunda"},
["yey"] = {"Yeyi"},
["yga"] = {"Malyangapa"},
["ygi"] = {"Yiningayi"},
["ygl"] = {"Yangum Gel"},
["ygm"] = {"Yagomi"},
["ygp"] = {"Gepo"},
["ygr"] = {"Yagaria"},
["ygs"] = {"Çhengey Chowree Yolŋu"},
["ygu"] = {"Yugul"},
["ygw"] = {"Yagwoia"},
["yha"] = {"Baha Buyang"},
["yhd"] = {"Arabish Earackagh Ewagh"},
["yhl"] = {"Hlepho Phowa"},
["yhs"] = {"Çhengey Chowree Yan-nhaŋu"},
["yia"] = {"Yinggarda"},
["yif"] = {"Ache"},
["yig"] = {"Wusa Nasu"},
["yih"] = {"Ewdish Heear"},
["yii"] = {"Yidiny"},
["yij"] = {"Yindjibarndi"},
["yik"] = {"Dongshanba Lalo"},
["yil"] = {"Yindjilandji"},
["yim"] = {"Naga Yimchungru"},
["yin"] = {"Riang Lai", "Yinchia"},
["yip"] = {"Pholo"},
["yiq"] = {"Miqie"},
["yir"] = {"Awyu Hwoaie"},
["yis"] = {"Yis"},
["yit"] = {"Lalu Hiar"},
["yiu"] = {"Awu"},
["yiv"] = {"Nisu Hwoaie"},
["yix"] = {"Axi Yi"},
["yiz"] = {"Azhe"},
["yka"] = {"Yakan"},
["ykg"] = {"Yukaghirish Hwoaie"},
["ykh"] = {"Mongoilish Khamnigan"},
["yki"] = {"Yoke"},
["ykk"] = {"Yakaikeke"},
["ykl"] = {"Khlula"},
["ykm"] = {"Kap"},
["ykn"] = {"Kua-nsi"},
["yko"] = {"Yasa"},
["ykr"] = {"Yekora"},
["ykt"] = {"Kathu"},
["yku"] = {"Kuamasi"},
["yky"] = {"Yakoma"},
["yla"] = {"Yaul"},
["ylb"] = {"Yaleba"},
["yle"] = {"Yele"},
["ylg"] = {"Yelogu"},
["yli"] = {"Yali Angguruk"},
["yll"] = {"Yil"},
["ylm"] = {"Limi"},
["yln"] = {"Langnian Buyang"},
["ylo"] = {"Naluo Yi"},
["ylr"] = {"Yalarnnga"},
["ylu"] = {"Aribwaung"},
["yly"] = {"Nyâlayu", "Nyelâyu"},
["ymb"] = {"Yambes"},
["ymc"] = {"Muji Yiass"},
["ymd"] = {"Muda"},
["yme"] = {"Yameo"},
["ymg"] = {"Yamongeri"},
["ymh"] = {"Mili"},
["ymi"] = {"Moji"},
["ymk"] = {"Makwe"},
["yml"] = {"Iamalele"},
["ymm"] = {"Maay"},
["ymn"] = {"Yamna", "Sunum"},
["ymo"] = {"Yangum Mon"},
["ymp"] = {"Yamap"},
["ymq"] = {"Qila Muji"},
["ymr"] = {"Malasar"},
["yms"] = {"Mysish"},
["ymx"] = {"Muji Hwoaie"},
["ymz"] = {"Muzi"},
["yna"] = {"Aluo"},
["ynd"] = {"Yandruwandha"},
["yne"] = {"Lang'e"},
["yng"] = {"Yango"},
["ynk"] = {"Yupikish Naukan"},
["ynl"] = {"Yangulam"},
["ynn"] = {"Yana"},
["yno"] = {"Yong"},
["ynq"] = {"Yendang"},
["yns"] = {"Yansi"},
["ynu"] = {"Yahuna"},
["yob"] = {"Yoba"},
["yog"] = {"Yogad"},
["yoi"] = {"Yonaguni"},
["yok"] = {"Yokuts"},
["yol"] = {"Yola"},
["yom"] = {"Yombe"},
["yon"] = {"Yongkom"},
["yot"] = {"Yotti"},
["yox"] = {"Yoron"},
["yoy"] = {"Yoy"},
["ypa"] = {"Phala"},
["ypb"] = {"Labo Phowa"},
["ypg"] = {"Phola"},
["yph"] = {"Phupha"},
["ypk"] = {"çhengaghyn Yupikagh"},
["ypm"] = {"Phuma"},
["ypn"] = {"Ani Phowa"},
["ypo"] = {"Alo Phola"},
["ypp"] = {"Phupa"},
["ypz"] = {"Phuza"},
["yra"] = {"Yerakai"},
["yrb"] = {"Yareba"},
["yre"] = {"Yaouré"},
["yrk"] = {"Nenetsish"},
["yrl"] = {"Nhengatu"},
["yrm"] = {"Yirrk-Mel"},
["yrn"] = {"Yerong"},
["yro"] = {"Yaroamë"},
["yrs"] = {"Yarsun"},
["yrw"] = {"Yarawata"},
["yry"] = {"Yarluyandi"},
["ysc"] = {"Yassish"},
["ysd"] = {"Samatao"},
["ysg"] = {"Sonaga"},
["ysl"] = {"Çhengey Chowree Yugoslaavagh"},
["ysm"] = {"Çhengey Chowree Myanmar"},
["ysn"] = {"Sani"},
["yso"] = {"Nisi (y Çheen)"},
["ysp"] = {"Lolopo Yiass"},
["ysr"] = {"Yupikish Sirenik"},
["yss"] = {"Yessan-Mayo"},
["ysy"] = {"Sanie"},
["yta"] = {"Talu"},
["ytl"] = {"Tanglang"},
["ytp"] = {"Thopho"},
["ytw"] = {"Yout Wam"},
["yty"] = {"Yatay"},
["yua"] = {"Yucateco", "Mayish Yucatec"},
["yub"] = {"Yugambal"},
["yuc"] = {"Yuchi"},
["yud"] = {"Arabish Hripolitaanagh Ewagh"},
["yue"] = {"Sheenish Yue", "Cantoanish", "Yueish"},
["yuf"] = {"Havasupai-Walapai-Yavapai"},
["yug"] = {"Yug"},
["yui"] = {"Yurutí"},
["yuj"] = {"Karkar-Yuri"},
["yuk"] = {"Yuki"},
["yul"] = {"Yulu"},
["yum"] = {"Quechan"},
["yun"] = {"Bena (y Naigeer)"},
["yup"] = {"Yukpa"},
["yuq"] = {"Yuqui"},
["yur"] = {"Yurok"},
["yut"] = {"Yopno"},
["yuw"] = {"Yau (Queiggey Morobe)"},
["yux"] = {"Yukaghirish Yiass"},
["yuy"] = {"Yugur Hiar"},
["yuz"] = {"Yuracare"},
["yva"] = {"Yawa"},
["yvt"] = {"Yavitero"},
["ywa"] = {"Kalou"},
["ywg"] = {"Yinhawangka"},
["ywl"] = {"Lalu Heear"},
["ywn"] = {"Yawanawa"},
["ywq"] = {"Wuding-Luquan Yi"},
["ywr"] = {"Yawuru"},
["ywt"] = {"Xishanba Lalo", "Lalo Veanagh"},
["ywu"] = {"Wumeng Nasu"},
["yww"] = {"Yawarawarga"},
["yxa"] = {"Mayawali"},
["yxg"] = {"Yagara"},
["yxl"] = {"Yardliyawarra"},
["yxm"] = {"Yinwum"},
["yxu"] = {"Yuyu"},
["yxy"] = {"Yabula Yabula"},
["yyr"] = {"Yir Yoront"},
["yyu"] = {"Yau (Queiggey Sandaun)"},
["yyz"] = {"Ayizi"},
["yzg"] = {"E'ma Buyang"},
["yzk"] = {"Zokhuo"},
["zaa"] = {"Zapotecish Sierra de Juárez"},
["zab"] = {"Zapotecish Ghlion Tlacolula Heear", "Zapotecish San Juan Guelavía"},
["zac"] = {"Zapotecish Ocotlán"},
["zad"] = {"Zapotecish Cajonos"},
["zae"] = {"Zapotecish Yareni"},
["zaf"] = {"Zapotecish Ayoquesco"},
["zag"] = {"Zaghawa"},
["zah"] = {"Zangwal"},
["zai"] = {"Zapotecish Whing Hallooin"},
["zaj"] = {"Zaramo"},
["zak"] = {"Zanaki"},
["zal"] = {"Zauzou"},
["zam"] = {"Zapotecish Miahuatlán"},
["zao"] = {"Zapotecish Ozolotepec"},
["zap"] = {"Zapotecish"},
["zaq"] = {"Zapotecish Aloápam"},
["zar"] = {"Zapotecish Rincón"},
["zas"] = {"Zapotecish Santo Domingo Albarradas"},
["zat"] = {"Zapotecish Tabaa"},
["zau"] = {"Zangskari"},
["zav"] = {"Zapotecish Yatzachi"},
["zaw"] = {"Zapotecish Mitla"},
["zax"] = {"Zapotecish Xadani"},
["zay"] = {"Zayse-Zergulla", "Zaysete"},
["zaz"] = {"Zari"},
["zba"] = {"Balaibalan"},
["zbc"] = {"Berawan Veanagh"},
["zbe"] = {"Berawan Hiar"},
["zbl"] = {"Blissymbols", "Bliss", "Blissymbolics"},
["zbt"] = {"Batui"},
["zbu"] = {"Bu (Steat Bauchi)"},
["zbw"] = {"Berawan Heear"},
["zca"] = {"Zapotecish Coatecas Altas"},
["zcd"] = {"Zapotecish Las Delicias"},
["zch"] = {"Zhang Hongshuihe Veanagh"},
["zdj"] = {"Comoroish Ngazidja"},
["zea"] = {"Zeeuws"},
["zeg"] = {"Zenag"},
["zeh"] = {"Zhuang Hongshuihe Hiar"},
["zem"] = {"Zeem"},
["zen"] = {"Zenaga"},
["zga"] = {"Kinga"},
["zgb"] = {"Zhuang Guibei"},
["zgh"] = {"Tamazightish Varocagh Stundayrtit"},
["zgm"] = {"Zhuang Minz"},
["zgn"] = {"Zhuang Guibian"},
["zgr"] = {"Magori"},
["zhb"] = {"Zhaba"},
["zhd"] = {"Zhuang Dai"},
["zhi"] = {"Zhire"},
["zhn"] = {"Zhuang Nong"},
["zhw"] = {"Zhoa"},
["zhx"] = {"Sheenagh (kynney)"},
["zia"] = {"Zia"},
["zib"] = {"Çhengey Chowree Himbabweagh"},
["zik"] = {"Zimakani"},
["zil"] = {"Zialo"},
["zim"] = {"Mesme"},
["zin"] = {"Zinza"},
["ziw"] = {"Zigula"},
["ziz"] = {"Zizilivakan"},
["zka"] = {"Kaimbulawa"},
["zkd"] = {"Kadu"},
["zkg"] = {"Koguryo"},
["zkh"] = {"Khorezmish"},
["zkk"] = {"Karankawa"},
["zkn"] = {"Kanan"},
["zko"] = {"Kott"},
["zkp"] = {"Kaingáng São Paulo"},
["zkr"] = {"Zakhring"},
["zkt"] = {"Kitan"},
["zku"] = {"Kaurna"},
["zkv"] = {"Krevinish"},
["zkz"] = {"Khazarish"},
["zla"] = {"Zula"},
["zle"] = {"çhengaghyn Slavagh Hiar"},
["zlj"] = {"Zhuang Liujiang"},
["zlm"] = {"Malayish (çhengey er lheh)"},
["zln"] = {"Zhuang Lianshan"},
["zlq"] = {"Zhuang Liuqian"},
["zls"] = {"çhengaghyn Slavagh Yiass"},
["zlu"] = {"Zul"},
["zlw"] = {"çhengaghyn Slavagh Heear"},
["zma"] = {"Manda (yn Austrail)"},
["zmb"] = {"Zimba"},
["zmc"] = {"Margany"},
["zmd"] = {"Maridan"},
["zme"] = {"Mangerr"},
["zmf"] = {"Mfinu"},
["zmg"] = {"Marti Ke"},
["zmh"] = {"Makolkol"},
["zmi"] = {"Malayish Negeri Sembilan"},
["zmj"] = {"Maridjabin"},
["zmk"] = {"Mandandanyi"},
["zml"] = {"Matngala"},
["zmm"] = {"Marimanindji", "Marramaninyshi"},
["zmn"] = {"Mbangwe"},
["zmo"] = {"Molo"},
["zmp"] = {"Mpuono"},
["zmq"] = {"Mituku"},
["zmr"] = {"Maranunggu"},
["zms"] = {"Mbesa"},
["zmt"] = {"Maringarr"},
["zmu"] = {"Muruwari"},
["zmv"] = {"Mbariman-Gudhinma"},
["zmw"] = {"Mbo (Pobblaght Gheynlagh y Chongo)"},
["zmx"] = {"Bomitaba"},
["zmy"] = {"Mariyedi"},
["zmz"] = {"Mbandja"},
["zna"] = {"Zan Gula"},
["znd"] = {"çhengaghyn Zande"},
["zne"] = {"Zande (çhengey er lheh)"},
["zng"] = {"Mang"},
["znk"] = {"Manangkari"},
["zns"] = {"Mangas"},
["zoc"] = {"Zoque Copainalá"},
["zoh"] = {"Zoque Chimalapa"},
["zom"] = {"Zou"},
["zoo"] = {"Zapotecish Mixtepec Asunción"},
["zoq"] = {"Zoque Tabasco"},
["zor"] = {"Zoque Rayón"},
["zos"] = {"Zoque Francisco León"},
["zpa"] = {"Zapotecish Lachiguiri"},
["zpb"] = {"Zapotecish Yautepec"},
["zpc"] = {"Zapotecish Choapan"},
["zpd"] = {"Zapotecish Ixtlán Hiar Yiass"},
["zpe"] = {"Zapotecish Petapa"},
["zpf"] = {"Zapotecish San Pedro Quiatoni"},
["zpg"] = {"Zapotecish Guevea De Humboldt"},
["zph"] = {"Zapotecish Totomachapan"},
["zpi"] = {"Zapotecish Santa María Quiegolani"},
["zpj"] = {"Zapotecish Quiavicuzas"},
["zpk"] = {"Zapotecish Tlacolulita"},
["zpl"] = {"Zapotecish Lachixío"},
["zpm"] = {"Zapotecish Mixtepec"},
["zpn"] = {"Zapotecish Santa Inés Yatzechi"},
["zpo"] = {"Zapotecish Amatlán"},
["zpp"] = {"Zapotecish El Alto"},
["zpq"] = {"Zapotecish Zoogocho"},
["zpr"] = {"Zapotecish Santiago Xanica"},
["zps"] = {"Zapotecish Coatlán"},
["zpt"] = {"Zapotecish San Vicente Coatlán"},
["zpu"] = {"Zapotecish Yalálag"},
["zpv"] = {"Zapotecish Chichicapan"},
["zpw"] = {"Zapotecish Zaniza"},
["zpx"] = {"Zapotecish San Baltazar Loxicha"},
["zpy"] = {"Zapotecish Mazaltepec"},
["zpz"] = {"Zapotecish Texmelucan"},
["zqe"] = {"Zhuang Qiubei"},
["zra"] = {"Kara (y Chorea)"},
["zrg"] = {"Mirgan"},
["zrn"] = {"Zerenkel"},
["zro"] = {"Záparo"},
["zrp"] = {"Zarphatish"},
["zrs"] = {"Mairasi"},
["zsa"] = {"Sarasira"},
["zsk"] = {"Kaskeish"},
["zsl"] = {"Çhengey Chowree Hambagh"},
["zsm"] = {"Malayish Stundayrtit"},
["zsr"] = {"Zapotecish Rincon Yiass"},
["zsu"] = {"Sukurum"},
["zte"] = {"Zapotecish Elotepec"},
["ztg"] = {"Zapotecish Xanaguía"},
["ztl"] = {"Zapotecish Lapaguía-Guivini"},
["ztm"] = {"Zapotecish Mixtepec San Agustín"},
["ztn"] = {"Zapotecish Santa Catarina Albarradas"},
["ztp"] = {"Zapotecish Loxicha"},
["ztq"] = {"Zapotecish Quioquitani-Quierí"},
["zts"] = {"Zapotecish Tilquiapan"},
["ztt"] = {"Zapotecish Tejalapan"},
["ztu"] = {"Zapotecish Güilá"},
["ztx"] = {"Zapotecish Zaachila"},
["zty"] = {"Zapotecish Yatee"},
["zuh"] = {"Tokano"},
["zum"] = {"Kumzarish"},
["zun"] = {"Zuni"},
["zuy"] = {"Zumaya"},
["zwa"] = {"Zay"},
["zxx"] = {"Gyn stoo çhengoaylleeagh", "Neuchooie"},
["zyb"] = {"Zhuang Yongbei"},
["zyg"] = {"Zhuang Yang"},
["zyj"] = {"Zhuang Youjiang"},
["zyn"] = {"Zhuang Yongnan"},
["zyp"] = {"Chinish Zyphe"},
["zza"] = {"Zaza", "Dimili", "Dimli (mooar-hengey)", "Kirdki", "Kirmanjki (mooar-hengey)", "Zazakish"},
["zzj"] = {"Zhuang Zuojiang"}
}
local deprecated = {
["in"] = {"Indoneeshish"},
["iw"] = {"Ewnish"},
["ji"] = {"Ewdish"},
["jw"] = {"Javish", "Basa Jawa"},
["mo"] = {"Moldaavish", "Moldovish"},
["aam"] = {"Aramanik"},
["adp"] = {"Adap"},
["agp"] = {"Paranan"},
["ais"] = {"Nataoran Amis"},
["ajp"] = {"Arabish Levaantagh Yiass"},
["ajt"] = {"Arabish Hooneeshagh Ewagh"},
["aoh"] = {"Arma"},
["asd"] = {"Asas"},
["aue"] = {"ǂKxʼauǁʼein"},
["ayx"] = {"Ayi (y Çheen)"},
["ayy"] = {"Tayabas Ayta"},
["baz"] = {"Tunen"},
["bbz"] = {"Creeole Arabish Babalia"},
["bgm"] = {"Baga Mboteni"},
["bhk"] = {"Albay Bicolano"},
["bic"] = {"Bikaru"},
["bij"] = {"Vaghat-Ya-Bijim-Legeri"},
["bjd"] = {"Bandjigali"},
["bjq"] = {"Malagasish Betsimisaraka Yiass"},
["bkb"] = {"Finallig"},
["blg"] = {"Balau"},
["bmy"] = {"Bemba (Pobblaght Gheynlagh y Chongo)"},
["bpb"] = {"Barbacoas"},
["btb"] = {"Beti (Cameroon)"},
["btl"] = {"Bhatola"},
["bxx"] = {"Borna (Pobblaght Gheynlagh y Chongo)"},
["byy"] = {"Buya"},
["cbe"] = {"Chipiajes"},
["cbh"] = {"Cagua"},
["cca"] = {"Cauca"},
["ccq"] = {"Chaungtha"},
["cdg"] = {"Chamari"},
["cjr"] = {"Chorotega"},
["cka"] = {"Khumi Awa Chin"},
["cmk"] = {"Chimakum"},
["coy"] = {"Coyaima"},
["cqu"] = {"Quechua yn Çhillee"},
["cug"] = {"Chungmboko", "Cung"},
["cum"] = {"Cumeral"},
["daf"] = {"Dan"},
["dap"] = {"Nisi (yn Injey)"},
["dgu"] = {"Degaru"},
["dha"] = {"Dhanwar (yn Injey)"},
["dit"] = {"Dirari"},
["djl"] = {"Djiwarli"},
["dkl"] = {"Kolum So Dogon"},
["drh"] = {"Darkhat"},
["drr"] = {"Dororo"},
["drw"] = {"Darwazi"},
["dud"] = {"Hun-Saare"},
["duj"] = {"Dhuwal"},
["dwl"] = {"Walo Kumbe Dogon"},
["ekc"] = {"Karnish Hiar"},
["elp"] = {"Elpaputih"},
["emo"] = {"Emok"},
["gav"] = {"Gabutamon"},
["gbc"] = {"Garawa"},
["gfx"] = {"Mangetti Dune ǃXung"},
["ggn"] = {"Gurung Hiar"},
["ggo"] = {"Gondi Yiass"},
["ggr"] = {"Aghu Tharnggalu"},
["gio"] = {"Gelao"},
["gji"] = {"Geji"},
["gli"] = {"Guliguli"},
["gti"] = {"Gbati-ri"},
["guv"] = {"Gey"},
["hrr"] = {"Horuru"},
["iap"] = {"Iapama"},
["ibi"] = {"Ibilo"},
["ill"] = {"Iranun"},
["ilw"] = {"Talur"},
["ime"] = {"Imeraguen"},
["izi"] = {"Izi-Ezaa-Ikwo-Mgbo"},
["jar"] = {"Jarawa (y Naigeer)"},
["jeg"] = {"Jeng"},
["kbf"] = {"Kakauhua"},
["kdv"] = {"Kado"},
["kgc"] = {"Kasseng"},
["kgd"] = {"Kataang"},
["kgh"] = {"Tanudan Kalinga Heose"},
["kgm"] = {"Karipúna"},
["kjf"] = {"Khalaj [Ind-Eeraanagh]"},
["koj"] = {"Sara Dunjo"},
["kox"] = {"Coxima"},
["kpp"] = {"Karenish Paku"},
["krm"] = {"Krim"},
["ksa"] = {"Shuwa-Zamani"},
["ktr"] = {"Kota Marudu Tinagas"},
["kvs"] = {"Kunggara"},
["kwq"] = {"Kwak"},
["kxe"] = {"Kakihum"},
["kxl"] = {"Kurux Nepaalagh"},
["kxu"] = {"Kui (yn Injey)"},
["kzh"] = {"Kenuzi-Dongola"},
["kzj"] = {"Coastal Kadazan"},
["kzt"] = {"Tambunan Dusun"},
["lak"] = {"Laka (y Naigeer)"},
["lba"] = {"Lui"},
["leg"] = {"Lengua"},
["lii"] = {"Lingkhim"},
["llo"] = {"Khlor"},
["lmm"] = {"Lamam"},
["lmz"] = {"Lumbee"},
["lno"] = {"Lango (y Toodaan Yiass)"},
["lsg"] = {"Çhengey Chowree Lyons"},
["meg"] = {"Mea"},
["mgx"] = {"Omati"},
["mhh"] = {"Maskoy Vrisht"},
["mja"] = {"Mahei"},
["mld"] = {"Malakhel"},
["mnt"] = {"Maykulan"},
["mof"] = {"Mohegan-Montauk-Narragansett"},
["mst"] = {"Cataelano Mandaya"},
["mvm"] = {"Muya"},
["mwd"] = {"Mudbura"},
["mwj"] = {"Maligo"},
["mwx"] = {"Mediak"},
["mwy"] = {"Mosiro"},
["myd"] = {"Maramba"},
["myi"] = {"Mina (yn Injey)"},
["myq"] = {"Maninkish Cheylley"},
["myt"] = {"Sangab Mandaya"},
["nad"] = {"Nijadali"},
["nbf"] = {"Naxi"},
["nbx"] = {"Ngura"},
["ncp"] = {"Ndaktup"},
["ngo"] = {"Ngoni"},
["nln"] = {"Nahuatl Durango"},
["nlr"] = {"Ngarla"},
["nns"] = {"Ningye"},
["nnx"] = {"Ngong"},
["nom"] = {"Nocamán"},
["noo"] = {"Nootka"},
["nts"] = {"Natagaimas"},
["nxu"] = {"Narau"},
["ome"] = {"Omejes"},
["oun"] = {"ǃOǃung"},
["pat"] = {"Papitalai"},
["pbz"] = {"Palu"},
["pcr"] = {"Panang"},
["pgy"] = {"Pongyong"},
["pii"] = {"Pini"},
["plj"] = {"Polci"},
["plp"] = {"Palpa"},
["pmc"] = {"Palumata"},
["pmk"] = {"Pamlico"},
["pmu"] = {"Panjabish Mirpur"},
["pod"] = {"Ponares"},
["ppa"] = {"Pao"},
["ppr"] = {"Piru"},
["prb"] = {"Lua'"},
["prp"] = {"Parsi"},
["pry"] = {"Pray 3"},
["puk"] = {"Pu Ko"},
["puz"] = {"Purum Naga"},
["rie"] = {"Rien"},
["rmr"] = {"Caló"},
["rna"] = {"Runa"},
["rsi"] = {"Çhengey Chowree Rennellagh"},
["sap"] = {"Sanapaná"},
["sca"] = {"Sansu"},
["sdm"] = {"Semandang"},
["sgl"] = {"Sanglechi-Ishkashimi"},
["sgo"] = {"Songa"},
["skk"] = {"Sok"},
["slq"] = {"Salchuq"},
["smd"] = {"Sama"},
["snb"] = {"Sebuyau"},
["snh"] = {"Shinabo"},
["sul"] = {"Surigaonon"},
["sum"] = {"Sumo-Mayangna"},
["svr"] = {"Savara"},
["szd"] = {"Seru"},
["tbb"] = {"Tapeba"},
["tdu"] = {"Tempasuk Dusun"},
["tgg"] = {"Tangga"},
["thc"] = {"Tai Hang Tong"},
["thw"] = {"Thudam"},
["thx"] = {"The"},
["tid"] = {"Tidong"},
["tie"] = {"Tingal"},
["tkk"] = {"Takpa"},
["tlw"] = {"Wemale Yiass"},
["tmk"] = {"Tamang Heear Hwoaie"},
["tmp"] = {"Tai Mène"},
["tne"] = {"Tinoc Kallahan"},
["tnf"] = {"Tangshewi"},
["toe"] = {"Tomedes"},
["tpw"] = {"Tupí"},
["tsf"] = {"Tamang Heear Yiass"},
["unp"] = {"Worora"},
["uok"] = {"Uokha"},
["uun"] = {"Kulon-Pazeh"},
["vki"] = {"Ija-Zuba"},
["wgw"] = {"Wagawaga"},
["wit"] = {"Wintu"},
["wiw"] = {"Wirangu"},
["wra"] = {"Warapu"},
["wrd"] = {"Warduji"},
["wya"] = {"Wyandot"},
["xba"] = {"Kamba (y Vrasseel)"},
["xbx"] = {"Kabixí"},
["xia"] = {"Xiandao"},
["xip"] = {"Xipináwa"},
["xkh"] = {"Karahawyana"},
["xrq"] = {"Karranga"},
["xss"] = {"Assan"},
["xtz"] = {"Tasmaanish"},
["ybd"] = {"Yangbye"},
["yds"] = {"Çhengey Chowree Ewdagh"},
["yen"] = {"Yendang"},
["yiy"] = {"Yir Yoront"},
["yma"] = {"Yamphe"},
["ymt"] = {"Mator-Taygi-Karagas"},
["ynh"] = {"Yangho"},
["yos"] = {"Yos"},
["yri"] = {"Yarí"},
["yuu"] = {"Yugh"},
["zir"] = {"Ziriya"},
["zkb"] = {"Koibal"},
["zua"] = {"Zeem"}
}
return {
active = active,
deprecated = deprecated,
}
2riqe5qk7ztpbsb8c232lxlv7sy4ibm
Ny Malveenaghyn
0
31511
394744
394303
2026-10-18T15:33:26Z
MacTire02
219
++
394744
wikitext
text/x-wiki
{{Kishtey fys çheer
|ennym = Ny Malveenaghyn
|ennym_foddey_cadjincliaghtagh= {{lang|en|Falkland Islands|italics=no}} {{small|([[Baarle]])}}
|ennym_gienneydagh = ny Malveenaghyn
|jalloo_brattagh = Flag of the Falkland Islands.svg
|jalloo_cleinney = Coat of arms of the Falkland Islands.svg
|jalloo_caslys = Location_map_of_the_Falklands_–_Alternative_version_4.svg
|arrane_ashoonagh = {{lang|en|Song of the Falklands|italics=no}}
|çhyndaa_arrane_ashoonagh = Arrane ny Malveenaghyn
|çhengey_arrane_ashoonagh = Baarle
|arrane_reeoil = God Save the King
|çhyndaa_arrane_reeoil = Dy Sauail Jee yn Ree
|coadan_arrane_reeoil = United States Navy Band - God Save the King.oga
|çhengey_arrane_reeoil = Baarle
|jarroo-raa = [[Desire the Right]]
|çhengey_jarroo-raa = Baarle
|çhyndaa_jarroo-raa = Yeearree er ny ta cair
|noteyn_jarroo-raa = Ta'n jarroo-raa çheet er y lhong ''[[Desire (lhong)|Desire]]''. Myr shen, she sorçh cloie fockle t'ayn.
|çhengaghyn_oikoil = [[Baarle]]
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Croghane]] [[parlamaid]]agh [[jee-veanaghey|jee-veanit]] fo [[monarkaght vunraghtoil]]
|blein_LTS_CCK = 2013
|LTS_CCK = $228.5 millioonyn
|LTS_CCK_yn_dooinney = $96,962
|sorçh_kiondeeaght = Bunneeaght
|note_kiondeeaght =
|taghyrt1_bunnit = Y chied chummaltys
|date1_bunnit = 1764
|taghyrt2_bunnit = [[Aahickyraghey yn chionedeeaght Ghoaldagh harrish ny Malveenaghyn (1833)|Reirey Goaldagh]] aahickyrit
|date2_bunnit = 3 Jerrey Geuree 1833
|taghyrt3_bunnit = [[Caggey ny Malveenaghyn]]
|date3_bunnit = 2 Averil derrey 14 Mean Souree 1982
|taghyrt4_bunnit = [[Bunraght ny Malveenaghyn|Bunraght roie]]
|date4_bunnit = 1 Jerrey Geuree 2009
|argid = [[Punt Malveenagh]] (£) (<code>[[ISO 4217|FKP]]</code>)<br/>[[Punt Sostynagh]] (£)
|coad_argid = GBP
|traa_ynnydagh = [[Traa Chadjinit ny Malveenaghyn|FKST]]
|ashchur_utc = −03:00
|cctld = [[.fk]]
|coad_çhellvane = 500
}}
She [[ellanragh]] ayns [[Jiass y Cheayn Sheear]] er [[Skelloo yn Phatagoan]] ad '''ny Malveenaghyn''' ny '''Ellanyn Falkland''' ({{langx|en|Falkland Islands}}, {{langx|es|Islas Malvinas}}). Ta ny h-ellanyn mooarey soit mysh 300 mi (480 km) çheu hiar magh veih coose yiass y [[Yn Phatagoan|Phatagoan]] ayns America Yiass as mysh 752 mi (1,210 km) veih [[Meayll Dubouzet]] ec baare hwoaie [[Lieh-innys yn Antarctagh]], ec down-lheead er 52°S. Ta'n ellanragh, ta 4,700 mi ker (12,000 km<sup>2</sup>) er eaghtyr, jeant ass [[East Falkland]], [[West Falkland]], as 776 ellanyn ny sloo. Myr [[croghane Goaldagh harrish Mooir]], ta [[hene-reiltys]] sthie ec ny Malveenaghyn, agh ta currym coadey as cooishyn joarree ayns shelloo yn Reeriaght Unnaneysit. She [[Stanley, ny Malveenaghyn|Stanley]] er [[East Falkland]] yn preeu-valley as y alley smoo ayn.
Ta arganeyssyn ayn bentyn rish feddyn magh as coloinaghey ny Malveenaghyn liorish Oarpee. Keayrtyn eigsoylagh, va coloinyn Frangagh, Goaldagh, Spaainagh, as Argenteenagh ayn. Ren y Vretyn Vooar [[Aahickyraghey reiltys Goaldagh er ny Malveenaghyn (1833)|aahickyraghey e reill ayns 1833]], agh ta'n Argenteen foast gra dy nee lhee ny h-ellanyn. Ayns Averil 1982, ren forsaghyn caggee Argenteenagh [[Ruegys er ny Malveenaghyn 1982|ruegey ny h-ellanyn]]. Va reirey Goaldagh currit er ash daa vee ny s'anmey ec jerrey [[Caggey ny Malveenaghyn|Chaggey ny Malveenaghyn]]. Ayns [[Refrane kionedeeaght ny Malveenaghyn 2013|refrane kionedeeaght 2013]], ren begnagh dagh Malveenagh votal er son kionedeeaght Ghoaldagh myr croghane harrish mooir jeh'n Reeriaght Unnaneysit. Ta staydys kionedeeaght y chroghane coontit foast myr [[Arganeys kionedeeaght ny Malveenaghyn|arganeys roie eddyr yn Argenteen as y Reeriaght Unnaneysit]].
She [[Malveenee]] ghooghyssagh y chooid smoo jeh'n phobble ({{WD Earroo yn Phobble}}), as ta'n chooid smoo jeu jeh sluight Goaldagh. Ta kynneeyn elley goaill stiagh [[Frangee]], [[Gibraaltaree]], as Loghlynee. Ren arraghey stiagh veih'n Reeriaght Unnaneysit, [[Ellan Helena Noo]], as y Çhillee cur leodaghey earroo yn phobble ergooyl. She Baarle y çhengey oikoil as y çhengey smoo loayrit. She [[seyraanee Ghoaldagh]] dagh seyraanagh ny Malveenaghyn fo'n [[British Nationality (Falkland Islands) Act 1983]].
Ta ny h-ellanyn soit ec joarey ny cryssyn [[emshyraght vooiragh|emshyraght vooiragh fo-antarctagh]] as [[emshyraght y tundrey|y tundrey]], as ta slieu-reaynyn er y daa vooar-ellan ta roshtyn 2,300 tr (700 m). Ta pobbylyn mooarey d'ushagyn cummal er ny h-ellanyn, ga nagh vel ram jeu foast er yn eean er ny h-ellanyn mooarey kyndagh rish y chraghtys ec dooieyn va currit stiagh. Ta jannooyn tarmaynagh mooarey goaill stiagh yn eeasteyrys, y turrysid, as [[troggal kirree]], as trimmid er assphurtalyn ollan foays. Ta ronsaghey magh yn ooill, fo kiedoonys veih [[Reiltys ny Malveenaghyn]], foast arganeyssagh kyndagh rish ny h-arganeyssyn mooiragh lesh yn Argenteen.
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
==Kianglaghyn magh==
{{commons cat}}
*{{official website}}
*[http://www.fidc.co.fk/ Falkland Islands Development Corporation]
*[https://web.archive.org/web/20040325151046/http://falklandnews.com/ Falkland Islands News Network]
*{{cite EB1911 |wstitle=Falkland Islands |volume=10 |short=x}}
{{America Yiass}}
{{Co-rheynnyn y Reeriaght Unnaneysit}}
{{Gurneil eaghtyrys}}
{{coord|51.73|S|59.22|W|scale:2500000|display=title}}
{{DEFAULTSORT:Malveenaghyn, Ny}}
[[Ronney:Ny Malveenaghyn| ]]
[[Ronney:Ellanyn America Yiass fo arganeys]]
[[Ronney:Çheeraghyn ellanagh]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1833]]
[[Ronney:Croghaneyn America Yiass]]
[[Ronney:Thallooyn Harrish Mooir Goaldagh]]
[[Ronney:Ellanyn America Yiass]]
[[Ronney:America Yiass hempreilagh]]
7yqzidwizy743n57zak6qq0uxym416q
394754
394744
2026-10-18T19:26:02Z
MacTire02
219
+staydys
394754
wikitext
text/x-wiki
{{Kishtey fys çheer
|sorçh_croghane = [[Thalloo Harrish Mooir Ghoaldagh]]
|ennym = Ny Malveenaghyn
|ennym_foddey_cadjincliaghtagh= {{lang|en|Falkland Islands|italics=no}} {{small|([[Baarle]])}}
|ennym_gienneydagh = ny Malveenaghyn
|jalloo_brattagh = Flag of the Falkland Islands.svg
|jalloo_cleinney = Coat of arms of the Falkland Islands.svg
|jalloo_caslys = Location_map_of_the_Falklands_–_Alternative_version_4.svg
|arrane_ashoonagh = {{lang|en|Song of the Falklands|italics=no}}
|çhyndaa_arrane_ashoonagh = Arrane ny Malveenaghyn
|çhengey_arrane_ashoonagh = Baarle
|arrane_reeoil = God Save the King
|çhyndaa_arrane_reeoil = Dy Sauail Jee yn Ree
|coadan_arrane_reeoil = United States Navy Band - God Save the King.oga
|çhengey_arrane_reeoil = Baarle
|jarroo-raa = [[Desire the Right]]
|çhengey_jarroo-raa = Baarle
|çhyndaa_jarroo-raa = Yeearree er ny ta cair
|noteyn_jarroo-raa = Ta'n jarroo-raa çheet er y lhong ''[[Desire (lhong)|Desire]]''. Myr shen, she sorçh cloie fockle t'ayn.
|çhengaghyn_oikoil = [[Baarle]]
|balley_smoo = preeu-valley
|sorçh_reiltys = [[Croghane]] [[parlamaid]]agh [[jee-veanaghey|jee-veanit]] fo [[monarkaght vunraghtoil]]
|blein_LTS_CCK = 2013
|LTS_CCK = $228.5 millioonyn
|LTS_CCK_yn_dooinney = $96,962
|sorçh_kiondeeaght = Bunneeaght
|note_kiondeeaght =
|taghyrt1_bunnit = Y chied chummaltys
|date1_bunnit = 1764
|taghyrt2_bunnit = [[Aahickyraghey yn chionedeeaght Ghoaldagh harrish ny Malveenaghyn (1833)|Reirey Goaldagh]] aahickyrit
|date2_bunnit = 3 Jerrey Geuree 1833
|taghyrt3_bunnit = [[Caggey ny Malveenaghyn]]
|date3_bunnit = 2 Averil derrey 14 Mean Souree 1982
|taghyrt4_bunnit = [[Bunraght ny Malveenaghyn|Bunraght roie]]
|date4_bunnit = 1 Jerrey Geuree 2009
|argid = [[Punt Malveenagh]] (£) (<code>[[ISO 4217|FKP]]</code>)<br/>[[Punt Sostynagh]] (£)
|coad_argid = GBP
|traa_ynnydagh = [[Traa Chadjinit ny Malveenaghyn|FKST]]
|ashchur_utc = −03:00
|cctld = [[.fk]]
|coad_çhellvane = 500
}}
She [[ellanragh]] ayns [[Jiass y Cheayn Sheear]] er [[Skelloo yn Phatagoan]] ad '''ny Malveenaghyn''' ny '''Ellanyn Falkland''' ({{langx|en|Falkland Islands}}, {{langx|es|Islas Malvinas}}). Ta ny h-ellanyn mooarey soit mysh 300 mi (480 km) çheu hiar magh veih coose yiass y [[Yn Phatagoan|Phatagoan]] ayns America Yiass as mysh 752 mi (1,210 km) veih [[Meayll Dubouzet]] ec baare hwoaie [[Lieh-innys yn Antarctagh]], ec down-lheead er 52°S. Ta'n ellanragh, ta 4,700 mi ker (12,000 km<sup>2</sup>) er eaghtyr, jeant ass [[East Falkland]], [[West Falkland]], as 776 ellanyn ny sloo. Myr [[croghane Goaldagh harrish Mooir]], ta [[hene-reiltys]] sthie ec ny Malveenaghyn, agh ta currym coadey as cooishyn joarree ayns shelloo yn Reeriaght Unnaneysit. She [[Stanley, ny Malveenaghyn|Stanley]] er [[East Falkland]] yn preeu-valley as y alley smoo ayn.
Ta arganeyssyn ayn bentyn rish feddyn magh as coloinaghey ny Malveenaghyn liorish Oarpee. Keayrtyn eigsoylagh, va coloinyn Frangagh, Goaldagh, Spaainagh, as Argenteenagh ayn. Ren y Vretyn Vooar [[Aahickyraghey reiltys Goaldagh er ny Malveenaghyn (1833)|aahickyraghey e reill ayns 1833]], agh ta'n Argenteen foast gra dy nee lhee ny h-ellanyn. Ayns Averil 1982, ren forsaghyn caggee Argenteenagh [[Ruegys er ny Malveenaghyn 1982|ruegey ny h-ellanyn]]. Va reirey Goaldagh currit er ash daa vee ny s'anmey ec jerrey [[Caggey ny Malveenaghyn|Chaggey ny Malveenaghyn]]. Ayns [[Refrane kionedeeaght ny Malveenaghyn 2013|refrane kionedeeaght 2013]], ren begnagh dagh Malveenagh votal er son kionedeeaght Ghoaldagh myr croghane harrish mooir jeh'n Reeriaght Unnaneysit. Ta staydys kionedeeaght y chroghane coontit foast myr [[Arganeys kionedeeaght ny Malveenaghyn|arganeys roie eddyr yn Argenteen as y Reeriaght Unnaneysit]].
She [[Malveenee]] ghooghyssagh y chooid smoo jeh'n phobble ({{WD Earroo yn Phobble}}), as ta'n chooid smoo jeu jeh sluight Goaldagh. Ta kynneeyn elley goaill stiagh [[Frangee]], [[Gibraaltaree]], as Loghlynee. Ren arraghey stiagh veih'n Reeriaght Unnaneysit, [[Ellan Helena Noo]], as y Çhillee cur leodaghey earroo yn phobble ergooyl. She Baarle y çhengey oikoil as y çhengey smoo loayrit. She [[seyraanee Ghoaldagh]] dagh seyraanagh ny Malveenaghyn fo'n [[British Nationality (Falkland Islands) Act 1983]].
Ta ny h-ellanyn soit ec joarey ny cryssyn [[emshyraght vooiragh|emshyraght vooiragh fo-antarctagh]] as [[emshyraght y tundrey|y tundrey]], as ta slieu-reaynyn er y daa vooar-ellan ta roshtyn 2,300 tr (700 m). Ta pobbylyn mooarey d'ushagyn cummal er ny h-ellanyn, ga nagh vel ram jeu foast er yn eean er ny h-ellanyn mooarey kyndagh rish y chraghtys ec dooieyn va currit stiagh. Ta jannooyn tarmaynagh mooarey goaill stiagh yn eeasteyrys, y turrysid, as [[troggal kirree]], as trimmid er assphurtalyn ollan foays. Ta ronsaghey magh yn ooill, fo kiedoonys veih [[Reiltys ny Malveenaghyn]], foast arganeyssagh kyndagh rish ny h-arganeyssyn mooiragh lesh yn Argenteen.
==Noteyn==
{{notelist}}
==Imraaghyn==
{{reflist}}
==Kianglaghyn magh==
{{commons cat}}
*{{official website}}
*[http://www.fidc.co.fk/ Falkland Islands Development Corporation]
*[https://web.archive.org/web/20040325151046/http://falklandnews.com/ Falkland Islands News Network]
*{{cite EB1911 |wstitle=Falkland Islands |volume=10 |short=x}}
{{America Yiass}}
{{Co-rheynnyn y Reeriaght Unnaneysit}}
{{Gurneil eaghtyrys}}
{{coord|51.73|S|59.22|W|scale:2500000|display=title}}
{{DEFAULTSORT:Malveenaghyn, Ny}}
[[Ronney:Ny Malveenaghyn| ]]
[[Ronney:Ellanyn America Yiass fo arganeys]]
[[Ronney:Çheeraghyn ellanagh]]
[[Ronney:Steatyn as thallooyn bunnit 'sy vlein 1833]]
[[Ronney:Croghaneyn America Yiass]]
[[Ronney:Thallooyn Harrish Mooir Goaldagh]]
[[Ronney:Ellanyn America Yiass]]
[[Ronney:America Yiass hempreilagh]]
4bnkb34hgbjo8gl7042v47naczpli6n
Module:Kishtey fys çheer
828
55827
394752
394568
2026-10-18T16:31:24Z
MacTire02
219
++
394752
Scribunto
text/plain
local p = {}
-- Helper to safely grab template arguments
local function getArgs(frame)
local parent = frame:getParent()
if parent then return parent.args end
return frame.args
end
-- Strips a leading "the "/"The " from an English P1448 name
local function stripLeadingThe(text, langCode)
if langCode == "en" and text:match("^[Tt]he%s+%S") then
return text:gsub("^[Tt]he%s+", "", 1)
end
return text
end
-- Safely get manual parameters from priority list
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and value ~= "" then
local trimmed = value:match("^%s*(.-)%s*$")
if trimmed ~= "" then return trimmed end
end
end
return nil
end
function p.main(frame)
local args = getArgs(frame)
local rows = {}
-- The universal border rule separating your modules
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
-- Centralized module injection manager
local function appendModule(content)
if content and content ~= "" then
if #rows > 0 then
table.insert(rows, dividerLine)
end
table.insert(rows, content)
end
end
-- ------------------------------------------------ MODULE 1
local title = args["ennym"] or mw.title.getCurrentTitle().text
local subTitle = getManual(args, {"ennym_foddey_cadjincliaghtagh", "ennym_dooghyssagh"})
if not subTitle or subTitle == "" then
local entity = mw.wikibase.getEntityObject()
if entity then
local successLang, langData = pcall(mw.loadData, "Module:Lang/data")
if successLang and langData and langData.lang_name_table and langData.lang_name_table.lang then
local statements = entity:getBestStatements("P1448")
if statements and #statements > 0 then
for _, statement in ipairs(statements) do
if statement.mainsnak and statement.mainsnak.datavalue then
local value = statement.mainsnak.datavalue.value
if value and value.text then
local langCode = value.language or ""
local langName = langData.lang_name_table.lang[langCode] or langCode
local nameText = stripLeadingThe(value.text, langCode)
subTitle = nameText .. ' <small>([[' .. langName .. '|' .. langName .. ']])</small>'
break
end
end
end
end
end
end
end
local headerHtml = '<tr class="adr"><th colspan="2" class="fn org country-name" style="line-height:1.2em; padding:0.25em 0.4em 0.33em; font-size:1.25em; text-align:center; font-weight:normal;"><span style="font-weight:bold;">' .. title .. '</span>'
if subTitle and subTitle ~= "" then
headerHtml = headerHtml .. '<div style="padding-top:0.25em; font-weight:normal;">' .. subTitle .. '</div>'
end
headerHtml = headerHtml .. '</th></tr>'
table.insert(rows, headerHtml)
-- Status band under the title (e.g. British Overseas Territory); manual only, none hides it
local status = getManual(args, {"sorçh_croghane"})
if status and mw.ustring.lower(status) ~= "none" then
table.insert(rows, '<tr><td colspan="2" style="text-align:center; font-weight:bold; background-color:#cedff2; padding:0.2em 0.4em;">' .. status .. '</td></tr>')
end
-- ------------------------------------------------ MODULE 2
local successFlags, flagsMod = pcall(require, "Module:Kishtey fys çheer/bratteeyn")
if successFlags and flagsMod and flagsMod.main then
appendModule(flagsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 3
local successSymbols, symbolsMod = pcall(require, "Module:Kishtey fys çheer/cowraghyn")
if successSymbols and symbolsMod and symbolsMod.main then
appendModule(symbolsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 4
local successMaps, mapsMod = pcall(require, "Module:Kishtey fys çheer/caslyssyn-çheerey")
if not successMaps or not mapsMod then
successMaps, mapsMod = pcall(require, "Module:Kishtey fys çheer/caslyssyn")
end
if successMaps and mapsMod and mapsMod.main then
appendModule(mapsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 5
local successCities, citiesMod = pcall(require, "Module:Kishtey fys çheer/balley")
if successCities and citiesMod and citiesMod.main then
appendModule(citiesMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 6
local successLanguages, languagesMod = pcall(require, "Module:Kishtey fys çheer/çhengaghyn")
if successLanguages and languagesMod and languagesMod.main then
appendModule(languagesMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 7
local successEthnic, ethnicMod = pcall(require, "Module:Kishtey fys çheer/possanyn_kynneeagh")
if successEthnic and ethnicMod and ethnicMod.main then
appendModule(ethnicMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 8
local successReligion, religionMod = pcall(require, "Module:Kishtey fys çheer/craueeaght")
if successReligion and religionMod and religionMod.main then
appendModule(religionMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 9
local successGov, govMod = pcall(require, "Module:Kishtey fys çheer/reiltys")
if successGov and govMod and govMod.main then
appendModule(govMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 10
local successArea, areaMod = pcall(require, "Module:Kishtey fys çheer/eaghtyr")
if successArea and areaMod and areaMod.main then
appendModule(areaMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 11
local successPop, popMod = pcall(require, "Module:Kishtey fys çheer/pobble")
if successPop and popMod and popMod.main then
appendModule(popMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 12
local successTarmaynys, tarmaynysMod = pcall(require, "Module:Kishtey fys çheer/tarmaynys")
if successTarmaynys and tarmaynysMod and tarmaynysMod.main then
appendModule(tarmaynysMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 13
local successCoadyn, coadynMod = pcall(require, "Module:Kishtey fys çheer/coadyn")
if successCoadyn and coadynMod and coadynMod.main then
appendModule(coadynMod.main(frame, args))
end
if #rows <= 1 then
return nil
end
return '<table class="infobox geography vcard" style="float:right; clear:right; margin:0.5em 0 1em 1em; width:24.15em; border:1px solid #a2a9b1; border-collapse:collapse; font-size:95%;">' .. table.concat(rows) .. '</table>'
end
return p
atqjkg1flfv1ec84ln1foyvnri95797
394753
394752
2026-10-18T19:25:41Z
MacTire02
219
+linney
394753
Scribunto
text/plain
local p = {}
-- Helper to safely grab template arguments
local function getArgs(frame)
local parent = frame:getParent()
if parent then return parent.args end
return frame.args
end
-- Strips a leading "the "/"The " from an English P1448 name
local function stripLeadingThe(text, langCode)
if langCode == "en" and text:match("^[Tt]he%s+%S") then
return text:gsub("^[Tt]he%s+", "", 1)
end
return text
end
-- Safely get manual parameters from priority list
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and value ~= "" then
local trimmed = value:match("^%s*(.-)%s*$")
if trimmed ~= "" then return trimmed end
end
end
return nil
end
function p.main(frame)
local args = getArgs(frame)
local rows = {}
-- The universal border rule separating your modules
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
-- Centralized module injection manager
local function appendModule(content)
if content and content ~= "" then
if #rows > 0 then
table.insert(rows, dividerLine)
end
table.insert(rows, content)
end
end
-- ------------------------------------------------ MODULE 1
local title = args["ennym"] or mw.title.getCurrentTitle().text
local subTitle = getManual(args, {"ennym_foddey_cadjincliaghtagh", "ennym_dooghyssagh"})
if not subTitle or subTitle == "" then
local entity = mw.wikibase.getEntityObject()
if entity then
local successLang, langData = pcall(mw.loadData, "Module:Lang/data")
if successLang and langData and langData.lang_name_table and langData.lang_name_table.lang then
local statements = entity:getBestStatements("P1448")
if statements and #statements > 0 then
for _, statement in ipairs(statements) do
if statement.mainsnak and statement.mainsnak.datavalue then
local value = statement.mainsnak.datavalue.value
if value and value.text then
local langCode = value.language or ""
local langName = langData.lang_name_table.lang[langCode] or langCode
local nameText = stripLeadingThe(value.text, langCode)
subTitle = nameText .. ' <small>([[' .. langName .. '|' .. langName .. ']])</small>'
break
end
end
end
end
end
end
end
local headerHtml = '<tr class="adr"><th colspan="2" class="fn org country-name" style="line-height:1.2em; padding:0.25em 0.4em 0.33em; font-size:1.25em; text-align:center; font-weight:normal;"><span style="font-weight:bold;">' .. title .. '</span>'
if subTitle and subTitle ~= "" then
headerHtml = headerHtml .. '<div style="padding-top:0.25em; font-weight:normal;">' .. subTitle .. '</div>'
end
headerHtml = headerHtml .. '</th></tr>'
table.insert(rows, headerHtml)
-- Status band under the title (e.g. British Overseas Territory); manual only, none hides it.
-- A divider above it matches the one the module appends below it.
local status = getManual(args, {"sorçh_croghane"})
if status and mw.ustring.lower(status) ~= "none" then
table.insert(rows, dividerLine)
table.insert(rows, '<tr><td colspan="2" style="text-align:center; font-weight:bold; background-color:#cedff2; padding:0.2em 0.4em;">' .. status .. '</td></tr>')
end
-- ------------------------------------------------ MODULE 2
local successFlags, flagsMod = pcall(require, "Module:Kishtey fys çheer/bratteeyn")
if successFlags and flagsMod and flagsMod.main then
appendModule(flagsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 3
local successSymbols, symbolsMod = pcall(require, "Module:Kishtey fys çheer/cowraghyn")
if successSymbols and symbolsMod and symbolsMod.main then
appendModule(symbolsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 4
local successMaps, mapsMod = pcall(require, "Module:Kishtey fys çheer/caslyssyn-çheerey")
if not successMaps or not mapsMod then
successMaps, mapsMod = pcall(require, "Module:Kishtey fys çheer/caslyssyn")
end
if successMaps and mapsMod and mapsMod.main then
appendModule(mapsMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 5
local successCities, citiesMod = pcall(require, "Module:Kishtey fys çheer/balley")
if successCities and citiesMod and citiesMod.main then
appendModule(citiesMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 6
local successLanguages, languagesMod = pcall(require, "Module:Kishtey fys çheer/çhengaghyn")
if successLanguages and languagesMod and languagesMod.main then
appendModule(languagesMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 7
local successEthnic, ethnicMod = pcall(require, "Module:Kishtey fys çheer/possanyn_kynneeagh")
if successEthnic and ethnicMod and ethnicMod.main then
appendModule(ethnicMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 8
local successReligion, religionMod = pcall(require, "Module:Kishtey fys çheer/craueeaght")
if successReligion and religionMod and religionMod.main then
appendModule(religionMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 9
local successGov, govMod = pcall(require, "Module:Kishtey fys çheer/reiltys")
if successGov and govMod and govMod.main then
appendModule(govMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 10
local successArea, areaMod = pcall(require, "Module:Kishtey fys çheer/eaghtyr")
if successArea and areaMod and areaMod.main then
appendModule(areaMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 11
local successPop, popMod = pcall(require, "Module:Kishtey fys çheer/pobble")
if successPop and popMod and popMod.main then
appendModule(popMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 12
local successTarmaynys, tarmaynysMod = pcall(require, "Module:Kishtey fys çheer/tarmaynys")
if successTarmaynys and tarmaynysMod and tarmaynysMod.main then
appendModule(tarmaynysMod.main(frame, args))
end
-- ------------------------------------------------ MODULE 13
local successCoadyn, coadynMod = pcall(require, "Module:Kishtey fys çheer/coadyn")
if successCoadyn and coadynMod and coadynMod.main then
appendModule(coadynMod.main(frame, args))
end
if #rows <= 1 then
return nil
end
return '<table class="infobox geography vcard" style="float:right; clear:right; margin:0.5em 0 1em 1em; width:24.15em; border:1px solid #a2a9b1; border-collapse:collapse; font-size:95%;">' .. table.concat(rows) .. '</table>'
end
return p
qzluw6atkt5tgsmwca6m5ioz77j4zfw
Module:Kishtey fys çheer/balley
828
55830
394741
394631
2026-10-18T15:17:37Z
MacTire02
219
++
394741
Scribunto
text/plain
local p = {}
-- Safely get manual parameters from priority list
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Splits a manual value into link target, display text and any trailing text,
-- e.g. "[[Laayoune]] (''de jure'')" -> "Laayoune", nil, " (''de jure'')".
local function splitManualLink(value)
if not value then return "", nil, nil end
local clean = mw.text.trim(value)
local inner, rest = clean:match("^%[%[(.-)%]%](.*)$")
if not inner then
inner, rest = clean:match("^(.-)%s+(%(''.*)$")
if inner then rest = " " .. rest else inner, rest = clean, "" end
end
rest = (rest ~= "") and rest or nil
local pipe = inner:find("|", 1, true)
if pipe then
local target = mw.text.trim(inner:sub(1, pipe - 1))
local display = mw.text.trim(inner:sub(pipe + 1))
if display == "" then display = nil end
return target, display, rest
end
return mw.text.trim(inner), nil, rest
end
-- Target half only.
local function normaliseCityName(value)
local target = splitManualLink(value)
return target
end
-- Link target, QID, and a display override when the gv label differs from the sitelink.
local function resolveCityItem(id)
local sitelink = mw.wikibase.sitelink(id)
sitelink = (sitelink and sitelink ~= "") and sitelink or nil
local label = mw.wikibase.getLabelByLang(id, "gv") or mw.wikibase.label(id)
label = (label and label ~= "") and label or nil
local target = sitelink or label
if not target then return nil end
local display = (label and label ~= target) and label or nil
return target, id, display
end
-- Wikidata references for a claim value (empty if none).
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
local function snakItemId(snak)
if not (snak and snak.snaktype == "value" and snak.datavalue
and snak.datavalue.type == "wikibase-entityid") then
return nil
end
local value = snak.datavalue.value
return value.id or ("Q" .. tostring(value["numeric-id"]))
end
local function getWikidataCity(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
local id = snakItemId(statements[1].mainsnak)
if not id then return nil end
return resolveCityItem(id)
end
-- P518 ("applies to part") values on a capital statement, in Manx.
local BRANCH_LABELS = {
Q105985 = "briwnyssagh",
Q35798 = "kiannoortagh",
Q11204 = "slattyssagh",
}
-- Every current P36 capital, each with its branch label. Statements with an end time are skipped. A capital
-- below the best rank (e.g. Bolivia: Sucre preferred, La Paz normal) is kept only if it has a P518 branch.
local function getWikidataCapitals()
local result = {}
local entity = mw.wikibase.getEntityObject()
if not entity then return result end
local statements = entity:getAllStatements("P36") or {}
local bestRank = "normal"
for _, statement in ipairs(statements) do
if statement.rank == "preferred" then bestRank = "preferred" end
end
for _, statement in ipairs(statements) do
local quals = statement.qualifiers or {}
local id = snakItemId(statement.mainsnak)
local keep = statement.rank ~= "deprecated" and (statement.rank == bestRank or quals.P518)
if id and keep and not quals.P582 then
local target, qid, display = resolveCityItem(id)
if target then
local branches = {}
for _, snak in ipairs(quals.P518 or {}) do
local label = BRANCH_LABELS[snakItemId(snak) or ""]
if label then table.insert(branches, label) end
end
table.insert(result, { name = target, wdQid = qid, wdDisplay = display, branch = table.concat(branches, ", ") })
end
end
end
return result
end
-- QID of a current P36 capital matching a typed city name, for coordinates when that city has no gv article.
local function findCapitalQid(name)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local want = name:lower()
for _, statement in ipairs(entity:getAllStatements("P36") or {}) do
local id = snakItemId(statement.mainsnak)
if id then
local target, qid, display = resolveCityItem(id)
if (target and target:lower() == want) or (display and display:lower() == want) then return qid end
end
end
return nil
end
-- {{coord}} from a QID's P625, always DMS.
local function getCoordinatesForQid(frame, qid)
if not qid then return nil end
local entity = mw.wikibase.getEntityObject(qid)
if not entity then return nil end
local statements = entity:getBestStatements("P625")
if not statements or #statements == 0 then return nil end
local mainsnak = statements[1].mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "globecoordinate") then
return nil
end
local coord = mainsnak.datavalue.value
if not (coord.latitude and coord.longitude) then return nil end
return frame:expandTemplate{
title = "coord",
args = { coord.latitude, coord.longitude, "type:city", display = "inline", format = "dms" }
}
end
-- Coordinates for a manually typed name, via its gv sitelink only.
local function getCityCoordinates(frame, pageTitle)
if not pageTitle or pageTitle == "" then return nil end
local id = mw.wikibase.getEntityIdForTitle(pageTitle)
return getCoordinatesForQid(frame, id)
end
-- Manual coordinates from component params: "suppress", a {{coord}} expansion, or nil.
local function getManualCoordinates(frame, args, degParam, minParam, nsParam, lonDegParam, lonMinParam, ewParam)
-- Accepts one name or a list of alternate spellings.
local function names(p)
if type(p) == "table" then return p end
return { p }
end
local latd = getManual(args, names(degParam))
if not latd then return nil end
if isNone(latd) then return "suppress" end
local latm = getManual(args, names(minParam)) or ""
local latNS = getManual(args, names(nsParam)) or ""
local longd = getManual(args, names(lonDegParam)) or ""
local longm = getManual(args, names(lonMinParam)) or ""
local longEW = getManual(args, names(ewParam)) or ""
return frame:expandTemplate{
title = "coord",
args = { latd, latm, latNS, longd, longm, longEW, "type:city", display = "inline", format = "dms" }
}
end
-- Prevents coordinates from line-wrapping in the infobox's narrow column
-- ({{coord}}'s output has plain spaces the browser is free to break on).
local function coordSpan(coordText)
if not coordText or coordText == "" then return "" end
return '<br/><small style="white-space:nowrap;">' .. coordText .. '</small>'
end
-- Manual coordinates win, =none suppresses, else Wikidata (by QID if known, else gv title).
local function resolveEntryCoordinates(frame, args, coordSuffix, cleanName, wdQid)
-- Both underscore and hyphen spellings.
local function both(prefix)
return { prefix .. "_balley_smoo" .. coordSuffix, prefix .. "_balley-smoo" .. coordSuffix }
end
local manual = getManualCoordinates(frame, args,
both("latd"), both("latm"), both("latNS"),
both("longd"), both("longm"), both("longEW"))
if manual == "suppress" then return nil end
if manual then return manual end
if wdQid then return getCoordinatesForQid(frame, wdQid) end
return getCityCoordinates(frame, cleanName) or getCoordinatesForQid(frame, findCapitalQid(cleanName))
end
-- Maximum number of largest-city slots.
local MAX_LARGEST = 3
-- Border classes for a run of merged rows, matching reiltys.lua's own
-- convention for a header followed by bulleted sub-rows.
local function trClass(class)
return ' class="' .. class .. '"'
end
-- Collects largest-city entries; Wikidata fallback for slot 1 only.
local function collectLargestEntries(args)
local entries = {}
for i = 1, MAX_LARGEST do
local suffix = tostring(i)
-- Underscore and hyphen spellings accepted at every slot.
local nameNames = { "balley_smoo" .. suffix, "balley-smoo" .. suffix }
local qualNames = { "sorçh_balley_smoo" .. suffix, "sorçh_balley-smoo" .. suffix }
local noteNames = { "noteyn_balley_smoo" .. suffix, "noteyn_balley-smoo" .. suffix }
local coordSuffix = suffix
if i == 1 then
-- Bare form is a synonym for slot 1 (its coordinate params stay unsuffixed).
table.insert(nameNames, 1, "balley-smoo")
table.insert(nameNames, 1, "balley_smoo")
table.insert(qualNames, 1, "sorçh_balley-smoo")
table.insert(qualNames, 1, "sorçh_balley_smoo")
table.insert(noteNames, 1, "noteyn_balley-smoo")
table.insert(noteNames, 1, "noteyn_balley_smoo")
coordSuffix = ""
end
local nameRaw = getManual(args, nameNames)
if isNone(nameRaw) then
-- Explicit none: no Wikidata fallback.
elseif nameRaw then
table.insert(entries, {
name = nameRaw,
qualifier = getManual(args, qualNames),
note = getManual(args, noteNames),
coordSuffix = coordSuffix,
})
elseif i == 1 then
-- Deeper slots are manual-only.
local wd, wdQid, wdDisplay = getWikidataCity("P13574")
if wd then
table.insert(entries, { name = wd, qualifier = nil, note = getManual(args, noteNames), coordSuffix = "", wdQid = wdQid, wdDisplay = wdDisplay })
end
end
end
return entries
end
-- Maximum number of capital slots.
local MAX_CAPITALS = 5
-- Slot 1 uses the bare legacy names, slots 2+ a numeric suffix. The bare |sorçh_preeu-valley= is the row label,
-- so slot 1's qualifier is |sorçh_preeu-valley1=. Slot 1 = none suppresses the row. With no manual slot set,
-- every current P36 capital is used; if only slots 2+ are set, Wikidata's first capital fills slot 1.
-- With several capitals each gets its P518 branch label (a manual qualifier overrides it, none hides it).
local function collectCapitalEntries(args)
local entries = {}
local hasSlot1 = false
local wdCapitals
local function wdList()
wdCapitals = wdCapitals or getWikidataCapitals()
return wdCapitals
end
local function noteNamesFor(i)
local names = { "noteyn_preeu-valley" .. i }
if i == 1 then table.insert(names, 1, "noteyn_preeu-valley") end
return names
end
local function qualifierFor(i)
local qualifier = getManual(args, { "sorçh_preeu-valley" .. i })
if isNone(qualifier) then return nil, true end
return qualifier, false
end
for i = 1, MAX_CAPITALS do
local nameNames = { "preeu-valley" .. i }
if i == 1 then table.insert(nameNames, 1, "preeu-valley") end
local nameRaw = getManual(args, nameNames)
if isNone(nameRaw) then
if i == 1 then return {} end
elseif nameRaw then
if i == 1 then hasSlot1 = true end
local qualifier, noTag = qualifierFor(i)
table.insert(entries, {
name = nameRaw, qualifier = qualifier, noTag = noTag,
note = getManual(args, noteNamesFor(i)),
coordSuffix = (i == 1) and "" or tostring(i),
})
end
end
if #entries > 0 and not hasSlot1 then
local first = wdList()[1]
local wd, wdQid, wdDisplay
if first then
wd, wdQid, wdDisplay = first.name, first.wdQid, first.wdDisplay
else
wd, wdQid, wdDisplay = getWikidataCity("P36")
end
local duplicate = false
for _, e in ipairs(entries) do
if wd and normaliseCityName(e.name):lower() == wd:lower() then duplicate = true end
end
if wd and not duplicate then
local qualifier, noTag = qualifierFor(1)
table.insert(entries, 1, {
name = wd, wdQid = wdQid, wdDisplay = wdDisplay,
qualifier = qualifier, noTag = noTag,
note = getManual(args, noteNamesFor(1)),
coordSuffix = "",
})
end
end
if #entries == 0 then
local list = wdList()
if #list == 0 then
local wd, wdQid, wdDisplay = getWikidataCity("P36")
if wd then list = { { name = wd, wdQid = wdQid, wdDisplay = wdDisplay, branch = "" } } end
end
for i, cap in ipairs(list) do
if i > MAX_CAPITALS then break end
local qualifier, noTag = qualifierFor(i)
table.insert(entries, {
name = cap.name, wdQid = cap.wdQid, wdDisplay = cap.wdDisplay,
qualifier = qualifier, noTag = noTag,
note = getManual(args, noteNamesFor(i)),
coordSuffix = (i == 1) and "" or tostring(i),
})
end
end
-- Several capitals: an entry matching a Wikidata capital takes that capital's branch label.
if #entries > 1 then
for _, entry in ipairs(entries) do
if not entry.qualifier and not entry.noTag then
local want = normaliseCityName(entry.name):lower()
for _, cap in ipairs(wdList()) do
if cap.branch ~= "" and (cap.name:lower() == want or (cap.wdDisplay and cap.wdDisplay:lower() == want)) then
entry.qualifier = cap.branch
end
end
end
end
end
return entries
end
-- Manual params win (slot N uses suffix N), =none suppresses, else Wikidata via QID, else gv title.
local function resolveCapitalCoordinates(frame, args, entry, cleanName)
local function names(prefix)
if entry.coordSuffix == "" then return { prefix, prefix .. "1" } end
return { prefix .. entry.coordSuffix }
end
local manual = getManualCoordinates(frame, args,
names("latd"), names("latm"), names("latNS"),
names("longd"), names("longm"), names("longEW"))
if manual == "suppress" then return nil end
if manual then return manual end
if entry.wdQid then return getCoordinatesForQid(frame, entry.wdQid) end
return getCityCoordinates(frame, cleanName) or getCoordinatesForQid(frame, findCapitalQid(cleanName))
end
function p.main(frame, args)
-- Fallback verification to catch argument slots accurately if frame context shifts
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local capitalEntries = collectCapitalEntries(args)
local administrative = getManual(args, {"ynnyd_reiragh"})
local adminNote = getManual(args, {"noteyn_ynnyd_reiragh"})
-- Bare latd etc. bind to the capital's slot 1, else the administrative centre.
local manualPrimaryCoords = getManualCoordinates(frame, args, "latd", "latm", "latNS", "longd", "longm", "longEW")
local hasCapital = #capitalEntries > 0
-- With one capital, a duplicate largest city is dropped and noted as "(as y balley smoo)";
-- with several, every largest city is listed in its own row, with coordinates.
local multiple = #capitalEntries > 1
local allEntries = collectLargestEntries(args)
local largestEntries = {}
local isSameAny = false
for _, entry in ipairs(allEntries) do
local cleanLower = mw.text.trim(entry.name):lower()
local isSentinel = (cleanLower == "preeu-valley" or cleanLower == "preeu_valley")
local largestLower = normaliseCityName(entry.name):lower()
local matchesCapital = false
for _, capEntry in ipairs(capitalEntries) do
if normaliseCityName(capEntry.name):lower() == largestLower then matchesCapital = true end
end
if multiple then
if not isSentinel then table.insert(largestEntries, entry) end
elseif isSentinel or matchesCapital then
isSameAny = true
else
table.insert(largestEntries, entry)
end
end
-- Rows are collected first, then classed by position: {th (nil = continuation row), rowspan, td}.
local pending = {}
-- With several capitals the label rowspans all rows.
if hasCapital then
local label = args["sorçh_preeu-valley"] or "Preeu-valley"
local displayLabel = '[[' .. label .. ']]'
if isSameAny then
displayLabel = '[[' .. label .. ']]<br/><small style="font-weight:normal;">(as y balley smoo)</small>'
end
for idx, entry in ipairs(capitalEntries) do
-- Manual display text is kept.
local cleanCapName, capManualDisplay, capTrailing = splitManualLink(entry.name)
local capDisplayName = entry.wdDisplay or capManualDisplay or cleanCapName
local text = '[[' .. cleanCapName .. '|' .. capDisplayName .. ']]'
if capTrailing then text = text .. capTrailing end
if entry.qualifier and entry.qualifier ~= "" then
text = text .. ' (' .. entry.qualifier .. ')'
end
if entry.note and entry.note ~= "" then
text = text .. frame:expandTemplate{ title = "efn", args = { entry.note } }
end
if entry.wdQid then text = text .. (getWdCitation("P36", entry.wdQid) or "") end
-- Slot 1 uses the bare coordinate params; slots 2-3 use suffixed ones.
local capCoords
if entry.coordSuffix == "" and manualPrimaryCoords == "suppress" then
capCoords = nil
elseif entry.coordSuffix == "" and manualPrimaryCoords then
capCoords = manualPrimaryCoords
else
capCoords = resolveCapitalCoordinates(frame, args, entry, cleanCapName)
end
text = text .. coordSpan(capCoords)
if idx == 1 then
table.insert(pending, { th = displayLabel, rowspan = multiple and #capitalEntries or nil, td = text })
else
table.insert(pending, { th = nil, td = text })
end
end
end
-- Capital in exile: free wikitext, shown as its own row.
local exile = getManual(args, {"preeu-valley_ayns_eebyrtys"})
if exile and not isNone(exile) then
local exileLabel = args["sorçh_preeu-valley_ayns_eebyrtys"] or "Preeu-valley ayns eebyrtys"
local exileNote = getManual(args, {"noteyn_preeu-valley_ayns_eebyrtys"})
if exileNote then exile = exile .. frame:expandTemplate{ title = "efn", args = { exileNote } } end
table.insert(pending, { th = '[[' .. exileLabel .. ']]', wrap = true, td = exile })
end
-- 2. ADMINISTRATIVE CENTER
if administrative and mw.text.trim(administrative):lower() ~= "none" then
local label = args["sorçh_ynnyd_reiragh"] or "Ynnyd reiragh"
-- Manual display text is kept.
local cleanAdminName, adminManualDisplay, adminTrailing = splitManualLink(administrative)
local text = '[[' .. cleanAdminName .. '|' .. (adminManualDisplay or cleanAdminName) .. ']]' .. (adminTrailing or '')
if adminNote and adminNote ~= "" then
text = text .. frame:expandTemplate{ title = "efn", args = { adminNote } }
end
-- Manual-override-only -- no Wikidata coordinate fetch for an
-- administrative centre (the old template never had one either).
if not hasCapital then
local adminCoords
if manualPrimaryCoords == "suppress" then
adminCoords = nil
elseif manualPrimaryCoords then
adminCoords = manualPrimaryCoords
end
text = text .. coordSpan(adminCoords)
end
table.insert(pending, { th = '[[' .. label .. ']]', td = text })
end
-- With several entries the first <th> rowspans them all.
if #largestEntries > 0 then
local total = #largestEntries
for idx, entry in ipairs(largestEntries) do
-- Wikidata and manual display overrides are never both set.
local cleanLargeName, largeManualDisplay, largeTrailing = splitManualLink(entry.name)
local largeDisplayName = entry.wdDisplay or largeManualDisplay or cleanLargeName
local text = '[[' .. cleanLargeName .. '|' .. largeDisplayName .. ']]'
if largeTrailing then text = text .. largeTrailing end
if entry.qualifier and entry.qualifier ~= "" then
text = text .. ' (' .. entry.qualifier .. ')'
end
if entry.note and entry.note ~= "" then
text = text .. frame:expandTemplate{ title = "efn", args = { entry.note } }
end
if entry.wdQid then text = text .. (getWdCitation("P13574", entry.wdQid) or "") end
text = text .. coordSpan(resolveEntryCoordinates(frame, args, entry.coordSuffix, cleanLargeName, entry.wdQid))
if idx == 1 then
table.insert(pending, { th = "Balley smoo", rowspan = (total > 1) and total or nil, td = text })
else
table.insert(pending, { th = nil, td = text })
end
end
end
if #pending == 0 then return nil end
-- Lone row gets no class; otherwise top/middle/bottom merged classes.
local subRows = {}
local total = #pending
for idx, row in ipairs(pending) do
local class
if total == 1 then
class = ""
elseif idx == 1 then
class = "mergedtoprow"
elseif idx == total then
class = "mergedbottomrow"
else
class = "mergedrow"
end
local classAttr = (class ~= "") and trClass(class) or ""
if row.th then
local rowspanAttr = row.rowspan and (' rowspan="' .. row.rowspan .. '"') or ''
table.insert(subRows, '<tr' .. classAttr .. '><th' .. rowspanAttr .. ' style="vertical-align:top; ' .. (row.wrap and '' or 'white-space:nowrap; ') .. 'text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">' .. row.th .. '</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. row.td .. '</td></tr>')
else
table.insert(subRows, '<tr' .. classAttr .. '><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. row.td .. '</td></tr>')
end
end
return table.concat(subRows)
end
return p
iksv6ddmwtepx0frku1vjwc5mmhc04k
Module:Kishtey fys çheer/bratteeyn
828
55831
394751
394584
2026-10-18T16:31:05Z
MacTire02
219
mooadys
394751
Scribunto
text/plain
local p = {}
local enmynCheerey = require("Module:Enmyn çheerey")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then return mw.text.trim(value) end
end
return nil
end
local function getWikidataImage(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue and mainsnak.datavalue.type == "string" then
local file = mainsnak.datavalue.value
if file and file ~= "" then return file end
end
end
return nil
end
local NON_RECTANGULAR_FLAGS = {
["Flag of Nepal.svg"] = true,
["Flag of Ohio.svg"] = true,
["Flag of Switzerland.svg"] = true,
}
local function needsFlagBorder(flagFile)
if not flagFile then return true end
if NON_RECTANGULAR_FLAGS[flagFile] then return false end
if mw.ustring.find(mw.ustring.lower(flagFile), "nepal") then return false end
return true
end
-- Default arms size fits a 85x85px box, so tall shields stay level with the flag
-- Manx article after a vowel-final word
local function joinKindAndName(kind, name)
local lastChar = mw.ustring.sub(mw.ustring.lower(kind), -1)
if mw.ustring.find(lastChar, "^[aeiouyàáâèéêìíîòóôùúû]$") then
local rest = mw.ustring.match(name, "^[Yy] (.+)$")
if rest then name = "yn " .. rest end
end
return kind .. " " .. name
end
function p.main(frame, args)
local flag = getManual(args, {"jalloo_brattagh"})
if flag and mw.ustring.lower(flag) == "none" then flag = nil elseif not flag then flag = getWikidataImage("P41") end
local flag2 = getManual(args, {"jalloo_brattagh_2", "jalloo_brattagh_elley"})
if flag2 and mw.ustring.lower(flag2) == "none" then flag2 = nil elseif not flag2 then flag2 = getWikidataImage("P163") end
local arms = getManual(args, {"jalloo_armys", "jalloo_cleinney", "jalloo_cowrey"})
if arms and mw.ustring.lower(arms) == "none" then arms = nil elseif not arms then arms = getWikidataImage("P94") end
local arms2 = getManual(args, {"jalloo_armys_2", "jalloo_cleinney_2"})
if arms2 and mw.ustring.lower(arms2) == "none" then arms2 = nil elseif not arms2 then arms2 = getWikidataImage("P237") end
if not flag and not flag2 and not arms and not arms2 then return nil end
local nameRaw = getManual(args, {"ennym_gienneydagh", "ennym", "ennym_çheerey", "ennym_çheer"}) or (mw.title.getCurrentTitle() and mw.title.getCurrentTitle().text) or ""
local name = enmynCheerey.genitive(nameRaw)
local data = { flags = {}, armses = {} }
if flag then
table.insert(data.flags, { image = flag, width = getManual(args, {"lheead_brattagh"}) or "125px", hasBorder = needsFlagBorder(flag), link = "Brattagh " .. name, label = getManual(args, {"fo-heidyl_brattagh"}) or "Brattagh" })
end
if flag2 then
table.insert(data.flags, { image = flag2, width = getManual(args, {"lheead_brattagh_2", "lheead_brattagh"}) or "100px", hasBorder = needsFlagBorder(flag2), link = "Brattagh " .. name, label = getManual(args, {"fo-heidyl_brattagh_2"}) or "Brattagh elley" })
end
if arms then
local kind = getManual(args, {"art_sorçh_cowrey", "sorçh_cowrey"}) or "Armys"
table.insert(data.armses, { image = arms, width = getManual(args, {"lheead_armys", "lheead_cleinney", "lheead_cowrey"}) or "85x85px", link = joinKindAndName(kind, name), label = getManual(args, {"sorçh_cowrey"}) or "Armys" })
end
if arms2 then
table.insert(data.armses, { image = arms2, width = getManual(args, {"lheead_armys_2", "lheead_cleinney_2"}) or "85x85px", link = joinKindAndName(getManual(args, {"art_sorçh_cowrey_2", "sorçh_cowrey_2"}) or "Armys", name), label = getManual(args, {"sorçh_cowrey_2"}) or "Armys" })
end
local imageCells = {}
local captionCells = {}
local hasFlags = #data.flags > 0
local hasArms = #data.armses > 0
if hasFlags then
local flagContent = {}
for _, f in ipairs(data.flags) do
-- `|border` is the real image option for the thumbborder line
-- ("|style=..." is not valid inline image markup).
local border = f.hasBorder and '|border' or ""
table.insert(flagContent, '[[Coadan:' .. f.image .. '|' .. f.width .. border .. ']]')
end
-- Inline style="text-align:center;" (not the deprecated align= attribute) so mobile skins can't
table.insert(imageCells, '<td style="text-align:center; ' .. (hasArms and "width:58%; " or "width:100%; ") .. 'vertical-align:middle;">' .. table.concat(flagContent, '<br/>') .. '</td>')
-- Plain size, matching every other label
local flagCaptions = {}
for _, f in ipairs(data.flags) do table.insert(flagCaptions, '[[' .. f.link .. '|' .. f.label .. ']]') end
table.insert(captionCells, '<td style="text-align:center;">' .. table.concat(flagCaptions, '<br/>') .. '</td>')
end
if hasArms then
local armsContent = {}
for _, a in ipairs(data.armses) do table.insert(armsContent, '[[Coadan:' .. a.image .. '|' .. a.width .. ']]') end
table.insert(imageCells, '<td style="text-align:center; width:auto; vertical-align:middle;">' .. table.concat(armsContent, '<br/>') .. '</td>')
local armsCaptions = {}
for _, a in ipairs(data.armses) do table.insert(armsCaptions, '[[' .. a.link .. '|' .. a.label .. ']]') end
table.insert(captionCells, '<td style="text-align:center;">' .. table.concat(armsCaptions, '<br/>') .. '</td>')
end
return '<tr><td colspan="2" style="text-align:center; padding:0.5em 0.4em;"><table style="text-align:center; width:100%; background:none; margin:0 auto;"><tr>' .. table.concat(imageCells) .. '</tr><tr>' .. table.concat(captionCells) .. '</tr></table></td></tr>'
end
return p
3mrctg11c67yhnynuebh7t25wocd1py
Module:Kishtey fys çheer/cowraghyn
828
55832
394738
394652
2026-10-18T15:16:33Z
MacTire02
219
++
394738
Scribunto
text/plain
local p = {}
-- Max |jarroo-raaN= motto-name slots checked, beyond the bare/slot-1 spelling
local MAX_MOTTO_NAMES = 6
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then return mw.text.trim(value) end
end
return nil
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Wikidata references for a claim (empty if none). value = raw item id; nil + single=true takes the first best statement.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value, single)
if not wdOK or not Wd or not Wd._reference then return nil end
local callArgs = {"best"}
if single then table.insert(callArgs, "single") end
table.insert(callArgs, property)
if value then table.insert(callArgs, value) end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- Wraps a plain language name in [[...]] unless already a wikilink (avoids
-- double-bracketing a manual override), same guard as reiltys.lua's wikilinkLabel.
local function linkPlainText(text)
if not text or text == "" then return text end
if mw.ustring.find(text, "%[%[") then return text end
return "[[" .. text .. "]]"
end
local function getMottoData(args)
local motto = getManual(args, {"jarroo-raa_ashoonagh", "jarroo_raa", "jarroo-raa", "jarroo-raa1"})
-- |jarroo-raa=none suppresses the motto entirely (manual text AND the
-- Wikidata fallback) -- override valve for bad Wikidata data.
if motto and mw.ustring.lower(motto) == "none" then
return nil
end
local reference = getManual(args, {"imraa_jarroo_raa", "imraa_jarroo-raa"})
local chyndaa = getManual(args, {"çhyndaa_jarroo-raa", "chyndaa_jarroo-raa", "çhyndaa_jarroo_raa", "chyndaa_jarroo_raa"})
-- Transliteration is per-name, not shared (slot 1 keeps the bare,
-- unnumbered spelling as a synonym, same as çhengey_jarroo-raa).
local tessen = getManual(args, {"tessen-lettyraghey_jarroo-raa", "tessen-lettyraghey_jarroo_raa", "tessen-lettyraghey_jarroo-raa1", "tessen-lettyraghey_jarroo_raa1"})
local chengey = getManual(args, {"çhengey_jarroo-raa", "çhengey_jarroo_raa", "çhengey_jarroo-raa1", "çhengey_jarroo_raa1"})
-- A motto can have more than one equally official name
local names = {}
local wdMottoRef = nil
if motto then
table.insert(names, { text = motto, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
else
local entity = mw.wikibase.getEntityObject()
if entity then
local statements = entity:getBestStatements("P1451")
if statements and #statements > 0 then
for _, statement in ipairs(statements) do
if statement.mainsnak and statement.mainsnak.datavalue then
local value = statement.mainsnak.datavalue.value
if value and value.text then
table.insert(names, { text = value.text, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
wdMottoRef = getWdCitation("P1451", nil, true)
break
end
end
end
end
end
end
-- distinctMode: true once a second/third motto has its OWN translation set -- signals two genuinely
local distinctMode = false
for i = 2, MAX_MOTTO_NAMES do
-- Hyphen-only: "jarroo-raa" is one hyphenated word, not two words joined by a separator, so
local extra = getManual(args, {"jarroo-raa" .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
local extraChengey = getManual(args, {"çhengey_jarroo-raa" .. i, "çhengey_jarroo_raa" .. i})
local extraTessen = getManual(args, {"tessen-lettyraghey_jarroo-raa" .. i, "tessen-lettyraghey_jarroo_raa" .. i})
local extraChyndaa = getManual(args, {"çhyndaa_jarroo-raa" .. i, "chyndaa_jarroo-raa" .. i, "çhyndaa_jarroo_raa" .. i, "chyndaa_jarroo_raa" .. i})
if extraChyndaa and extraChyndaa ~= "" then distinctMode = true end
table.insert(names, { text = extra, chengey = extraChengey, tessen = extraTessen, chyndaa = extraChyndaa })
end
end
if #names == 0 then return nil end
local finalRef = wrapReference(reference) or wdMottoRef
return { names = names, reference = finalRef, chyndaa = chyndaa, distinctMode = distinctMode }
end
-- Given a property holding an item value (e.g. P85 = anthem), resolves the linked item to a page
local function getWikidataItemInfo(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
local statement = statements[1]
local mainsnak = statement.mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid") then
return nil
end
local value = mainsnak.datavalue.value
local id = value.id or ("Q" .. tostring(value["numeric-id"]))
local title = mw.wikibase.sitelink(id)
if not title or title == "" then
title = mw.wikibase.getLabelByLang(id, "gv") or mw.wikibase.label(id)
end
if not title or title == "" then return nil end
local audioQuals = statement.qualifiers and statement.qualifiers.P51
local audioSnak = audioQuals and audioQuals[1]
local qualifierAudio = audioSnak and audioSnak.snaktype == "value" and audioSnak.datavalue
and audioSnak.datavalue.type == "string" and audioSnak.datavalue.value
if qualifierAudio == "" then qualifierAudio = nil end
return { id = id, title = title, qualifierAudio = qualifierAudio }
end
-- Returns a Wikidata item's own standalone P51 (audio) file, if any -- as
-- opposed to the per-country qualifier checked first above.
local function getWikidataAudioFile(id)
if not id then return nil end
local entity = mw.wikibase.getEntityObject(id)
if not entity then return nil end
local statements = entity:getBestStatements("P51")
if not statements or #statements == 0 then return nil end
local mainsnak = statements[1].mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "string") then
return nil
end
local file = mainsnak.datavalue.value
if file and file ~= "" then return file end
return nil
end
-- Codepoint ranges treated as Latin/script-neutral for italicisation
local function isLatinOrNeutral(cp)
if cp < 0x80 then return true end
if cp <= 0x02AF then return true end
if cp >= 0x0300 and cp <= 0x036F then return true end
if cp >= 0x1E00 and cp <= 0x1EFF then return true end
if cp >= 0x2000 and cp <= 0x206F then return true end
return false
end
local function isNonLatinScript(text)
if not text or text == "" then return false end
local length = mw.ustring.len(text)
if not length or length == 0 then return false end
local codepoints = { mw.ustring.codepoint(text, 1, length) }
for _, cp in ipairs(codepoints) do
if not isLatinOrNeutral(cp) then return true end
end
return false
end
function p.main(frame, args)
local motto = getMottoData(args)
local rows = {}
if motto then
-- One line per official name. Each gets its own script-based
-- italics, language tag, and transliteration.
local nameLines = {}
for _, nameEntry in ipairs(motto.names) do
-- mw.ustring.gsub (codepoint-aware), not plain :gsub
local nameText = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
-- Italicised purely by script (MOS:FOREIGNITALIC), wikilink or not.
if not isNonLatinScript(nameText) then
nameText = "''" .. nameText .. "''"
end
-- çhengey_jarroo-raa names the motto's own language
if nameEntry.chengey and nameEntry.chengey ~= "" then
nameText = nameText .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
-- A transliteration is always Latin-script, so quotes, not
-- italics -- attached to this name's own line.
if nameEntry.tessen and nameEntry.tessen ~= "" then
nameText = nameText .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
-- Distinct mottos: each one's own translation goes directly
-- under its own line, not deferred to the very end.
if motto.distinctMode and nameEntry.chyndaa and nameEntry.chyndaa ~= "" then
nameText = nameText .. " <br/><small>“" .. nameEntry.chyndaa .. "”</small>"
end
table.insert(nameLines, nameText)
end
local baseText = table.concat(nameLines, "<br/>")
local mottoNote = getManual(args, {"noteyn_jarroo-raa", "noteyn_jarroo_raa"})
if mottoNote and mottoNote ~= "" then
baseText = baseText .. frame:expandTemplate{ title = "efn", args = { mottoNote } }
end
if motto.reference then baseText = baseText .. motto.reference end
-- One shared motto restated in multiple languages: single shared
-- translation shown once at the very end.
if not motto.distinctMode and motto.chyndaa and motto.chyndaa ~= "" then baseText = baseText .. " <br/><small>“" .. motto.chyndaa .. "”</small>" end
table.insert(rows, "'''[[Jarroo-raa]]: '''" .. baseText)
end
-- wikidataProperty is optional: pass a property (e.g. "P85") to fall
-- back to Wikidata when no manual parameter is set for this anthem slot.
local function formatAnthem(label, key, wikidataProperty)
local title = getManual(args, {key, key .. "1"})
-- |<key>=none suppresses this row entirely.
if title and mw.ustring.lower(title) == "none" then
return
end
local wikidataInfo = nil
if not title and wikidataProperty then
wikidataInfo = getWikidataItemInfo(wikidataProperty)
if wikidataInfo then title = wikidataInfo.title end
end
if not title then return end
-- |gyn_cowraghyn_aaraa_<key>= suppresses the curly quotes otherwise always wrapped around the title
local suppressQuotes = getManual(args, {"gyn_cowraghyn_aaraa_" .. key, "gyn_cowraghyn_aaraa_" .. key .. "1"}) ~= nil
-- One line per official title (e.g. a bilingual anthem, same tune, two equally-official lyrics sets)
local names = {
{ text = title,
chengey = getManual(args, {"çhengey_" .. key, "çhengey_" .. key .. "1"}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key, "tessen-lettyraghey_" .. key .. "1"}) },
}
for i = 2, 3 do
local extra = getManual(args, {key .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
table.insert(names, {
text = extra,
chengey = getManual(args, {"çhengey_" .. key .. i}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key .. i}),
})
end
end
local nameLines = {}
for _, nameEntry in ipairs(names) do
-- Same UTF-8-safe quote-stripping as the motto above.
local clean = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
if not mw.ustring.find(clean, "%[%[") then clean = '[[' .. clean .. '|' .. clean .. ']]' end
local line = suppressQuotes and clean or ('“' .. clean .. '”')
if nameEntry.chengey and nameEntry.chengey ~= "" then
line = line .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
if nameEntry.tessen and nameEntry.tessen ~= "" then
line = line .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
table.insert(nameLines, line)
end
local display = table.concat(nameLines, "<br/>")
local note = getManual(args, {"noteyn_" .. key})
if note and note ~= "" then display = display .. frame:expandTemplate{ title = "efn", args = { note } } end
local ref = getManual(args, {"imraa_" .. key})
if ref then
display = display .. wrapReference(ref)
elseif wikidataInfo then
display = display .. (getWdCitation(wikidataProperty, wikidataInfo.id) or "")
end
local chyndaa = getManual(args, {"çhyndaa_" .. key, "chyndaa_" .. key})
if chyndaa and chyndaa ~= "" then
if suppressQuotes then
display = display .. " <br/><small>" .. chyndaa .. "</small>"
else
display = display .. " <br/><small>“" .. chyndaa .. "”</small>"
end
end
local audio = getManual(args, {"coadan_" .. key})
if (not audio or audio == "") and wikidataInfo then
-- Prefer a per-country qualifier over the anthem item's own
-- standalone P51.
audio = wikidataInfo.qualifierAudio or getWikidataAudioFile(wikidataInfo.id)
end
if audio and audio ~= "" then display = display .. '<br/><div style="text-align:center; margin-top:0.3em;">[[Coadan:' .. audio .. '|center]]</div>' end
table.insert(rows, "'''" .. label .. ": '''" .. display)
end
formatAnthem("[[Arrane ashoonagh]]", "arrane_ashoonagh", "P85")
formatAnthem("Anthym", "arrane")
formatAnthem("[[Arrane reeoil]]", "arrane_reeoil")
if #rows == 0 then return nil end
return '<tr><td colspan="2" style="padding:0.4em; line-height:1.2em; text-align:center;">' .. table.concat(rows, "<br/>") .. '</td></tr>'
end
return p
tux05utn200ddotunkxtfzicqvdsd6i
394780
394738
2026-10-19T10:57:38Z
MacTire02
219
va cowrey elley scrysst
394780
Scribunto
text/plain
local p = {}
-- Max |jarroo-raaN= motto-name slots checked, beyond the bare/slot-1 spelling
local MAX_MOTTO_NAMES = 6
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then return mw.text.trim(value) end
end
return nil
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Wikidata references for a claim (empty if none). value = raw item id; nil + single=true takes the first best statement.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value, single)
if not wdOK or not Wd or not Wd._reference then return nil end
local callArgs = {"best"}
if single then table.insert(callArgs, "single") end
table.insert(callArgs, property)
if value then table.insert(callArgs, value) end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- Wraps a plain language name in [[...]] unless already a wikilink (avoids
-- double-bracketing a manual override), same guard as reiltys.lua's wikilinkLabel.
local function linkPlainText(text)
if not text or text == "" then return text end
if mw.ustring.find(text, "%[%[") then return text end
return "[[" .. text .. "]]"
end
local function getMottoData(args)
local motto = getManual(args, {"jarroo-raa_ashoonagh", "jarroo_raa", "jarroo-raa", "jarroo-raa1"})
-- |jarroo-raa=none suppresses the motto entirely (manual text AND the
-- Wikidata fallback) -- override valve for bad Wikidata data.
if motto and mw.ustring.lower(motto) == "none" then
return nil
end
local reference = getManual(args, {"imraa_jarroo_raa", "imraa_jarroo-raa"})
local chyndaa = getManual(args, {"çhyndaa_jarroo-raa", "chyndaa_jarroo-raa", "çhyndaa_jarroo_raa", "chyndaa_jarroo_raa"})
-- Transliteration is per-name, not shared (slot 1 keeps the bare,
-- unnumbered spelling as a synonym, same as çhengey_jarroo-raa).
local tessen = getManual(args, {"tessen-lettyraghey_jarroo-raa", "tessen-lettyraghey_jarroo_raa", "tessen-lettyraghey_jarroo-raa1", "tessen-lettyraghey_jarroo_raa1"})
local chengey = getManual(args, {"çhengey_jarroo-raa", "çhengey_jarroo_raa", "çhengey_jarroo-raa1", "çhengey_jarroo_raa1"})
-- A motto can have more than one equally official name
local names = {}
local wdMottoRef = nil
if motto then
table.insert(names, { text = motto, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
else
local entity = mw.wikibase.getEntityObject()
if entity then
local statements = entity:getBestStatements("P1451")
if statements and #statements > 0 then
for _, statement in ipairs(statements) do
if statement.mainsnak and statement.mainsnak.datavalue then
local value = statement.mainsnak.datavalue.value
if value and value.text then
table.insert(names, { text = value.text, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
wdMottoRef = getWdCitation("P1451", nil, true)
break
end
end
end
end
end
end
-- distinctMode: true once a second/third motto has its OWN translation set -- signals two genuinely
local distinctMode = false
for i = 2, MAX_MOTTO_NAMES do
-- Hyphen-only: "jarroo-raa" is one hyphenated word, not two words joined by a separator, so
local extra = getManual(args, {"jarroo-raa" .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
local extraChengey = getManual(args, {"çhengey_jarroo-raa" .. i, "çhengey_jarroo_raa" .. i})
local extraTessen = getManual(args, {"tessen-lettyraghey_jarroo-raa" .. i, "tessen-lettyraghey_jarroo_raa" .. i})
local extraChyndaa = getManual(args, {"çhyndaa_jarroo-raa" .. i, "chyndaa_jarroo-raa" .. i, "çhyndaa_jarroo_raa" .. i, "chyndaa_jarroo_raa" .. i})
if extraChyndaa and extraChyndaa ~= "" then distinctMode = true end
table.insert(names, { text = extra, chengey = extraChengey, tessen = extraTessen, chyndaa = extraChyndaa })
end
end
if #names == 0 then return nil end
local finalRef = wrapReference(reference) or wdMottoRef
return { names = names, reference = finalRef, chyndaa = chyndaa, distinctMode = distinctMode }
end
-- Given a property holding an item value (e.g. P85 = anthem), resolves the linked item to a page
local function getWikidataItemInfo(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
local statement = statements[1]
local mainsnak = statement.mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid") then
return nil
end
local value = mainsnak.datavalue.value
local id = value.id or ("Q" .. tostring(value["numeric-id"]))
local title = mw.wikibase.sitelink(id)
if not title or title == "" then
title = mw.wikibase.getLabelByLang(id, "gv") or mw.wikibase.label(id)
end
if not title or title == "" then return nil end
local audioQuals = statement.qualifiers and statement.qualifiers.P51
local audioSnak = audioQuals and audioQuals[1]
local qualifierAudio = audioSnak and audioSnak.snaktype == "value" and audioSnak.datavalue
and audioSnak.datavalue.type == "string" and audioSnak.datavalue.value
if qualifierAudio == "" then qualifierAudio = nil end
return { id = id, title = title, qualifierAudio = qualifierAudio }
end
-- Returns a Wikidata item's own standalone P51 (audio) file, if any -- as
-- opposed to the per-country qualifier checked first above.
local function getWikidataAudioFile(id)
if not id then return nil end
local entity = mw.wikibase.getEntityObject(id)
if not entity then return nil end
local statements = entity:getBestStatements("P51")
if not statements or #statements == 0 then return nil end
local mainsnak = statements[1].mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "string") then
return nil
end
local file = mainsnak.datavalue.value
if file and file ~= "" then return file end
return nil
end
-- Codepoint ranges treated as Latin/script-neutral for italicisation
local function isLatinOrNeutral(cp)
if cp < 0x80 then return true end
if cp <= 0x02AF then return true end
if cp >= 0x0300 and cp <= 0x036F then return true end
if cp >= 0x1E00 and cp <= 0x1EFF then return true end
if cp >= 0x2000 and cp <= 0x206F then return true end
return false
end
local function isNonLatinScript(text)
if not text or text == "" then return false end
local length = mw.ustring.len(text)
if not length or length == 0 then return false end
local codepoints = { mw.ustring.codepoint(text, 1, length) }
for _, cp in ipairs(codepoints) do
if not isLatinOrNeutral(cp) then return true end
end
return false
end
function p.main(frame, args)
local motto = getMottoData(args)
local rows = {}
if motto then
-- One line per official name. Each gets its own script-based
-- italics, language tag, and transliteration.
local nameLines = {}
for _, nameEntry in ipairs(motto.names) do
-- mw.ustring.gsub (codepoint-aware), not plain :gsub
local nameText = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
-- Italicised purely by script (MOS:FOREIGNITALIC), wikilink or not.
if not isNonLatinScript(nameText) then
nameText = "''" .. nameText .. "''"
end
-- çhengey_jarroo-raa names the motto's own language
if nameEntry.chengey and nameEntry.chengey ~= "" then
nameText = nameText .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
-- A transliteration is always Latin-script, so quotes, not
-- italics -- attached to this name's own line.
if nameEntry.tessen and nameEntry.tessen ~= "" then
nameText = nameText .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
-- Distinct mottos: each one's own translation goes directly
-- under its own line, not deferred to the very end.
if motto.distinctMode and nameEntry.chyndaa and nameEntry.chyndaa ~= "" then
nameText = nameText .. " <br/><small>“" .. nameEntry.chyndaa .. "”</small>"
end
table.insert(nameLines, nameText)
end
local baseText = table.concat(nameLines, "<br/>")
local mottoNote = getManual(args, {"noteyn_jarroo-raa", "noteyn_jarroo_raa"})
if mottoNote and mottoNote ~= "" then
baseText = baseText .. frame:expandTemplate{ title = "efn", args = { mottoNote } }
end
if motto.reference then baseText = baseText .. motto.reference end
-- One shared motto restated in multiple languages: single shared
-- translation shown once at the very end.
if not motto.distinctMode and motto.chyndaa and motto.chyndaa ~= "" then baseText = baseText .. " <br/><small>“" .. motto.chyndaa .. "”</small>" end
table.insert(rows, "'''[[Jarroo-raa]]: '''" .. baseText)
end
-- wikidataProperty is optional: pass a property (e.g. "P85") to fall
-- back to Wikidata when no manual parameter is set for this anthem slot.
local function formatAnthem(label, key, wikidataProperty)
local title = getManual(args, {key, key .. "1"})
-- |<key>=none suppresses this row entirely.
if title and mw.ustring.lower(title) == "none" then
return
end
local wikidataInfo = nil
if not title and wikidataProperty then
wikidataInfo = getWikidataItemInfo(wikidataProperty)
if wikidataInfo then title = wikidataInfo.title end
end
if not title then return end
-- |gyn_cowraghyn_aaraa_<key>= suppresses the curly quotes otherwise always wrapped around the title
local suppressQuotes = getManual(args, {"gyn_cowraghyn_aaraa_" .. key, "gyn_cowraghyn_aaraa_" .. key .. "1"}) ~= nil
-- One line per official title (e.g. a bilingual anthem, same tune, two equally-official lyrics sets)
local names = {
{ text = title,
chengey = getManual(args, {"çhengey_" .. key, "çhengey_" .. key .. "1"}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key, "tessen-lettyraghey_" .. key .. "1"}) },
}
for i = 2, 3 do
local extra = getManual(args, {key .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
table.insert(names, {
text = extra,
chengey = getManual(args, {"çhengey_" .. key .. i}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key .. i}),
})
end
end
local nameLines = {}
for _, nameEntry in ipairs(names) do
-- Same UTF-8-safe quote-stripping as the motto above.
local clean = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
if not mw.ustring.find(clean, "%[%[") then clean = '[[' .. clean .. '|' .. clean .. ']]' end
local line = suppressQuotes and clean or ('“' .. clean .. '”')
if nameEntry.chengey and nameEntry.chengey ~= "" then
line = line .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
if nameEntry.tessen and nameEntry.tessen ~= "" then
line = line .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
table.insert(nameLines, line)
end
local display = table.concat(nameLines, "<br/>")
local note = getManual(args, {"noteyn_" .. key})
if note and note ~= "" then display = display .. frame:expandTemplate{ title = "efn", args = { note } } end
local ref = getManual(args, {"imraa_" .. key})
if ref then
display = display .. wrapReference(ref)
elseif wikidataInfo then
display = display .. (getWdCitation(wikidataProperty, wikidataInfo.id) or "")
end
local chyndaa = getManual(args, {"çhyndaa_" .. key, "chyndaa_" .. key})
if chyndaa and chyndaa ~= "" then
if suppressQuotes then
display = display .. " <br/><small>" .. chyndaa .. "</small>"
else
display = display .. " <br/><small>“" .. chyndaa .. "”</small>"
end
end
local audio = getManual(args, {"coadan_" .. key})
if (not audio or audio == "") and wikidataInfo then
-- Prefer a per-country qualifier over the anthem item's own
-- standalone P51.
audio = wikidataInfo.qualifierAudio or getWikidataAudioFile(wikidataInfo.id)
end
if audio and audio ~= "" then display = display .. '<br/><div style="text-align:center; margin-top:0.3em;">[[Coadan:' .. audio .. '|center]]</div>' end
table.insert(rows, "'''" .. label .. ": '''" .. display)
end
formatAnthem("[[Arrane ashoonagh]]", "arrane_ashoonagh", "P85")
formatAnthem("Anthym", "arrane")
formatAnthem("[[Arrane reeoil]]", "arrane_reeoil")
-- Other symbol (legacy |cowrey_elley= / |cowrey_teks=): its own centred row, optional bold label
-- (|sorçh_cowrey_elley= / |sorçh_cowrey_teks=) above the value. |cowrey_elley=none hides it.
local symbolRow = nil
local symbol = getManual(args, {"cowrey_elley", "cowrey_teks"})
if symbol and mw.ustring.lower(symbol) ~= "none" then
-- A bare image file name (no wikitext) is shown as an image rather than as printed text
if not mw.ustring.find(symbol, "[%[%]{}<>|]") and mw.ustring.find(mw.ustring.lower(symbol), "%.%a%a%a%a?$") then
local ext = mw.ustring.lower(mw.ustring.match(symbol, "%.(%a+)$") or "")
local imageExt = { svg = true, png = true, jpg = true, jpeg = true, gif = true, webp = true, tif = true, tiff = true }
if imageExt[ext] then
local size = getManual(args, {"lheead_cowrey_elley", "lheead_cowrey_teks"}) or "125px"
symbol = "[[Coadan:" .. symbol .. "|" .. size .. "]]"
end
end
local symNote = getManual(args, {"noteyn_cowrey_elley", "noteyn_cowrey_teks"})
if symNote and symNote ~= "" then symbol = symbol .. frame:expandTemplate{ title = "efn", args = { symNote } } end
local symRef = getManual(args, {"imraa_cowrey_elley", "imraa_cowrey_teks"})
if symRef then symbol = symbol .. (wrapReference(symRef) or "") end
local symLabel = getManual(args, {"sorçh_cowrey_elley", "sorçh_cowrey_teks"})
if symLabel and mw.ustring.lower(symLabel) ~= "none" then
symbol = "'''" .. symLabel .. "'''<br/>" .. symbol
end
symbolRow = '<tr><td colspan="2" style="padding:0.4em; line-height:1.2em; text-align:center;">' .. symbol .. '</td></tr>'
end
if #rows == 0 then return symbolRow end
return '<tr><td colspan="2" style="padding:0.4em; line-height:1.2em; text-align:center;">' .. table.concat(rows, "<br/>") .. '</td></tr>' .. (symbolRow or "")
end
return p
trwjz0vmynvrsa3xik7smq9g1cl0r5i
394781
394780
2026-10-19T10:59:00Z
MacTire02
219
mooadys y jalloo
394781
Scribunto
text/plain
local p = {}
-- Max |jarroo-raaN= motto-name slots checked, beyond the bare/slot-1 spelling
local MAX_MOTTO_NAMES = 6
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then return mw.text.trim(value) end
end
return nil
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Wikidata references for a claim (empty if none). value = raw item id; nil + single=true takes the first best statement.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value, single)
if not wdOK or not Wd or not Wd._reference then return nil end
local callArgs = {"best"}
if single then table.insert(callArgs, "single") end
table.insert(callArgs, property)
if value then table.insert(callArgs, value) end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- Wraps a plain language name in [[...]] unless already a wikilink (avoids
-- double-bracketing a manual override), same guard as reiltys.lua's wikilinkLabel.
local function linkPlainText(text)
if not text or text == "" then return text end
if mw.ustring.find(text, "%[%[") then return text end
return "[[" .. text .. "]]"
end
local function getMottoData(args)
local motto = getManual(args, {"jarroo-raa_ashoonagh", "jarroo_raa", "jarroo-raa", "jarroo-raa1"})
-- |jarroo-raa=none suppresses the motto entirely (manual text AND the
-- Wikidata fallback) -- override valve for bad Wikidata data.
if motto and mw.ustring.lower(motto) == "none" then
return nil
end
local reference = getManual(args, {"imraa_jarroo_raa", "imraa_jarroo-raa"})
local chyndaa = getManual(args, {"çhyndaa_jarroo-raa", "chyndaa_jarroo-raa", "çhyndaa_jarroo_raa", "chyndaa_jarroo_raa"})
-- Transliteration is per-name, not shared (slot 1 keeps the bare,
-- unnumbered spelling as a synonym, same as çhengey_jarroo-raa).
local tessen = getManual(args, {"tessen-lettyraghey_jarroo-raa", "tessen-lettyraghey_jarroo_raa", "tessen-lettyraghey_jarroo-raa1", "tessen-lettyraghey_jarroo_raa1"})
local chengey = getManual(args, {"çhengey_jarroo-raa", "çhengey_jarroo_raa", "çhengey_jarroo-raa1", "çhengey_jarroo_raa1"})
-- A motto can have more than one equally official name
local names = {}
local wdMottoRef = nil
if motto then
table.insert(names, { text = motto, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
else
local entity = mw.wikibase.getEntityObject()
if entity then
local statements = entity:getBestStatements("P1451")
if statements and #statements > 0 then
for _, statement in ipairs(statements) do
if statement.mainsnak and statement.mainsnak.datavalue then
local value = statement.mainsnak.datavalue.value
if value and value.text then
table.insert(names, { text = value.text, chengey = chengey, tessen = tessen, chyndaa = chyndaa })
wdMottoRef = getWdCitation("P1451", nil, true)
break
end
end
end
end
end
end
-- distinctMode: true once a second/third motto has its OWN translation set -- signals two genuinely
local distinctMode = false
for i = 2, MAX_MOTTO_NAMES do
-- Hyphen-only: "jarroo-raa" is one hyphenated word, not two words joined by a separator, so
local extra = getManual(args, {"jarroo-raa" .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
local extraChengey = getManual(args, {"çhengey_jarroo-raa" .. i, "çhengey_jarroo_raa" .. i})
local extraTessen = getManual(args, {"tessen-lettyraghey_jarroo-raa" .. i, "tessen-lettyraghey_jarroo_raa" .. i})
local extraChyndaa = getManual(args, {"çhyndaa_jarroo-raa" .. i, "chyndaa_jarroo-raa" .. i, "çhyndaa_jarroo_raa" .. i, "chyndaa_jarroo_raa" .. i})
if extraChyndaa and extraChyndaa ~= "" then distinctMode = true end
table.insert(names, { text = extra, chengey = extraChengey, tessen = extraTessen, chyndaa = extraChyndaa })
end
end
if #names == 0 then return nil end
local finalRef = wrapReference(reference) or wdMottoRef
return { names = names, reference = finalRef, chyndaa = chyndaa, distinctMode = distinctMode }
end
-- Given a property holding an item value (e.g. P85 = anthem), resolves the linked item to a page
local function getWikidataItemInfo(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
local statement = statements[1]
local mainsnak = statement.mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid") then
return nil
end
local value = mainsnak.datavalue.value
local id = value.id or ("Q" .. tostring(value["numeric-id"]))
local title = mw.wikibase.sitelink(id)
if not title or title == "" then
title = mw.wikibase.getLabelByLang(id, "gv") or mw.wikibase.label(id)
end
if not title or title == "" then return nil end
local audioQuals = statement.qualifiers and statement.qualifiers.P51
local audioSnak = audioQuals and audioQuals[1]
local qualifierAudio = audioSnak and audioSnak.snaktype == "value" and audioSnak.datavalue
and audioSnak.datavalue.type == "string" and audioSnak.datavalue.value
if qualifierAudio == "" then qualifierAudio = nil end
return { id = id, title = title, qualifierAudio = qualifierAudio }
end
-- Returns a Wikidata item's own standalone P51 (audio) file, if any -- as
-- opposed to the per-country qualifier checked first above.
local function getWikidataAudioFile(id)
if not id then return nil end
local entity = mw.wikibase.getEntityObject(id)
if not entity then return nil end
local statements = entity:getBestStatements("P51")
if not statements or #statements == 0 then return nil end
local mainsnak = statements[1].mainsnak
if not (mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "string") then
return nil
end
local file = mainsnak.datavalue.value
if file and file ~= "" then return file end
return nil
end
-- Codepoint ranges treated as Latin/script-neutral for italicisation
local function isLatinOrNeutral(cp)
if cp < 0x80 then return true end
if cp <= 0x02AF then return true end
if cp >= 0x0300 and cp <= 0x036F then return true end
if cp >= 0x1E00 and cp <= 0x1EFF then return true end
if cp >= 0x2000 and cp <= 0x206F then return true end
return false
end
local function isNonLatinScript(text)
if not text or text == "" then return false end
local length = mw.ustring.len(text)
if not length or length == 0 then return false end
local codepoints = { mw.ustring.codepoint(text, 1, length) }
for _, cp in ipairs(codepoints) do
if not isLatinOrNeutral(cp) then return true end
end
return false
end
function p.main(frame, args)
local motto = getMottoData(args)
local rows = {}
if motto then
-- One line per official name. Each gets its own script-based
-- italics, language tag, and transliteration.
local nameLines = {}
for _, nameEntry in ipairs(motto.names) do
-- mw.ustring.gsub (codepoint-aware), not plain :gsub
local nameText = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
-- Italicised purely by script (MOS:FOREIGNITALIC), wikilink or not.
if not isNonLatinScript(nameText) then
nameText = "''" .. nameText .. "''"
end
-- çhengey_jarroo-raa names the motto's own language
if nameEntry.chengey and nameEntry.chengey ~= "" then
nameText = nameText .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
-- A transliteration is always Latin-script, so quotes, not
-- italics -- attached to this name's own line.
if nameEntry.tessen and nameEntry.tessen ~= "" then
nameText = nameText .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
-- Distinct mottos: each one's own translation goes directly
-- under its own line, not deferred to the very end.
if motto.distinctMode and nameEntry.chyndaa and nameEntry.chyndaa ~= "" then
nameText = nameText .. " <br/><small>“" .. nameEntry.chyndaa .. "”</small>"
end
table.insert(nameLines, nameText)
end
local baseText = table.concat(nameLines, "<br/>")
local mottoNote = getManual(args, {"noteyn_jarroo-raa", "noteyn_jarroo_raa"})
if mottoNote and mottoNote ~= "" then
baseText = baseText .. frame:expandTemplate{ title = "efn", args = { mottoNote } }
end
if motto.reference then baseText = baseText .. motto.reference end
-- One shared motto restated in multiple languages: single shared
-- translation shown once at the very end.
if not motto.distinctMode and motto.chyndaa and motto.chyndaa ~= "" then baseText = baseText .. " <br/><small>“" .. motto.chyndaa .. "”</small>" end
table.insert(rows, "'''[[Jarroo-raa]]: '''" .. baseText)
end
-- wikidataProperty is optional: pass a property (e.g. "P85") to fall
-- back to Wikidata when no manual parameter is set for this anthem slot.
local function formatAnthem(label, key, wikidataProperty)
local title = getManual(args, {key, key .. "1"})
-- |<key>=none suppresses this row entirely.
if title and mw.ustring.lower(title) == "none" then
return
end
local wikidataInfo = nil
if not title and wikidataProperty then
wikidataInfo = getWikidataItemInfo(wikidataProperty)
if wikidataInfo then title = wikidataInfo.title end
end
if not title then return end
-- |gyn_cowraghyn_aaraa_<key>= suppresses the curly quotes otherwise always wrapped around the title
local suppressQuotes = getManual(args, {"gyn_cowraghyn_aaraa_" .. key, "gyn_cowraghyn_aaraa_" .. key .. "1"}) ~= nil
-- One line per official title (e.g. a bilingual anthem, same tune, two equally-official lyrics sets)
local names = {
{ text = title,
chengey = getManual(args, {"çhengey_" .. key, "çhengey_" .. key .. "1"}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key, "tessen-lettyraghey_" .. key .. "1"}) },
}
for i = 2, 3 do
local extra = getManual(args, {key .. i})
if extra and mw.ustring.lower(extra) ~= "none" then
table.insert(names, {
text = extra,
chengey = getManual(args, {"çhengey_" .. key .. i}),
tessen = getManual(args, {"tessen-lettyraghey_" .. key .. i}),
})
end
end
local nameLines = {}
for _, nameEntry in ipairs(names) do
-- Same UTF-8-safe quote-stripping as the motto above.
local clean = mw.ustring.gsub(mw.ustring.gsub(mw.text.trim(nameEntry.text), '^["“]', ''), '["”]$', '')
if not mw.ustring.find(clean, "%[%[") then clean = '[[' .. clean .. '|' .. clean .. ']]' end
local line = suppressQuotes and clean or ('“' .. clean .. '”')
if nameEntry.chengey and nameEntry.chengey ~= "" then
line = line .. " <small>(" .. linkPlainText(nameEntry.chengey) .. ")</small>"
end
if nameEntry.tessen and nameEntry.tessen ~= "" then
line = line .. " <br/>(“" .. nameEntry.tessen .. "”)"
end
table.insert(nameLines, line)
end
local display = table.concat(nameLines, "<br/>")
local note = getManual(args, {"noteyn_" .. key})
if note and note ~= "" then display = display .. frame:expandTemplate{ title = "efn", args = { note } } end
local ref = getManual(args, {"imraa_" .. key})
if ref then
display = display .. wrapReference(ref)
elseif wikidataInfo then
display = display .. (getWdCitation(wikidataProperty, wikidataInfo.id) or "")
end
local chyndaa = getManual(args, {"çhyndaa_" .. key, "chyndaa_" .. key})
if chyndaa and chyndaa ~= "" then
if suppressQuotes then
display = display .. " <br/><small>" .. chyndaa .. "</small>"
else
display = display .. " <br/><small>“" .. chyndaa .. "”</small>"
end
end
local audio = getManual(args, {"coadan_" .. key})
if (not audio or audio == "") and wikidataInfo then
-- Prefer a per-country qualifier over the anthem item's own
-- standalone P51.
audio = wikidataInfo.qualifierAudio or getWikidataAudioFile(wikidataInfo.id)
end
if audio and audio ~= "" then display = display .. '<br/><div style="text-align:center; margin-top:0.3em;">[[Coadan:' .. audio .. '|center]]</div>' end
table.insert(rows, "'''" .. label .. ": '''" .. display)
end
formatAnthem("[[Arrane ashoonagh]]", "arrane_ashoonagh", "P85")
formatAnthem("Anthym", "arrane")
formatAnthem("[[Arrane reeoil]]", "arrane_reeoil")
-- Other symbol (legacy |cowrey_elley= / |cowrey_teks=): its own centred row, optional bold label
-- (|sorçh_cowrey_elley= / |sorçh_cowrey_teks=) above the value. |cowrey_elley=none hides it.
local symbolRow = nil
local symbol = getManual(args, {"cowrey_elley", "cowrey_teks"})
if symbol and mw.ustring.lower(symbol) ~= "none" then
-- A bare image file name (no wikitext) is shown as an image rather than as printed text
if not mw.ustring.find(symbol, "[%[%]{}<>|]") and mw.ustring.find(mw.ustring.lower(symbol), "%.%a%a%a%a?$") then
local ext = mw.ustring.lower(mw.ustring.match(symbol, "%.(%a+)$") or "")
local imageExt = { svg = true, png = true, jpg = true, jpeg = true, gif = true, webp = true, tif = true, tiff = true }
if imageExt[ext] then
local size = getManual(args, {"lheead_cowrey_elley", "lheead_cowrey_teks"}) or "100px"
symbol = "[[Coadan:" .. symbol .. "|" .. size .. "]]"
end
end
local symNote = getManual(args, {"noteyn_cowrey_elley", "noteyn_cowrey_teks"})
if symNote and symNote ~= "" then symbol = symbol .. frame:expandTemplate{ title = "efn", args = { symNote } } end
local symRef = getManual(args, {"imraa_cowrey_elley", "imraa_cowrey_teks"})
if symRef then symbol = symbol .. (wrapReference(symRef) or "") end
local symLabel = getManual(args, {"sorçh_cowrey_elley", "sorçh_cowrey_teks"})
if symLabel and mw.ustring.lower(symLabel) ~= "none" then
symbol = "'''" .. symLabel .. "'''<br/>" .. symbol
end
symbolRow = '<tr><td colspan="2" style="padding:0.4em; line-height:1.2em; text-align:center;">' .. symbol .. '</td></tr>'
end
if #rows == 0 then return symbolRow end
return '<tr><td colspan="2" style="padding:0.4em; line-height:1.2em; text-align:center;">' .. table.concat(rows, "<br/>") .. '</td></tr>' .. (symbolRow or "")
end
return p
mqpatxa27xoc3fhb9w0oql3rh7t9jl9
Module:Kishtey fys çheer/çhengaghyn
828
55833
394740
394656
2026-10-18T15:17:16Z
MacTire02
219
++
394740
Scribunto
text/plain
local p = {}
-- Wikidata references for one claim value (empty if none); property/value as in Module:Wd's reference command.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function manxSort(a, b)
local function norm(text) return text:lower():gsub("çh", "ch") end
return norm(a) < norm(b)
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Splices `insertion` (an efn footnote marker and/or wrapped <ref>) inside the deepest trailing
local function appendInsideTrailingBlock(text, insertion)
if not insertion or insertion == "" then return text end
local trailingTags = {}
local rest = text
while true do
local tag = rest:match("(</%a[%w]*>)%s*$")
if not tag then break end
local tagStart = rest:find(tag .. "%s*$")
table.insert(trailingTags, 1, tag)
rest = rest:sub(1, tagStart - 1)
end
if #trailingTags == 0 then
return text .. insertion
end
return rest .. insertion .. table.concat(trailingTags)
end
local function getWikidataLanguageItems(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements(property)
if not statements or #statements == 0 then return nil end
local items = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid" then
local value = mainsnak.datavalue.value
local id = value.id or ("Q" .. tostring(value["numeric-id"]))
local label = mw.wikibase.getLabelByLang(id, "gv") or mw.wikibase.label(id)
if label and label ~= "" then
table.insert(items, { id = id, name = label })
end
end
end
if #items == 0 then return nil end
return items
end
local function itemsToRaw(items, excludeIds)
local names = {}
for _, item in ipairs(items) do
if not (excludeIds and excludeIds[item.id]) then
table.insert(names, item.name)
end
end
if #names == 0 then return nil end
return table.concat(names, ",")
end
-- "Çhengey oikoil erbee" ("[there is] no official language") is a descriptive phrase, not an article
local NO_OFFICIAL_LANGUAGE = "Çhengey oikoil erbee"
local function buildLanguageValue(raw, ref, note, frame)
if not raw or mw.text.trim(raw):lower() == "none" then return nil, 0 end
-- Byte-prefix match (safe even with Ç's multi-byte UTF-8 encoding)
if raw:sub(1, #NO_OFFICIAL_LANGUAGE) == NO_OFFICIAL_LANGUAGE then
local display = raw
if note and note ~= "" and frame then
display = display .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref then
display = display .. wrapReference(ref)
end
return display, 1
end
if raw:find("%[%[", 1, false) then
local display = raw
local insertion = ""
if note and note ~= "" and frame then
insertion = insertion .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref then
insertion = insertion .. wrapReference(ref)
end
display = appendInsideTrailingBlock(display, insertion)
local linkCount = 0
for _ in raw:gmatch("%[%[") do linkCount = linkCount + 1 end
return display, linkCount
end
-- Strip any ref out before splitting (a literal <ref> typed here rather
-- than via imraa_* can arrive as a strip marker).
local cleaned = raw:gsub("<ref[^>]*>.-</ref>", ""):gsub("<ref[^>]*/>", ""):gsub("\127UNIQ.-QINU\127", "")
local names = mw.text.split(cleaned, ",", true)
local filteredNames = {}
for _, part in ipairs(names) do
local trimmed = mw.text.trim(part)
if trimmed ~= "" then
table.insert(filteredNames, trimmed)
end
end
if #filteredNames == 0 then return nil, 0 end
table.sort(filteredNames, manxSort)
local parts = {}
for _, name in ipairs(filteredNames) do
if name == NO_OFFICIAL_LANGUAGE or name:find("[%[%]]") then
-- never self-link the sentinel phrase or a fragment with stray brackets
table.insert(parts, name)
else
table.insert(parts, '[[' .. name .. '|' .. name .. ']]')
end
end
local display = '<div class="hlist">' .. table.concat(parts, ' · ') .. '</div>'
local insertion = ""
if note and note ~= "" and frame then
insertion = insertion .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref then
insertion = insertion .. wrapReference(ref)
end
display = appendInsideTrailingBlock(display, insertion)
return display, #filteredNames
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local officialItems = nil
local wdOfficialRef = nil
local officialRaw = getManual(args, {"çhengaghyn_oikoil", "çhengey_oikoil"})
if not officialRaw then
officialItems = getWikidataLanguageItems("P37")
officialRaw = itemsToRaw(officialItems)
if officialItems then
local refs = {}
for _, item in ipairs(officialItems) do
table.insert(refs, getWdCitation("P37", item.id) or "")
end
wdOfficialRef = table.concat(refs)
if wdOfficialRef == "" then wdOfficialRef = nil end
end
end
local regionalRaw = getManual(args, {"çhengaghyn_ardjynagh", "çhengey_ardjynagh"})
local minorityRaw = getManual(args, {"mynçhengaghyn", "mynçhengey"})
local otherRaw = getManual(args, {"çhengaghyn", "çhengey"})
local official, offCount = buildLanguageValue(officialRaw, getManual(args, {"imraa_çhengaghyn_oikoil", "imraa_çhengey_oikoil"}) or wdOfficialRef, getManual(args, {"noteyn_çhengaghyn_oikoil", "noteyn_çhengey_oikoil"}), frame)
local regional, regCount = buildLanguageValue(regionalRaw, getManual(args, {"imraa_çhengaghyn_ardjynagh", "imraa_çhengey_ardjynagh"}), getManual(args, {"noteyn_çhengaghyn_ardjynagh", "noteyn_çhengey_ardjynagh"}), frame)
local minority, minCount = buildLanguageValue(minorityRaw, getManual(args, {"imraa_mynçhengaghyn", "imraa_mynçhengey"}), getManual(args, {"noteyn_mynçhengaghyn", "noteyn_mynçhengey"}), frame)
local other, othCount = buildLanguageValue(otherRaw, getManual(args, {"imraa_çhengaghyn", "imraa_çhengey"}), getManual(args, {"noteyn_çhengaghyn", "noteyn_çhengey"}), frame)
local subRows = {}
if official then
local label = offCount > 1 and "[[Çhengey oikoil|Çhengaghyn oikoil]]" or "[[Çhengey oikoil]]"
table.insert(subRows, '<tr><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">' .. label .. '</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. official .. '</td></tr>')
if regional then
-- No white-space:nowrap here, unlike every other <th> in this file
local rLabel = regCount > 1 and "Çhengaghyn ardjynagh er enney" or "Çhengey ardjynagh er enney"
table.insert(subRows, '<tr><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.4em; padding-right:0.4em;">[[Çhengey ardjynagh|' .. rLabel .. ']]</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. regional .. '</td></tr>')
end
elseif regional then
-- Same wrap handling as the nested case above -- no nowrap,
-- pairs forcing the break to fall only between "ardjynagh" and "er".
local rLabel = regCount > 1 and "Çhengaghyn ardjynagh er enney" or "Çhengey ardjynagh er enney"
table.insert(subRows, '<tr><th style="vertical-align:top; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">[[Çhengey ardjynagh|' .. rLabel .. ']]</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. regional .. '</td></tr>')
end
if minority then
local mLabel = minCount > 1 and "[[Mynçhengey|Mynçhengaghyn]]" or "[[Mynçhengey]]"
table.insert(subRows, '<tr><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">' .. mLabel .. '</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. minority .. '</td></tr>')
end
if other then
local oLabel = args["sorçh_çhengaghyn"] or (othCount > 1 and "Çhengaghyn" or "Çhengey")
table.insert(subRows, '<tr><th style="vertical-align:top; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">' .. oLabel .. '</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">' .. other .. '</td></tr>')
end
if #subRows == 0 then return nil end
return table.concat(subRows)
end
return p
6kok2a3dcviuri4r10d1l4muhw6m26x
Module:Kishtey fys çheer/reiltys
828
55837
394734
394623
2026-10-18T15:14:01Z
MacTire02
219
++
394734
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
ao6cn3jxye0npqdctf5ydtd5w9vc7xk
394745
394734
2026-10-18T16:01:19Z
MacTire02
219
++
394745
Scribunto
text/plain
require("strict")
local p = {}
local module_arg = ...
local i18n
local i18nPath
local function loadI18n(aliasesP, frame)
local title
if frame then
-- current module invoked by page/template, get its title from frame
title = frame:getTitle()
else
-- current module included by other module, get its title from ...
title = module_arg
end
if not i18n then
i18nPath = title .. "/i18n"
i18n = require(i18nPath).init(aliasesP)
end
end
p.claimCommands = {
property = "property",
properties = "properties",
qualifier = "qualifier",
qualifiers = "qualifiers",
reference = "reference",
references = "references"
}
p.generalCommands = {
label = "label",
title = "title",
description = "description",
alias = "alias",
aliases = "aliases",
badge = "badge",
badges = "badges"
}
p.flags = {
linked = "linked",
short = "short",
raw = "raw",
multilanguage = "multilanguage",
unit = "unit",
-------------
preferred = "preferred",
normal = "normal",
deprecated = "deprecated",
best = "best",
future = "future",
current = "current",
former = "former",
edit = "edit",
editAtEnd = "edit@end",
mdy = "mdy",
single = "single",
sourced = "sourced"
}
p.args = {
eid = "eid",
page = "page",
date = "date",
globalSiteId = "globalSiteId"
}
local aliasesP = {
coord = "P625",
-----------------------
image = "P18",
author = "P50",
authorNameString = "P2093",
publisher = "P123",
importedFrom = "P143",
wikimediaImportURL = "P4656",
statedIn = "P248",
pages = "P304",
language = "P407",
hasPart = "P527",
publicationDate = "P577",
startTime = "P580",
endTime = "P582",
chapter = "P792",
retrieved = "P813",
referenceURL = "P854",
nativeLabel = "P1705",
sectionVerseOrParagraph = "P958",
archiveURL = "P1065",
title = "P1476",
formatterURL = "P1630",
quote = "P1683",
shortName = "P1813",
definingFormula = "P2534",
archiveDate = "P2960",
inferredFrom = "P3452",
typeOfReference = "P3865",
column = "P3903",
subjectNamedAs = "P1810",
wikidataProperty = "P1687",
publishedIn = "P1433",
lastUpdate = "P5017"
}
local aliasesQ = {
percentage = "Q11229",
prolepticJulianCalendar = "Q1985786",
citeWeb = "Q5637226",
citeQ = "Q22321052"
}
local parameters = {
property = "%p",
qualifier = "%q",
reference = "%r",
alias = "%a",
badge = "%b",
separator = "%s",
general = "%x"
}
local formats = {
property = "%p[%s][%r]",
qualifier = "%q[%s][%r]",
reference = "%r",
propertyWithQualifier = "%p[ <span style=\"font-size:85\\%\">(%q)</span>][%s][%r]",
alias = "%a[%s]",
badge = "%b[%s]"
}
local hookNames = { -- {level_1, level_2}
[parameters.property] = {"getProperty"},
[parameters.reference] = {"getReferences", "getReference"},
[parameters.qualifier] = {"getAllQualifiers"},
[parameters.qualifier.."\\d"] = {"getQualifiers", "getQualifier"},
[parameters.alias] = {"getAlias"},
[parameters.badge] = {"getBadge"}
}
-- default value objects, should NOT be mutated but instead copied
local defaultSeparators = {
["sep"] = {" "},
["sep%s"] = {","},
["sep%q"] = {"; "},
["sep%q\\d"] = {", "},
["sep%r"] = nil, -- none
["punc"] = nil -- none
}
local rankTable = {
["preferred"] = 1,
["normal"] = 2,
["deprecated"] = 3
}
local function replaceAlias(id)
if aliasesP[id] then
id = aliasesP[id]
end
return id
end
local function errorText(code, ...)
local text = i18n["errors"][code]
if not text then
return "Missing i18n error key: " .. tostring(code)
end
if arg then text = mw.ustring.format(text, unpack(arg)) end
return text
end
local function throwError(errorMessage, ...)
error(errorText(errorMessage, unpack(arg)))
end
local function replaceDecimalMark(num)
return mw.ustring.gsub(num, "[.]", i18n['numeric']['decimal-mark'], 1)
end
local function padZeros(num, numDigits)
local numZeros
local negative = false
if num < 0 then
negative = true
num = num * -1
end
num = tostring(num)
numZeros = numDigits - num:len()
for _ = 1, numZeros do
num = "0"..num
end
if negative then
num = "-"..num
end
return num
end
local function replaceSpecialChar(chr)
if chr == '_' then
-- replace underscores with spaces
return ' '
else
return chr
end
end
local function replaceSpecialChars(str)
local chr
local esc = false
local strOut = ""
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
esc = true
else
strOut = strOut .. replaceSpecialChar(chr)
end
else
strOut = strOut .. chr
esc = false
end
end
return strOut
end
local function buildWikilink(target, label)
if not label or target == label then
return "[[" .. target .. "]]"
else
return "[[" .. target .. "|" .. label .. "]]"
end
end
-- used to make frame.args mutable, to replace #frame.args (which is always 0)
-- with the actual amount and to simply copy tables
local function copyTable(tIn)
if not tIn then
return nil
end
local tOut = {}
for i, v in pairs(tIn) do
tOut[i] = v
end
return tOut
end
-- used to merge output arrays together;
-- note that it currently mutates the first input array
local function mergeArrays(a1, a2)
for i = 1, #a2 do
a1[#a1 + 1] = a2[i]
end
return a1
end
local function split(str, del)
local out = {}
local i, j = str:find(del)
if i and j then
out[1] = str:sub(1, i - 1)
out[2] = str:sub(j + 1)
else
out[1] = str
end
return out
end
local function parseWikidataURL(url)
local id
if url:match('^http[s]?://') then
id = split(url, "Q")
if id[2] then
return "Q" .. id[2]
end
end
return nil
end
local function parseDate(dateStr, precision)
precision = precision or "d"
local i, j, index, ptr
local parts = {nil, nil, nil}
if dateStr == nil then
return parts[1], parts[2], parts[3] -- year, month, day
end
-- 'T' for snak values, '/' for outputs with '/Julian' attached
i, j = dateStr:find("[T/]")
if i then
dateStr = dateStr:sub(1, i-1)
end
local from = 1
if dateStr:sub(1,1) == "-" then
-- this is a negative number, look further ahead
from = 2
end
index = 1
ptr = 1
i, j = dateStr:find("-", from)
if i then
-- year
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10) -- explicitly give base 10 to prevent error
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
if precision == "y" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
i, j = dateStr:find("-", ptr)
if i then
-- month
parts[index] = tonumber(dateStr:sub(ptr, i-1), 10)
if precision == "m" then
-- we're done
return parts[1], parts[2], parts[3] -- year, month, day
end
index = index + 1
ptr = i + 1
end
end
if dateStr:sub(ptr) ~= "" then
-- day if we have month, month if we have year, or year
parts[index] = tonumber(dateStr:sub(ptr), 10)
end
return parts[1], parts[2], parts[3] -- year, month, day
end
local function datePrecedesDate(aY, aM, aD, bY, bM, bD)
if aY == nil or bY == nil then
return nil
end
aM = aM or 1
aD = aD or 1
bM = bM or 1
bD = bD or 1
if aY < bY then
return true
end
if aY > bY then
return false
end
if aM < bM then
return true
end
if aM > bM then
return false
end
if aD < bD then
return true
end
return false
end
local function getHookName(param, index)
if hookNames[param] then
return hookNames[param][index]
elseif param:len() > 2 then
return hookNames[param:sub(1, 2).."\\d"][index]
else
return nil
end
end
local function alwaysTrue()
return true
end
-- The following function parses a format string.
--
-- The example below shows how a parsed string is structured in memory.
-- Variables other than 'str' and 'child' are left out for clarity's sake.
--
-- Example:
-- "A %p B [%s[%q1]] C [%r] D"
--
-- Structure:
-- [
-- {
-- str = "A "
-- },
-- {
-- str = "%p"
-- },
-- {
-- str = " B ",
-- child =
-- [
-- {
-- str = "%s",
-- child =
-- [
-- {
-- str = "%q1"
-- }
-- ]
-- }
-- ]
-- },
-- {
-- str = " C ",
-- child =
-- [
-- {
-- str = "%r"
-- }
-- ]
-- },
-- {
-- str = " D"
-- }
-- ]
--
local function parseFormat(str)
local chr, esc, param, root, cur, prev, new
local params = {}
local function newObject(array)
local obj = {} -- new object
obj.str = ""
array[#array + 1] = obj -- array{object}
obj.parent = array
return obj
end
local function endParam()
if param > 0 then
if cur.str ~= "" then
cur.str = "%"..cur.str
cur.param = true
params[cur.str] = true
cur.parent.req[cur.str] = true
prev = cur
cur = newObject(cur.parent)
end
param = 0
end
end
root = {} -- array
root.req = {}
cur = newObject(root)
prev = nil
esc = false
param = 0
for i = 1, #str do
chr = str:sub(i,i)
if not esc then
if chr == '\\' then
endParam()
esc = true
elseif chr == '%' then
endParam()
if cur.str ~= "" then
cur = newObject(cur.parent)
end
param = 2
elseif chr == '[' then
endParam()
if prev and cur.str == "" then
table.remove(cur.parent)
cur = prev
end
cur.child = {} -- new array
cur.child.req = {}
cur.child.parent = cur
cur = newObject(cur.child)
elseif chr == ']' then
endParam()
if cur.parent.parent then
new = newObject(cur.parent.parent.parent)
if cur.str == "" then
table.remove(cur.parent)
end
cur = new
end
else
if param > 1 then
param = param - 1
elseif param == 1 then
if not chr:match('%d') then
endParam()
end
end
cur.str = cur.str .. replaceSpecialChar(chr)
end
else
cur.str = cur.str .. chr
esc = false
end
prev = nil
end
endParam()
-- make sure that at least one required parameter has been defined
if not next(root.req) then
throwError("missing-required-parameter")
end
-- make sure that the separator parameter "%s" is not amongst the required parameters
if root.req[parameters.separator] then
throwError("extra-required-parameter", parameters.separator)
end
return root, params
end
local function sortOnRank(claims)
local rankPos
local ranks = {{}, {}, {}, {}} -- preferred, normal, deprecated, (default)
local sorted = {}
for _, v in ipairs(claims) do
rankPos = rankTable[v.rank] or 4
ranks[rankPos][#ranks[rankPos] + 1] = v
end
sorted = ranks[1]
sorted = mergeArrays(sorted, ranks[2])
sorted = mergeArrays(sorted, ranks[3])
return sorted
end
local function isValueInTable(searchedItem, inputTable)
for _, item in pairs(inputTable) do
if item == searchedItem then
return true
end
end
return false
end
local Config = {}
-- allows for recursive calls
function Config:new()
local cfg = {}
setmetatable(cfg, self)
self.__index = self
cfg.separators = {
-- single value objects wrapped in arrays so that we can pass by reference
["sep"] = {copyTable(defaultSeparators["sep"])},
["sep%s"] = {copyTable(defaultSeparators["sep%s"])},
["sep%q"] = {copyTable(defaultSeparators["sep%q"])},
["sep%r"] = {copyTable(defaultSeparators["sep%r"])},
["punc"] = {copyTable(defaultSeparators["punc"])}
}
cfg.entity = nil
cfg.entityID = nil
cfg.propertyID = nil
cfg.propertyValue = nil
cfg.qualifierIDs = {}
cfg.qualifierIDsAndValues = {}
cfg.bestRank = true
cfg.ranks = {true, true, false} -- preferred = true, normal = true, deprecated = false
cfg.foundRank = #cfg.ranks
cfg.flagBest = false
cfg.flagRank = false
cfg.periods = {true, true, true} -- future = true, current = true, former = true
cfg.flagPeriod = false
cfg.atDate = {parseDate(os.date('!%Y-%m-%d'))} -- today as {year, month, day}
cfg.mdyDate = false
cfg.singleClaim = false
cfg.sourcedOnly = false
cfg.editable = false
cfg.editAtEnd = false
cfg.inSitelinks = false
cfg.langCode = mw.language.getContentLanguage().code
cfg.langName = mw.language.fetchLanguageName(cfg.langCode, cfg.langCode)
cfg.langObj = mw.language.new(cfg.langCode)
cfg.siteID = mw.wikibase.getGlobalSiteId()
cfg.states = {}
cfg.states.qualifiersCount = 0
cfg.curState = nil
cfg.prefetchedRefs = nil
return cfg
end
local State = {}
function State:new(cfg, type)
local stt = {}
setmetatable(stt, self)
self.__index = self
stt.conf = cfg
stt.type = type
stt.results = {}
stt.parsedFormat = {}
stt.separator = {}
stt.movSeparator = {}
stt.puncMark = {}
stt.linked = false
stt.rawValue = false
stt.shortName = false
stt.anyLanguage = false
stt.unitOnly = false
stt.singleValue = false
return stt
end
-- if id == nil then item connected to current page is used
function Config:getLabel(id, raw, link, short)
local label = nil
local prefix, title= "", nil
if not id then
id = mw.wikibase.getEntityIdForCurrentPage()
if not id then
return ""
end
end
id = id:upper() -- just to be sure
if raw then
-- check if given id actually exists
if mw.wikibase.isValidEntityId(id) and mw.wikibase.entityExists(id) then
label = id
end
prefix, title = "d:Special:EntityPage/", label -- may be nil
else
-- try short name first if requested
if short then
label = p._property{aliasesP.shortName, [p.args.eid] = id} -- get short name
if label == "" then
label = nil
end
end
-- get label
if not label then
label = mw.wikibase.getLabel(id)
end
end
if not label then
label = ""
elseif link then
-- build a link if requested
if not title then
if id:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(id)
elseif id:sub(1,1) == "P" then
-- properties have no sitelink, link to Wikidata instead
prefix, title = "d:Special:EntityPage/", id
end
end
label = mw.text.nowiki(label) -- escape raw label text so it cannot be wikitext markup
if title then
label = buildWikilink(prefix .. title, label)
end
end
return label
end
function Config:getEditIcon()
local value = ""
local prefix = ""
local front = " "
local back = ""
if self.entityID:sub(1,1) == "P" then
prefix = "Property:"
end
if self.editAtEnd then
front = '<span style="float:'
if self.langObj:isRTL() then
front = front .. 'left'
else
front = front .. 'right'
end
front = front .. '">'
back = '</span>'
end
value = "[[File:OOjs UI icon edit-ltr-progressive.svg|frameless|text-top|10px|alt=" .. i18n['info']['edit-on-wikidata'] .. "|link=https://www.wikidata.org/wiki/" .. prefix .. self.entityID .. "?uselang=" .. self.langCode
if self.propertyID then
value = value .. "#" .. self.propertyID
elseif self.inSitelinks then
value = value .. "#sitelinks-wikipedia"
end
value = value .. "|" .. i18n['info']['edit-on-wikidata'] .. "]]"
return front .. value .. back
end
-- used to create the final output string when it's all done, so that for references the
-- function extensionTag("ref", ...) is only called when they really ended up in the final output
function Config:concatValues(valuesArray)
local outString = ""
local j, skip
for i = 1, #valuesArray do
-- check if this is a reference
if valuesArray[i].refHash then
j = i - 1
skip = false
-- skip this reference if it is part of a continuous row of references that already contains the exact same reference
while valuesArray[j] and valuesArray[j].refHash do
if valuesArray[i].refHash == valuesArray[j].refHash then
skip = true
break
end
j = j - 1
end
if not skip then
-- add <ref> tag with the reference's hash as its name (to deduplicate references)
outString = outString .. mw.getCurrentFrame():extensionTag("ref", valuesArray[i][1], {name = valuesArray[i].refHash})
end
else
outString = outString .. valuesArray[i][1]
end
end
return outString
end
function Config:convertUnit(unit, raw, link, short, unitOnly)
local space = " "
local label = ""
local itemID
if unit == "" or unit == "1" then
return nil
end
if unitOnly then
space = ""
end
itemID = parseWikidataURL(unit)
if itemID then
if itemID == aliasesQ.percentage then
return "%"
else
label = self:getLabel(itemID, raw, link, short)
if label ~= "" then
return space .. label
end
end
end
return ""
end
function State:getValue(snak)
return self.conf:getValue(snak, self.rawValue, self.linked, self.shortName, self.anyLanguage, self.unitOnly, false, self.type:sub(1,2))
end
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type)
if snak.snaktype == 'value' then
local datatype = snak.datavalue.type
local subtype = snak.datatype
local datavalue = snak.datavalue.value
if datatype == 'string' then
if subtype == 'url' and link then
-- create link explicitly
if raw then
-- will render as a linked number like [1]
return "[" .. datavalue .. "]"
else
return "[" .. datavalue .. " " .. datavalue .. "]"
end
elseif subtype == 'commonsMedia' then
if link then
return buildWikilink("c:File:" .. datavalue, datavalue)
elseif not raw then
return "[[File:" .. datavalue .. "]]"
else
return datavalue
end
elseif subtype == 'geo-shape' and link then
return buildWikilink("c:" .. datavalue, datavalue)
elseif subtype == 'math' and not raw then
local attribute = nil
if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then
attribute = {qid = self.entityID}
end
return mw.getCurrentFrame():extensionTag("math", datavalue, attribute)
elseif subtype == 'external-id' and link then
local url = p._property{aliasesP.formatterURL, [p.args.eid] = snak.property} -- get formatter URL
if url ~= "" then
url = mw.ustring.gsub(url, "$1", datavalue)
return "[" .. url .. " " .. datavalue .. "]"
else
return datavalue
end
else
return datavalue
end
elseif datatype == 'monolingualtext' then
if anyLang or datavalue['language'] == self.langCode then
return datavalue['text']
else
return nil
end
elseif datatype == 'quantity' then
local value = ""
local unit
if not unitOnly then
-- get value and strip + signs from front
value = mw.ustring.gsub(datavalue['amount'], "^%+(.+)$", "%1")
if raw then
return value
end
-- replace decimal mark based on locale
value = replaceDecimalMark(value)
-- add delimiters for readability
value = i18n.addDelimiters(value)
end
unit = self:convertUnit(datavalue['unit'], raw, link, short, unitOnly)
if unit then
value = value .. unit
end
return value
elseif datatype == 'time' then
local y, m, d, p, yDiv, yRound, yFull, value, calendarID, dateStr
local yFactor = 1
local sign = 1
local prefix = ""
local suffix = ""
local mayAddCalendar = false
local calendar = ""
local precision = datavalue['precision']
if precision == 11 then
p = "d"
elseif precision == 10 then
p = "m"
else
p = "y"
yFactor = 10^(9-precision)
end
y, m, d = parseDate(datavalue['time'], p)
if y < 0 then
sign = -1
y = y * sign
end
-- if precision is tens/hundreds/thousands/millions/billions of years
if precision <= 8 then
yDiv = y / yFactor
-- if precision is tens/hundreds/thousands of years
if precision >= 6 then
mayAddCalendar = true
if precision <= 7 then
-- round centuries/millenniums up (e.g. 20th century or 3rd millennium)
yRound = math.ceil(yDiv)
if not raw then
if precision == 6 then
suffix = i18n['datetime']['suffixes']['millennium']
else
suffix = i18n['datetime']['suffixes']['century']
end
suffix = i18n.getOrdinalSuffix(yRound) .. suffix
else
-- if not verbose, take the first year of the century/millennium
-- (e.g. 1901 for 20th century or 2001 for 3rd millennium)
yRound = (yRound - 1) * yFactor + 1
end
else
-- precision == 8
-- round decades down (e.g. 2010s)
yRound = math.floor(yDiv) * yFactor
if not raw then
prefix = i18n['datetime']['prefixes']['decade-period']
suffix = i18n['datetime']['suffixes']['decade-period']
end
end
if raw and sign < 0 then
-- if BCE then compensate for "counting backwards"
-- (e.g. -2019 for 2010s BCE, -2000 for 20th century BCE or -3000 for 3rd millennium BCE)
yRound = yRound + yFactor - 1
end
else
local yReFactor, yReDiv, yReRound
-- round to nearest for tens of thousands of years or more
yRound = math.floor(yDiv + 0.5)
if yRound == 0 then
if precision <= 2 and y ~= 0 then
yReFactor = 1e6
yReDiv = y / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years only if we have a whole number of them
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
if yRound == 0 then
-- otherwise, take the unrounded (original) number of years
precision = 5
yFactor = 1
yRound = y
mayAddCalendar = true
end
end
if precision >= 1 and y ~= 0 then
yFull = yRound * yFactor
yReFactor = 1e9
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to billions of years if we're in that range
precision = 0
yFactor = yReFactor
yRound = yReRound
else
yReFactor = 1e6
yReDiv = yFull / yReFactor
yReRound = math.floor(yReDiv + 0.5)
if yReDiv == yReRound then
-- change precision to millions of years if we're in that range
precision = 3
yFactor = yReFactor
yRound = yReRound
end
end
end
if not raw then
if precision == 3 then
suffix = i18n['datetime']['suffixes']['million-years']
elseif precision == 0 then
suffix = i18n['datetime']['suffixes']['billion-years']
else
yRound = yRound * yFactor
if yRound == 1 then
suffix = i18n['datetime']['suffixes']['year']
else
suffix = i18n['datetime']['suffixes']['years']
end
end
else
yRound = yRound * yFactor
end
end
else
yRound = y
mayAddCalendar = true
end
if mayAddCalendar then
calendarID = parseWikidataURL(datavalue['calendarmodel'])
if calendarID and calendarID == aliasesQ.prolepticJulianCalendar then
if not raw then
if link then
calendar = " ("..buildWikilink(i18n['datetime']['julian-calendar'], i18n['datetime']['julian'])..")"
else
calendar = " ("..i18n['datetime']['julian']..")"
end
else
calendar = "/"..i18n['datetime']['julian']
end
end
end
if not raw then
local ce = nil
if sign < 0 then
ce = i18n['datetime']['BCE']
elseif precision <= 5 then
ce = i18n['datetime']['CE']
end
if ce then
if link then
ce = buildWikilink(i18n['datetime']['common-era'], ce)
end
suffix = suffix .. " " .. ce
end
value = tostring(yRound)
if m then
dateStr = self.langObj:formatDate("F", "1-"..m.."-1")
if d then
if self.mdyDate then
dateStr = dateStr .. " " .. d .. ","
else
dateStr = d .. " " .. dateStr
end
end
value = dateStr .. " " .. value
end
value = prefix .. value .. suffix .. calendar
else
value = padZeros(yRound * sign, 4)
if m then
value = value .. "-" .. padZeros(m, 2)
if d then
value = value .. "-" .. padZeros(d, 2)
end
end
value = value .. calendar
end
return value
elseif datatype == 'globecoordinate' then
-- logic from https://github.com/DataValues/Geo (v4.0.1)
local precision, unitsPerDegree, numDigits, strFormat, value, globe
local latitude, latConv, latValue, latLink
local longitude, lonConv, lonValue, lonLink
local latDirection, latDirectionN, latDirectionS, latDirectionEN
local lonDirection, lonDirectionE, lonDirectionW, lonDirectionEN
local degSymbol, minSymbol, secSymbol, separator
local latDegrees = nil
local latMinutes = nil
local latSeconds = nil
local lonDegrees = nil
local lonMinutes = nil
local lonSeconds = nil
local latDegSym = ""
local latMinSym = ""
local latSecSym = ""
local lonDegSym = ""
local lonMinSym = ""
local lonSecSym = ""
local latDirectionEN_N = "N"
local latDirectionEN_S = "S"
local lonDirectionEN_E = "E"
local lonDirectionEN_W = "W"
if not raw then
latDirectionN = i18n['coord']['latitude-north']
latDirectionS = i18n['coord']['latitude-south']
lonDirectionE = i18n['coord']['longitude-east']
lonDirectionW = i18n['coord']['longitude-west']
degSymbol = i18n['coord']['degrees']
minSymbol = i18n['coord']['minutes']
secSymbol = i18n['coord']['seconds']
separator = i18n['coord']['separator']
else
latDirectionN = latDirectionEN_N
latDirectionS = latDirectionEN_S
lonDirectionE = lonDirectionEN_E
lonDirectionW = lonDirectionEN_W
degSymbol = "/"
minSymbol = "/"
secSymbol = "/"
separator = "/"
end
latitude = datavalue['latitude']
longitude = datavalue['longitude']
if latitude < 0 then
latDirection = latDirectionS
latDirectionEN = latDirectionEN_S
latitude = math.abs(latitude)
else
latDirection = latDirectionN
latDirectionEN = latDirectionEN_N
end
if longitude < 0 then
lonDirection = lonDirectionW
lonDirectionEN = lonDirectionEN_W
longitude = math.abs(longitude)
else
lonDirection = lonDirectionE
lonDirectionEN = lonDirectionEN_E
end
precision = datavalue['precision']
if not precision or precision <= 0 then
precision = 1 / 3600 -- precision not set (correctly), set to arcsecond
end
-- remove insignificant detail
latitude = math.floor(latitude / precision + 0.5) * precision
longitude = math.floor(longitude / precision + 0.5) * precision
if precision >= 1 - (1 / 60) and precision < 1 then
precision = 1
elseif precision >= (1 / 60) - (1 / 3600) and precision < (1 / 60) then
precision = 1 / 60
end
if precision >= 1 then
unitsPerDegree = 1
elseif precision >= (1 / 60) then
unitsPerDegree = 60
else
unitsPerDegree = 3600
end
numDigits = math.ceil(-math.log10(unitsPerDegree * precision))
if numDigits <= 0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
strFormat = "%." .. numDigits .. "f"
if precision >= 1 then
latDegrees = strFormat:format(latitude)
lonDegrees = strFormat:format(longitude)
if not raw then
latDegSym = replaceDecimalMark(latDegrees) .. degSymbol
lonDegSym = replaceDecimalMark(lonDegrees) .. degSymbol
else
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
end
else
latConv = math.floor(latitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
lonConv = math.floor(longitude * unitsPerDegree * 10^numDigits + 0.5) / 10^numDigits
if precision >= (1 / 60) then
latMinutes = latConv
lonMinutes = lonConv
else
latSeconds = latConv
lonSeconds = lonConv
latMinutes = math.floor(latSeconds / 60)
lonMinutes = math.floor(lonSeconds / 60)
latSeconds = strFormat:format(latSeconds - (latMinutes * 60))
lonSeconds = strFormat:format(lonSeconds - (lonMinutes * 60))
if not raw then
latSecSym = replaceDecimalMark(latSeconds) .. secSymbol
lonSecSym = replaceDecimalMark(lonSeconds) .. secSymbol
else
latSecSym = latSeconds .. secSymbol
lonSecSym = lonSeconds .. secSymbol
end
end
latDegrees = math.floor(latMinutes / 60)
lonDegrees = math.floor(lonMinutes / 60)
latDegSym = latDegrees .. degSymbol
lonDegSym = lonDegrees .. degSymbol
latMinutes = latMinutes - (latDegrees * 60)
lonMinutes = lonMinutes - (lonDegrees * 60)
if precision >= (1 / 60) then
latMinutes = strFormat:format(latMinutes)
lonMinutes = strFormat:format(lonMinutes)
if not raw then
latMinSym = replaceDecimalMark(latMinutes) .. minSymbol
lonMinSym = replaceDecimalMark(lonMinutes) .. minSymbol
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
else
latMinSym = latMinutes .. minSymbol
lonMinSym = lonMinutes .. minSymbol
end
end
latValue = latDegSym .. latMinSym .. latSecSym .. latDirection
lonValue = lonDegSym .. lonMinSym .. lonSecSym .. lonDirection
value = latValue .. separator .. lonValue
if link then
globe = parseWikidataURL(datavalue['globe'])
if globe then
globe = mw.wikibase.getLabelByLang(globe, "en"):lower()
else
globe = "earth"
end
latLink = table.concat({latDegrees, latMinutes, latSeconds}, "_")
lonLink = table.concat({lonDegrees, lonMinutes, lonSeconds}, "_")
value = "[https://geohack.toolforge.org/geohack.php?language="..self.langCode.."¶ms="..latLink.."_"..latDirectionEN.."_"..lonLink.."_"..lonDirectionEN.."_globe:"..globe.." "..value.."]"
end
return value
elseif datatype == 'wikibase-entityid' then
local label
local itemID = datavalue['numeric-id']
if subtype == 'wikibase-item' then
itemID = "Q" .. itemID
elseif subtype == 'wikibase-property' then
itemID = "P" .. itemID
else
return '<strong class="error">' .. errorText('unknown-data-type', subtype) .. '</strong>'
end
label = self:getLabel(itemID, raw, link, short)
if label == "" then
label = nil
end
return label
else
return '<strong class="error">' .. errorText('unknown-data-type', datatype) .. '</strong>'
end
elseif snak.snaktype == 'somevalue' and not noSpecial then
if raw then
return " " -- single space represents 'somevalue'
else
return i18n['values']['unknown']
end
elseif snak.snaktype == 'novalue' and not noSpecial then
if raw then
return "" -- empty string represents 'novalue'
else
return i18n['values']['none']
end
else
return nil
end
end
function Config:getSingleRawQualifier(claim, qualifierID)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[qualifierID] end
if qualifiers and qualifiers[1] then
return self:getValue(qualifiers[1], true) -- raw = true
else
return nil
end
end
function Config:snakEqualsValue(snak, value)
local snakValue = self:getValue(snak, true) -- raw = true
if snakValue and snak.snaktype == 'value' and snak.datavalue.type == 'wikibase-entityid' then value = value:upper() end
return snakValue == value
end
function Config:setRank(rank)
local rankPos
if rank == p.flags.best then
self.bestRank = true
self.flagBest = true -- mark that 'best' flag was given
return
end
if rank:sub(1,9) == p.flags.preferred then
rankPos = 1
elseif rank:sub(1,6) == p.flags.normal then
rankPos = 2
elseif rank:sub(1,10) == p.flags.deprecated then
rankPos = 3
else
return
end
-- one of the rank flags was given, check if another one was given before
if not self.flagRank then
self.ranks = {false, false, false} -- no other rank flag given before, so unset ranks
self.bestRank = self.flagBest -- unsets bestRank only if 'best' flag was not given before
self.flagRank = true -- mark that a rank flag was given
end
if rank:sub(-1) == "+" then
for i = rankPos, 1, -1 do
self.ranks[i] = true
end
elseif rank:sub(-1) == "-" then
for i = rankPos, #self.ranks do
self.ranks[i] = true
end
else
self.ranks[rankPos] = true
end
end
function Config:setPeriod(period)
local periodPos
if period == p.flags.future then
periodPos = 1
elseif period == p.flags.current then
periodPos = 2
elseif period == p.flags.former then
periodPos = 3
else
return
end
-- one of the period flags was given, check if another one was given before
if not self.flagPeriod then
self.periods = {false, false, false} -- no other period flag given before, so unset periods
self.flagPeriod = true -- mark that a period flag was given
end
self.periods[periodPos] = true
end
function Config:qualifierMatches(claim, id, value)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[id] end
if qualifiers then
for _, v in pairs(qualifiers) do
if self:snakEqualsValue(v, value) then
return true
end
end
elseif value == "" then
-- if the qualifier is not present then treat it the same as the special value 'novalue'
return true
end
return false
end
function Config:rankMatches(rankPos)
if self.bestRank then
return (self.ranks[rankPos] and self.foundRank >= rankPos)
else
return self.ranks[rankPos]
end
end
function Config:timeMatches(claim)
local startTime = nil
local startTimeY = nil
local startTimeM = nil
local startTimeD = nil
local endTime = nil
local endTimeY = nil
local endTimeM = nil
local endTimeD = nil
if self.periods[1] and self.periods[2] and self.periods[3] then
-- any time
return true
end
startTime = self:getSingleRawQualifier(claim, aliasesP.startTime)
if startTime and startTime ~= "" and startTime ~= " " then
startTimeY, startTimeM, startTimeD = parseDate(startTime)
end
endTime = self:getSingleRawQualifier(claim, aliasesP.endTime)
if endTime and endTime ~= "" and endTime ~= " " then
endTimeY, endTimeM, endTimeD = parseDate(endTime)
end
if startTimeY ~= nil and endTimeY ~= nil and datePrecedesDate(endTimeY, endTimeM, endTimeD, startTimeY, startTimeM, startTimeD) then
-- invalidate end time if it precedes start time
endTimeY = nil
endTimeM = nil
endTimeD = nil
end
if self.periods[1] then
-- future
if startTimeY and datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD) then
return true
end
end
if self.periods[2] then
-- current
if (startTimeY == nil or not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], startTimeY, startTimeM, startTimeD)) and
(endTimeY == nil or datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD)) then
return true
end
end
if self.periods[3] then
-- former
if endTimeY and not datePrecedesDate(self.atDate[1], self.atDate[2], self.atDate[3], endTimeY, endTimeM, endTimeD) then
return true
end
end
return false
end
function Config:processFlag(flag)
if not flag then
return false
end
if flag == p.flags.linked then
self.curState.linked = true
return true
elseif flag == p.flags.raw then
self.curState.rawValue = true
if self.curState == self.states[parameters.reference] then
-- raw reference values end with periods and require a separator (other than none)
self.separators["sep%r"][1] = {" "}
end
return true
elseif flag == p.flags.short then
self.curState.shortName = true
return true
elseif flag == p.flags.multilanguage then
self.curState.anyLanguage = true
return true
elseif flag == p.flags.unit then
self.curState.unitOnly = true
return true
elseif flag == p.flags.mdy then
self.mdyDate = true
return true
elseif flag == p.flags.single then
self.singleClaim = true
return true
elseif flag == p.flags.sourced then
self.sourcedOnly = true
return true
elseif flag == p.flags.edit then
self.editable = true
return true
elseif flag == p.flags.editAtEnd then
self.editable = true
self.editAtEnd = true
return true
elseif flag == p.flags.best or flag:match('^'..p.flags.preferred..'[+-]?$') or flag:match('^'..p.flags.normal..'[+-]?$') or flag:match('^'..p.flags.deprecated..'[+-]?$') then
self:setRank(flag)
return true
elseif flag == p.flags.future or flag == p.flags.current or flag == p.flags.former then
self:setPeriod(flag)
return true
elseif flag == "" then
-- ignore empty flags and carry on
return true
else
return false
end
end
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
end
if flag == p.claimCommands.property or flag == p.claimCommands.properties then
param = parameters.property
elseif flag == p.claimCommands.qualifier or flag == p.claimCommands.qualifiers then
self.states.qualifiersCount = self.states.qualifiersCount + 1
param = parameters.qualifier .. self.states.qualifiersCount
self.separators["sep"..param] = {copyTable(defaultSeparators["sep%q\\d"])}
elseif flag == p.claimCommands.reference or flag == p.claimCommands.references then
param = parameters.reference
else
return self:processFlag(flag)
end
if self.states[param] then
return false
end
-- create a new state for each command
self.states[param] = State:new(self, param)
-- use "%x" as the general parameter name
self.states[param].parsedFormat = parseFormat(parameters.general) -- will be overwritten for param=="%p"
-- set the separator
self.states[param].separator = self.separators["sep"..param] -- will be nil for param=="%p", which will be set separately
if flag == p.claimCommands.property or flag == p.claimCommands.qualifier or flag == p.claimCommands.reference then
self.states[param].singleValue = true
end
self.curState = self.states[param]
return true
end
function Config:processSeparators(args)
local sep
for i, v in pairs(self.separators) do
if args[i] then
sep = replaceSpecialChars(args[i])
if sep ~= "" then
self.separators[i][1] = {sep}
else
self.separators[i][1] = nil
end
end
end
end
function Config:setFormatAndSeparators(state, parsedFormat)
state.parsedFormat = parsedFormat
state.separator = self.separators["sep"]
state.movSeparator = self.separators["sep"..parameters.separator]
state.puncMark = self.separators["punc"]
end
-- determines if a claim has references by prefetching them from the claim using getReferences,
-- which applies some filtering that determines if a reference is actually returned,
-- and caches the references for later use
function State:isSourced(claim)
self.conf.prefetchedRefs = self:getReferences(claim)
return (#self.conf.prefetchedRefs > 0)
end
function State:resetCaches()
-- any prefetched references of the previous claim must not be used
self.conf.prefetchedRefs = nil
end
function State:claimMatches(claim)
local matches, rankPos
-- first of all, reset any cached values used for the previous claim
self:resetCaches()
-- if a property value was given, check if it matches the claim's property value
if self.conf.propertyValue then
matches = self.conf:snakEqualsValue(claim.mainsnak, self.conf.propertyValue)
else
matches = true
end
-- if any qualifier values were given, check if each matches one of the claim's qualifier values
for i, v in pairs(self.conf.qualifierIDsAndValues) do
matches = (matches and self.conf:qualifierMatches(claim, i, v))
end
-- check if the claim's rank and time period match
rankPos = rankTable[claim.rank] or 4
matches = (matches and self.conf:rankMatches(rankPos) and self.conf:timeMatches(claim))
-- if only claims with references must be returned, check if this one has any
if self.conf.sourcedOnly then
matches = (matches and self:isSourced(claim)) -- prefetches and caches references
end
return matches, rankPos
end
function State:out()
local result -- collection of arrays with value objects
local valuesArray -- array with value objects
local sep = nil -- value object
local out = {} -- array with value objects
local function walk(formatTable, result)
local valuesArray = {} -- array with value objects
for i, v in pairs(formatTable.req) do
if not result[i] or not result[i][1] then
-- we've got no result for a parameter that is required on this level,
-- so skip this level (and its children) by returning an empty result
return {}
end
end
for _, v in ipairs(formatTable) do
if v.param then
valuesArray = mergeArrays(valuesArray, result[v.str])
elseif v.str ~= "" then
valuesArray[#valuesArray + 1] = {v.str}
end
if v.child then
valuesArray = mergeArrays(valuesArray, walk(v.child, result))
end
end
return valuesArray
end
-- iterate through the results from back to front, so that we know when to add separators
for i = #self.results, 1, -1 do
result = self.results[i]
-- if there is already some output, then add the separators
if #out > 0 then
sep = self.separator[1] -- fixed separator
result[parameters.separator] = {self.movSeparator[1]} -- movable separator
else
sep = nil
result[parameters.separator] = {self.puncMark[1]} -- optional punctuation mark
end
valuesArray = walk(self.parsedFormat, result)
if #valuesArray > 0 then
if sep then
valuesArray[#valuesArray + 1] = sep
end
out = mergeArrays(valuesArray, out)
end
end
-- reset state before next iteration
self.results = {}
return out
end
-- level 1 hook
function State:getProperty(claim)
local value = {self:getValue(claim.mainsnak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getQualifiers(claim, param)
local qualifiers
if claim.qualifiers then qualifiers = claim.qualifiers[self.conf.qualifierIDs[param]] end
if qualifiers then
-- iterate through claim's qualifier statements to collect their values;
-- return array with multiple value objects
return self.conf.states[param]:iterate(qualifiers, {[parameters.general] = hookNames[parameters.qualifier.."\\d"][2], count = 1}) -- pass qualifier state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getQualifier(snak)
local value = {self:getValue(snak)} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getAllQualifiers(claim, param, result, hooks)
local out = {} -- array with value objects
local sep = self.conf.separators["sep"..parameters.qualifier][1] -- value object
-- iterate through the output of the separate "qualifier(s)" commands
for i = 1, self.conf.states.qualifiersCount do
-- if a hook has not been called yet, call it now
if not result[parameters.qualifier..i] then
self:callHook(parameters.qualifier..i, hooks, claim, result)
end
-- if there is output for this particular "qualifier(s)" command, then add it
if result[parameters.qualifier..i] and result[parameters.qualifier..i][1] then
-- if there is already some output, then add the separator
if #out > 0 and sep then
out[#out + 1] = sep
end
out = mergeArrays(out, result[parameters.qualifier..i])
end
end
return out
end
-- level 1 hook
function State:getReferences(claim)
if self.conf.prefetchedRefs then
-- return references that have been prefetched by isSourced
return self.conf.prefetchedRefs
end
if claim.references then
-- iterate through claim's reference statements to collect their values;
-- return array with multiple value objects
return self.conf.states[parameters.reference]:iterate(claim.references, {[parameters.general] = hookNames[parameters.reference][2], count = 1}) -- pass reference state with level 2 hook
else
return {} -- return empty array
end
end
-- level 2 hook
function State:getReference(statement)
local citeParamMapping = i18n['cite']['param-mapping']
local citeConfig = i18n['cite']['config']
local citeTypes = i18n['cite']['output-types']
-- will hold rendered properties of the reference which are not directly from statement.snaks,
-- Namely, is URL generated from an external ID.
local additionalProcessedProperties = {}
-- for each citation type, there will be an associative array that associates lists of rendered properties
-- to citation-template parameters
local candidateParams = {}
-- like above, but only associates one rendered property to each parameter; if the above variable
-- contains more strings for a parameter, the strings will be assigned to numbered params (e.g. "author1")
local citeParams = {}
local citeErrors = {}
local referenceEmpty = true -- will be set to false if at least one parameter is left unremoved
local version = 12 -- increment this each time the below logic is changed to avoid conflict errors
if not statement.snaks then
return {}
end
-- don't use bot-added references referencing Wikimedia projects or containing "inferred from" (such references are not usable on Wikipedia)
if statement.snaks[aliasesP.importedFrom] or statement.snaks[aliasesP.wikimediaImportURL] or statement.snaks[aliasesP.inferredFrom] then
return {}
end
-- don't include "type of reference"
if statement.snaks[aliasesP.typeOfReference] then
statement.snaks[aliasesP.typeOfReference] = nil
end
-- don't include "image" to prevent littering
if statement.snaks[aliasesP.image] then
statement.snaks[aliasesP.image] = nil
end
-- don't include "ISO 3166-1 numeric code" - not a citable field, just metadata about the source's location
if statement.snaks["P299"] then
statement.snaks["P299"] = nil
end
-- if "retrieved" (access-date) is the only remaining property, this reference has no
-- actual source information (no URL, no stated-in, no title) and cannot be meaningfully
-- cited; skip it silently rather than showing an error
do
local onlyRetrieved = true
local hasAny = false
for snakProperty in pairs(statement.snaks) do
hasAny = true
if snakProperty ~= aliasesP.retrieved then
onlyRetrieved = false
break
end
end
if hasAny and onlyRetrieved then
return {}
end
end
-- don't include "language" if it is equal to the local one
if self:getReferenceDetail(statement.snaks, aliasesP.language) == self.conf.langName then
statement.snaks[aliasesP.language] = nil
end
if statement.snaks[aliasesP.statedIn] and not statement.snaks[aliasesP.referenceURL] then
-- "stated in" was given but "reference URL" was not.
-- get "Wikidata property" properties from the item in "stated in"
-- if any of the returned properties of the external-id datatype is in statement.snaks, generate a link from it and use the link in the reference
-- find the "Wikidata property" properties in the item from "stated in"
local wikidataPropertiesOfSource = mw.text.split(p._properties{p.flags.raw, aliasesP.wikidataProperty, [p.args.eid] = self.conf:getValue(statement.snaks[aliasesP.statedIn][1], true, false)}, ", ", true)
for i, wikidataPropertyOfSource in pairs(wikidataPropertiesOfSource) do
if statement.snaks[wikidataPropertyOfSource] and statement.snaks[wikidataPropertyOfSource][1].datatype == "external-id" then
local tempLink = self:getReferenceDetail(statement.snaks, wikidataPropertyOfSource, false, true) -- not raw, linked
if mw.ustring.match(tempLink, "^%[%Z- %Z+%]$") then -- getValue returned a URL in square brackets.
-- the link is in wiki markup, so strip the square brackets and the display text
-- gsub also returns another, discarted value, therefore the result is assigned to tempLink first
tempLink = mw.ustring.gsub(tempLink, "^%[(%Z-) %Z+%]$", "%1")
additionalProcessedProperties[aliasesP.referenceURL] = {tempLink}
statement.snaks[wikidataPropertyOfSource] = nil
break
end
end
end
end
-- initialize candidateParams and citeParams
for _, citeType in ipairs(citeTypes) do
candidateParams[citeType] = {}
citeParams[citeType] = {}
end
-- fill candidateParams
for _, citeType in ipairs(citeTypes) do
-- This will contain value--priority pairs for each param name.
local candidateValuesAndPriorities = {}
-- fill candidateValuesAndPriorities
for refProperty in pairs(statement.snaks) do
if citeErrors[citeType] then
break
end
repeat -- just a simple wrapper to emulate "continue"
-- set mappingKey and prefix
local mappingKey
local prefix = ""
if statement.snaks[refProperty][1].datatype == 'external-id' then
mappingKey = "external-id"
prefix = self.conf:getLabel(refProperty)
if prefix ~= "" then
prefix = prefix .. " "
end
else
mappingKey = refProperty
end
local paramName = citeParamMapping[citeType][mappingKey]
-- skip properties with empty parameter name
if paramName == "" then
break -- skip this property for this value of citeType
end
-- handle unknown properties in the reference
if not paramName then
referenceEmpty = false
local error_message = errorText("unknown-property-in-ref", refProperty)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
break
end
-- set processedProperty
local processedProperty
local raw = false -- if the value is wanted raw
if isValueInTable(paramName, citeConfig[citeType]["raw-value-params"] or {}) then
raw = true
end
if isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
-- Multiple values may be given.
processedProperty = self:getReferenceDetails(statement.snaks, refProperty, raw, self.linked, true) -- anyLang = true
else
-- If multiple values are given, all but the first suitable one are discarted.
processedProperty = {self:getReferenceDetail(statement.snaks, refProperty, raw, self.linked and (statement.snaks[refProperty][1].datatype ~= 'url'), true)} -- link = true/false, anyLang = true
end
if #processedProperty == 0 then
break
end
referenceEmpty = false
-- add an empty entry to candidateValuesAndPriorities, if there isn't one already
if not candidateValuesAndPriorities[paramName] then
candidateValuesAndPriorities[paramName] = {}
end
-- find the priority of refProperty
local thisPropertyPriority = -1
local thisParamPrioritization = citeConfig[citeType]["prioritization"][paramName]
if thisParamPrioritization then
for i_priority, i_property in ipairs(thisParamPrioritization) do
if i_property == refProperty then
thisPropertyPriority = i_priority
end
end
end
for _, propertyValue in pairs(processedProperty) do
table.insert(
candidateValuesAndPriorities[paramName],
{prefix .. propertyValue, thisPropertyPriority}
)
end
until true
end
-- fill candidateParams[citeType]
if not citeErrors[citeType] then
local compareValuePriorities = function(pair1, pair2)
if pair1[2] == -1 and pair2[2] ~= -1 then
return false
end
if pair1[2] ~= -1 and pair2[2] == -1 then
return true
end
return pair1[2] < pair2[2]
end
-- fill candidateParams[citeType][paramName] for each used param
for paramName, _ in pairs(candidateValuesAndPriorities) do
table.sort(candidateValuesAndPriorities[paramName], compareValuePriorities)
candidateParams[citeType][paramName] = {}
for _, valuePriorityPair in ipairs(candidateValuesAndPriorities[paramName]) do
table.insert(candidateParams[citeType][paramName], valuePriorityPair[1])
end
end
end
end
-- handle additional properties
for refProperty in pairs(additionalProcessedProperties) do
for _, citeType in ipairs(citeTypes) do
repeat
-- skip if there already have been errors
if citeErrors[citeType] then
break
end
local paramName = citeParamMapping[citeType][refProperty]
-- handle unknown properties in the reference
if not paramName then
-- Skip this additional property, but do not cause an error.
break
end
if paramName == "" then
break
end
referenceEmpty = false
if not candidateParams[citeType][paramName] then
candidateParams[citeType][paramName] = {}
end
for _, propertyValue in pairs(additionalProcessedProperties[refProperty]) do
table.insert(candidateParams[citeType][paramName], propertyValue)
end
until true
end
end
-- fill citeParams
for _, citeType in ipairs(citeTypes) do
for paramName, paramValues in pairs(candidateParams[citeType]) do
if #paramValues == 1 or not isValueInTable(paramName, citeConfig[citeType]["numbered-params"] or {}) then
citeParams[citeType][paramName] = paramValues[1]
else
-- There is more than one value for this parameter - the values will
-- go into separate numbered parameters (e.g. "author1", "author2")
for paramNum, paramValue in pairs(paramValues) do
citeParams[citeType][paramName .. paramNum] = paramValue
end
end
end
end
-- archive-only references: recover the original URL (and archive date) from the archive link
for _, citeType in ipairs(citeTypes) do
local urlParam = citeParamMapping[citeType][aliasesP.referenceURL]
local archiveUrlParam = citeParamMapping[citeType][aliasesP.archiveURL]
local archiveDateParam = citeParamMapping[citeType][aliasesP.archiveDate]
local cp = citeParams[citeType]
if urlParam and urlParam ~= "" and archiveUrlParam and archiveUrlParam ~= ""
and not cp[urlParam] and cp[archiveUrlParam] then
local archiveUrl = cp[archiveUrlParam]
local stamp, original = mw.ustring.match(archiveUrl, "^https?://web%.archive%.org/web/(%d+)[%a_]*/(https?://.+)$")
if not original then
stamp, original = mw.ustring.match(archiveUrl, "^https?://archive%.[a-z]+/(%d+)/(https?://.+)$")
end
cp[urlParam] = original or archiveUrl
if stamp and archiveDateParam and archiveDateParam ~= "" and not cp[archiveDateParam] and #stamp >= 8 then
cp[archiveDateParam] = stamp:sub(1,4) .. "-" .. stamp:sub(5,6) .. "-" .. stamp:sub(7,8)
end
end
end
-- fallback: use "stated in" (P248) as title if "title" (P1476) is missing;
-- if neither is present, fall back to the reference URL's domain name
for _, citeType in ipairs(citeTypes) do
local titleParam = citeParamMapping[citeType][aliasesP.title]
local urlParam = citeParamMapping[citeType][aliasesP.referenceURL]
if titleParam and not citeParams[citeType][titleParam] then
if statement.snaks[aliasesP.statedIn] then
local fallbackTitle = self:getReferenceDetail(
statement.snaks,
aliasesP.statedIn,
false,
false
)
if fallbackTitle and fallbackTitle ~= "" then
citeParams[citeType][titleParam] = fallbackTitle
end
end
-- still nothing? try the URL's domain as a last resort
if not citeParams[citeType][titleParam] and urlParam and citeParams[citeType][urlParam] then
local domain = mw.ustring.match(citeParams[citeType][urlParam], "^%a+://([^/]+)")
if domain then
citeParams[citeType][titleParam] = domain
end
end
end
end
-- handle missing mandatory parameters for the templates
for _, citeType in ipairs(citeTypes) do
for _, requiredCiteParam in pairs(citeConfig[citeType]["mandatory-params"] or {}) do
if not citeParams[citeType][requiredCiteParam] then -- The required param is not present.
if citeErrors[citeType] then -- Do not override the previous error, if it exists.
break
end
local error_message = errorText("missing-mandatory-param", requiredCiteParam)
assert(error_message) -- Should not be nil
citeErrors[citeType] = error_message
end
end
end
local citeTypeToUse = nil
-- choose the output template
for _, citeType in ipairs(citeTypes) do
if not citeErrors[citeType] then
citeTypeToUse = citeType
break
end
end
-- set refContent
local refContent = ""
if citeTypeToUse then
local templateToUse = citeConfig[citeTypeToUse]["template"]
local paramsToUse = citeParams[citeTypeToUse]
if not templateToUse or templateToUse == "" then
throwError("no-such-reference-template", tostring(templateToUse), i18nPath, citeTypeToUse)
end
-- if this module is being substituted then build a regular template call, otherwise expand the template
if mw.isSubsting() then
for i, v in pairs(paramsToUse) do
refContent = refContent .. "|" .. i .. "=" .. v
end
refContent = "{{" .. templateToUse .. refContent .. "}}"
else
xpcall(
function () refContent = mw.getCurrentFrame():expandTemplate{title=templateToUse, args=paramsToUse} end,
function () throwError("no-such-reference-template", templateToUse, i18nPath, citeTypeToUse) end
)
end
-- If the citation couldn't be displayed using any template, but is not empty (barring ignored propeties), throw an error.
elseif not referenceEmpty then
refContent = errorText("malformed-reference-header")
for _, citeType in ipairs(citeTypes) do
refContent = refContent .. errorText("template-failure-reason", citeConfig[citeType]["template"], citeErrors[citeType])
end
refContent = refContent .. errorText("malformed-reference-footer")
end
-- wrap refContent
local ref = {}
if refContent ~= "" then
ref = {refContent}
if not self.rawValue then
-- this should become a <ref> tag, so save the reference's hash for later
ref.refHash = "wikidata-" .. statement.hash .. "-v" .. (tonumber(i18n['version']) + version)
end
return {ref}
else
return {}
end
end
-- gets a detail of one particular type for a reference
function State:getReferenceDetail(snaks, dType, raw, link, anyLang)
local switchLang = anyLang
local value = nil
if not snaks[dType] then
return nil
end
-- if anyLang, first try the local language and otherwise any language
repeat
for _, v in ipairs(snaks[dType]) do
value = self.conf:getValue(v, raw, link, false, anyLang and not switchLang, false, true) -- noSpecial = true
if value then
break
end
end
if value or not anyLang then
break
end
switchLang = not switchLang
until anyLang and switchLang
return value
end
-- gets the details of one particular type for a reference
function State:getReferenceDetails(snaks, dType, raw, link, anyLang)
local values = {}
if not snaks[dType] then
return {}
end
for _, v in ipairs(snaks[dType]) do
-- if nil is returned then it will not be added to the table
values[#values + 1] = self.conf:getValue(v, raw, link, false, anyLang, false, true) -- noSpecial = true
end
return values
end
-- level 1 hook
function State:getAlias(object)
local value = object.value
local title = nil
if value and self.linked then
if self.conf.entityID:sub(1,1) == "Q" then
title = mw.wikibase.getSitelink(self.conf.entityID)
elseif self.conf.entityID:sub(1,1) == "P" then
title = "d:Property:" .. self.conf.entityID
end
if title then
value = buildWikilink(title, value)
end
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
-- level 1 hook
function State:getBadge(value)
value = self.conf:getLabel(value, self.rawValue, self.linked, self.shortName)
if value == "" then
value = nil
end
value = {value} -- create one value object
if #value > 0 then
return {value} -- wrap the value object in an array and return it
else
return {} -- return empty array if there was no value
end
end
function State:callHook(param, hooks, statement, result)
-- call a parameter's hook if it has been defined and if it has not been called before
if not result[param] and hooks[param] then
local valuesArray = self[hooks[param]](self, statement, param, result, hooks) -- array with value objects
-- add to the result
if #valuesArray > 0 then
result[param] = valuesArray
result.count = result.count + 1
else
result[param] = {} -- an empty array to indicate that we've tried this hook already
return true -- miss == true
end
end
return false
end
-- iterate through claims, claim's qualifiers or claim's references to collect values
function State:iterate(statements, hooks, matchHook)
matchHook = matchHook or alwaysTrue
local matches = false
local rankPos = nil
local result, gotRequired
for _, v in ipairs(statements) do
-- rankPos will be nil for non-claim statements (e.g. qualifiers, references, etc.)
matches, rankPos = matchHook(self, v)
if matches then
result = {count = 0} -- collection of arrays with value objects
local function walk(formatTable)
local miss
for i2, v2 in pairs(formatTable.req) do
-- call a hook, adding its return value to the result
miss = self:callHook(i2, hooks, v, result)
if miss then
-- we miss a required value for this level, so return false
return false
end
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point breaks the loop
return true
end
end
for _, v2 in ipairs(formatTable) do
if result.count == hooks.count then
-- we're done if all hooks have been called;
-- returning at this point prevents further childs from being processed
return true
end
if v2.child then
walk(v2.child)
end
end
return true
end
gotRequired = walk(self.parsedFormat)
-- only append the result if we got values for all required parameters on the root level
if gotRequired then
-- if we have a rankPos (only with matchHook() for complete claims), then update the foundRank
if rankPos and self.conf.foundRank > rankPos then
self.conf.foundRank = rankPos
end
-- append the result
self.results[#self.results + 1] = result
-- break if we only need a single value
if self.singleValue then
break
end
end
end
end
return self:out()
end
local function getEntityId(arg, eid, page, allowOmitPropPrefix, globalSiteId)
local id = nil
local prop = nil
if arg then
if arg:sub(1,1) == ":" then
page = arg
eid = nil
elseif arg:sub(1,1):upper() == "Q" or arg:sub(1,9):lower() == "property:" or allowOmitPropPrefix then
eid = arg
page = nil
else
prop = arg
end
end
if eid then
if eid:sub(1,9):lower() == "property:" then
id = replaceAlias(mw.text.trim(eid:sub(10)))
if id:sub(1,1):upper() ~= "P" then
id = ""
end
else
id = replaceAlias(eid)
end
elseif page then
if page:sub(1,1) == ":" then
page = mw.text.trim(page:sub(2))
end
id = mw.wikibase.getEntityIdForTitle(page, globalSiteId) or ""
end
if not id then
id = mw.wikibase.getEntityIdForCurrentPage() or ""
end
id = id:upper()
if not mw.wikibase.isValidEntityId(id) then
id = ""
end
return id, prop
end
local function nextArg(args)
local arg = args[args.pointer]
if arg then
args.pointer = args.pointer + 1
return mw.text.trim(arg)
else
return nil
end
end
local function claimCommand(args, funcName)
local cfg = Config:new()
cfg:processFlagOrCommand(funcName) -- process first command (== function name)
local lastArg, parsedFormat, formatParams, claims, value
local hooks = {count = 0}
-- set the date if given;
-- must come BEFORE processing the flags
if args[p.args.date] then
cfg.atDate = {parseDate(args[p.args.date])}
cfg.periods = {false, true, false} -- change default time constraint to 'current'
end
-- process flags and commands
repeat
lastArg = nextArg(args)
until not cfg:processFlagOrCommand(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID, cfg.propertyID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], false, args[p.args.globalSiteId])
if cfg.entityID == "" then
return "" -- we cannot continue without a valid entity ID
end
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if not cfg.propertyID then
cfg.propertyID = nextArg(args)
end
cfg.propertyID = replaceAlias(cfg.propertyID)
if not cfg.entity or not cfg.propertyID then
return "" -- we cannot continue without an entity or a property ID
end
cfg.propertyID = cfg.propertyID:upper()
if not cfg.entity.claims or not cfg.entity.claims[cfg.propertyID] then
return "" -- there is no use to continue without any claims
end
claims = cfg.entity.claims[cfg.propertyID]
if cfg.states.qualifiersCount > 0 then
-- do further processing if "qualifier(s)" command was given
if #args - args.pointer + 1 > cfg.states.qualifiersCount then
-- claim ID or literal value has been given
cfg.propertyValue = nextArg(args)
end
for i = 1, cfg.states.qualifiersCount do
-- check if given qualifier ID is an alias and add it
cfg.qualifierIDs[parameters.qualifier..i] = replaceAlias(nextArg(args) or ""):upper()
end
elseif cfg.states[parameters.reference] then
-- do further processing if "reference(s)" command was given
cfg.propertyValue = nextArg(args)
end
-- check for special property value 'somevalue' or 'novalue'
if cfg.propertyValue then
cfg.propertyValue = replaceSpecialChars(cfg.propertyValue)
if cfg.propertyValue ~= "" and mw.text.trim(cfg.propertyValue) == "" then
cfg.propertyValue = " " -- single space represents 'somevalue', whereas empty string represents 'novalue'
else
cfg.propertyValue = mw.text.trim(cfg.propertyValue)
end
end
-- parse the desired format, or choose an appropriate format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
elseif cfg.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif cfg.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
end
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if cfg.states.qualifiersCount > 0 and not cfg.states[parameters.property] then
cfg.separators["sep"..parameters.separator][1] = {";"}
end
-- if only "reference(s)" has been given, set the default separator to none (except when raw)
if cfg.states[parameters.reference] and not cfg.states[parameters.property] and cfg.states.qualifiersCount == 0
and not cfg.states[parameters.reference].rawValue then
cfg.separators["sep"][1] = nil
end
-- if exactly one "qualifier(s)" command has been given, make "sep%q" point to "sep%q1" to make them equivalent
if cfg.states.qualifiersCount == 1 then
cfg.separators["sep"..parameters.qualifier] = cfg.separators["sep"..parameters.qualifier.."1"]
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hooks that should be called (getProperty, getQualifiers, getReferences);
-- only define a hook if both its command ("propert(y|ies)", "reference(s)", "qualifier(s)") and its parameter ("%p", "%r", "%q1", "%q2", "%q3") have been given
for i, v in pairs(cfg.states) do
-- e.g. 'formatParams["%q1"] or formatParams["%q"]' to define hook even if "%q1" was not defined to be able to build a complete value for "%q"
if formatParams[i] or formatParams[i:sub(1, 2)] then
hooks[i] = getHookName(i, 1)
hooks.count = hooks.count + 1
end
end
-- the "%q" parameter is not attached to a state, but is a collection of the results of multiple states (attached to "%q1", "%q2", "%q3", ...);
-- so if this parameter is given then this hook must be defined separately, but only if at least one "qualifier(s)" command has been given
if formatParams[parameters.qualifier] and cfg.states.qualifiersCount > 0 then
hooks[parameters.qualifier] = getHookName(parameters.qualifier, 1)
hooks.count = hooks.count + 1
end
-- create a state for "properties" if it doesn't exist yet, which will be used as a base configuration for each claim iteration;
-- must come AFTER defining the hooks
if not cfg.states[parameters.property] then
cfg.states[parameters.property] = State:new(cfg, parameters.property)
-- if the "single" flag has been given then this state should be equivalent to "property" (singular)
if cfg.singleClaim then
cfg.states[parameters.property].singleValue = true
end
end
-- if the "sourced" flag has been given then create a state for "reference" if it doesn't exist yet, using default values,
-- which must exist in order to be able to determine if a claim has any references;
-- must come AFTER defining the hooks
if cfg.sourcedOnly and not cfg.states[parameters.reference] then
cfg:processFlagOrCommand(p.claimCommands.reference) -- use singular "reference" to minimize overhead
end
-- set the parsed format and the separators (and optional punctuation mark);
-- must come AFTER creating the additonal states
cfg:setFormatAndSeparators(cfg.states[parameters.property], parsedFormat)
-- process qualifier matching values, analogous to cfg.propertyValue
for i, v in pairs(args) do
i = tostring(i)
if i:match('^[Pp]%d+$') or aliasesP[i] then
v = replaceSpecialChars(v)
-- check for special qualifier value 'somevalue'
if v ~= "" and mw.text.trim(v) == "" then
v = " " -- single space represents 'somevalue'
end
cfg.qualifierIDsAndValues[replaceAlias(i):upper()] = v
end
end
-- first sort the claims on rank to pre-define the order of output (preferred first, then normal, then deprecated)
claims = sortOnRank(claims)
-- then iterate through the claims to collect values
value = cfg:concatValues(cfg.states[parameters.property]:iterate(claims, hooks, State.claimMatches)) -- pass property state with level 1 hooks and matchHook
-- if desired, add a clickable icon that may be used to edit the returned values on Wikidata
if cfg.editable and value ~= "" then
value = value .. cfg:getEditIcon()
end
return value
end
local function generalCommand(args, funcName)
local cfg = Config:new()
cfg.curState = State:new(cfg)
local lastArg
local value = nil
repeat
lastArg = nextArg(args)
until not cfg:processFlag(lastArg)
-- get the entity ID from either the positional argument, the eid argument or the page argument
cfg.entityID = getEntityId(lastArg, args[p.args.eid], args[p.args.page], true, args[p.args.globalSiteId])
if cfg.entityID == "" or not mw.wikibase.entityExists(cfg.entityID) then
return "" -- we cannot continue without an entity
end
-- serve according to the given command
if funcName == p.generalCommands.label then
value = cfg:getLabel(cfg.entityID, cfg.curState.rawValue, cfg.curState.linked, cfg.curState.shortName)
elseif funcName == p.generalCommands.title then
cfg.inSitelinks = true
if cfg.entityID:sub(1,1) == "Q" then
value = mw.wikibase.getSitelink(cfg.entityID)
end
if cfg.curState.linked and value then
value = buildWikilink(value)
end
elseif funcName == p.generalCommands.description then
value = mw.wikibase.getDescription(cfg.entityID)
else
local parsedFormat, formatParams
local hooks = {count = 0}
cfg.entity = mw.wikibase.getEntity(cfg.entityID)
if funcName == p.generalCommands.alias or funcName == p.generalCommands.badge then
cfg.curState.singleValue = true
end
if funcName == p.generalCommands.alias or funcName == p.generalCommands.aliases then
if not cfg.entity.aliases or not cfg.entity.aliases[cfg.langCode] then
return "" -- there is no use to continue without any aliasses
end
local aliases = cfg.entity.aliases[cfg.langCode]
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.alias)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getAlias);
-- only define the hook if the parameter ("%a") has been given
if formatParams[parameters.alias] then
hooks[parameters.alias] = getHookName(parameters.alias, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(aliases, hooks))
elseif funcName == p.generalCommands.badge or funcName == p.generalCommands.badges then
if not cfg.entity.sitelinks or not cfg.entity.sitelinks[cfg.siteID] or not cfg.entity.sitelinks[cfg.siteID].badges then
return "" -- there is no use to continue without any badges
end
local badges = cfg.entity.sitelinks[cfg.siteID].badges
cfg.inSitelinks = true
-- parse the desired format, or parse the default aliases format
if args["format"] then
parsedFormat, formatParams = parseFormat(args["format"])
else
parsedFormat, formatParams = parseFormat(formats.badge)
end
-- process overridden separator values;
-- must come AFTER tweaking the default separators
cfg:processSeparators(args)
-- define the hook that should be called (getBadge);
-- only define the hook if the parameter ("%b") has been given
if formatParams[parameters.badge] then
hooks[parameters.badge] = getHookName(parameters.badge, 1)
hooks.count = hooks.count + 1
end
-- set the parsed format and the separators (and optional punctuation mark)
cfg:setFormatAndSeparators(cfg.curState, parsedFormat)
-- iterate to collect values
value = cfg:concatValues(cfg.curState:iterate(badges, hooks))
end
end
value = value or ""
if cfg.editable and value ~= "" then
-- if desired, add a clickable icon that may be used to edit the returned value on Wikidata
value = value .. cfg:getEditIcon()
end
return value
end
-- modules that include this module should call the functions with an underscore prepended, e.g.: p._property(args)
local function establishCommands(commandList, commandFunc)
for _, commandName in pairs(commandList) do
local function wikitextWrapper(frame)
local args = copyTable(frame.args)
args.pointer = 1
loadI18n(aliasesP, frame)
return commandFunc(args, commandName)
end
p[commandName] = wikitextWrapper
local function luaWrapper(args)
args = copyTable(args)
args.pointer = 1
loadI18n(aliasesP)
return commandFunc(args, commandName)
end
p["_" .. commandName] = luaWrapper
end
end
establishCommands(p.claimCommands, claimCommand)
establishCommands(p.generalCommands, generalCommand)
-- main function that is supposed to be used by wrapper templates
function p.main(frame)
if not mw.wikibase then return nil end
local f, args
loadI18n(aliasesP, frame)
-- get the parent frame to take the arguments that were passed to the wrapper template
frame = frame:getParent() or frame
if not frame.args[1] then
throwError("no-function-specified")
end
f = mw.text.trim(frame.args[1])
if f == "main" then
throwError("main-called-twice")
end
assert(p["_"..f], errorText('no-such-function', f))
-- copy arguments from immutable to mutable table
args = copyTable(frame.args)
-- remove the function name from the list
table.remove(args, 1)
return p["_"..f](args)
end
return p
j8jlomf0ujrbnbwqaxqnzp268b92vc9
394747
394745
2026-10-18T16:09:17Z
MacTire02
219
oops
394747
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
0h2v9pft3v60kk4tj6qz7cn2mdr0fjn
394748
394747
2026-10-18T16:10:58Z
MacTire02
219
++
394748
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
sfi395ig54gkce2he9txfjz095vfz2u
394749
394748
2026-10-18T16:18:25Z
MacTire02
219
++
394749
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
e11qdhccz89xlh3fs0t4rqupowpb98h
394750
394749
2026-10-18T16:21:08Z
MacTire02
219
++
394750
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
7ruemmnruds36enjxa8qq9pzrph163x
394760
394750
2026-10-19T01:00:41Z
MacTire02
219
++
394760
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
-- Iran only: the head-of-state office list holds both the Supreme Leader and the
-- President, and the preferred one (the President) is also the government's office.
-- Take the first office that isn't the government's, i.e. the Supreme Leader.
if getCurrentCountryQid() == "Q794" and hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid then
for _, officeQid in ipairs(getWdRawPropertyIds("P1906")) do
if officeQid ~= hogOfficeQid then
hosOfficeQid = officeQid
break
end
end
end
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
stajikh6ojwdv120ibif4z15uzyr1nz
394763
394760
2026-10-19T01:28:06Z
MacTire02
219
++
394763
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
-- Iran only: its head-of-state offices are the Supreme Leader and the President, but
-- Wikidata ranks the President (also the government's office) as preferred, so the
-- module only ever sees that one. Use the Supreme Leader's office (Q332486) directly.
if getCurrentCountryQid() == "Q794" and hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid then
hosOfficeQid = "Q332486"
end
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
nip8a54o004dfy0ntedlcrq0d7a2x3s
394777
394763
2026-10-19T10:38:44Z
MacTire02
219
aafilley currit stiagh
394777
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Bullet rows (leaders etc.): the label may wrap, with a hanging indent so wrapped lines sit under the text, not the bullet
local SUBROW = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; padding-left:1.7em; padding-right:0.4em; text-indent:-0.8em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = SUBROW
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
-- Iran only: its head-of-state offices are the Supreme Leader and the President, but
-- Wikidata ranks the President (also the government's office) as preferred, so the
-- module only ever sees that one. Use the Supreme Leader's office (Q332486) directly.
if getCurrentCountryQid() == "Q794" and hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid then
hosOfficeQid = "Q332486"
end
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
f2jiq2m4fggsrq6418cg5t2zwg2v3yt
394778
394777
2026-10-19T10:40:16Z
MacTire02
219
aafilley currit stiagh
394778
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Bullet rows (leaders etc.): the label may wrap (capped at 10em, else the column grows to fit the longest label), with a hanging indent so wrapped lines sit under the text, not the bullet
local SUBROW = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; width:10em; max-width:10em; padding-left:1.7em; padding-right:0.4em; text-indent:-0.8em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = SUBROW
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
-- Iran only: its head-of-state offices are the Supreme Leader and the President, but
-- Wikidata ranks the President (also the government's office) as preferred, so the
-- module only ever sees that one. Use the Supreme Leader's office (Q332486) directly.
if getCurrentCountryQid() == "Q794" and hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid then
hosOfficeQid = "Q332486"
end
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
q55kbzfgyyiyth7dsfsffv3lizkb3zg
394779
394778
2026-10-19T10:44:20Z
MacTire02
219
prowal reesht
394779
Scribunto
text/plain
local p = {}
-- Wikidata fetch/citation module (replaces Module:WikidataIB).
local wdOK, Wd = pcall(require, "Module:Wd")
-- Country genitive/mutated forms, e.g. Mannin -> Vannin.
local enmynOK, EnmynCheerey = pcall(require, "Module:Enmyn çheerey")
-- Manx-label-or-linked-Wikidata-fallback helper; last rung of getWdItemManxLink.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local aarheynnOK, Aarheynn = pcall(require, "Module:Kishtey fys çheer/aarheynn")
-- Returns the first non-empty manual parameter from a list of names.
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
local withoutMarkers = mw.ustring.gsub(ref, "\127UNIQ.-QINU\127", "")
if mw.ustring.gsub(withoutMarkers, "%s+", "") == "" then
return ref
end
if mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
-- One or more <ref> tags (named or not) in the param value arrive here
-- already expanded into rendered footnote marker(s), e.g. "[6][7][8][9]".
local withoutRenderedMarkers = mw.ustring.gsub(ref, "%[%d+%]", "")
if mw.ustring.gsub(withoutRenderedMarkers, "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Shared innards of getWdProperty/getWdPropertyWithCitation.
local function getWdPropertyRaw(property, flags, includeReference)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(flags or {}) do table.insert(callArgs, f) end
if includeReference then table.insert(callArgs, "reference") end
table.insert(callArgs, "best") -- single best-ranked value
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and result ~= "" then return result end
return nil
end
-- References on a claim (current item, or item `eid`); value = raw id/string, nil takes all best statements.
local function getWdCitation(property, value, eid)
if not wdOK or not Wd or not Wd._reference or not property then return "" end
local callArgs = {"best", property}
if value then table.insert(callArgs, value) end
if eid then callArgs.eid = eid end
local ok, result = pcall(Wd._reference, callArgs)
if ok and result and result ~= "" then return result end
return ""
end
local function getWdProperty(property, flags)
return getWdPropertyRaw(property, flags, true)
end
local function getWdPropertyWithCitation(property, flags)
local base = getWdPropertyRaw(property, flags, false)
if not base then return nil, nil end
local withRef = getWdPropertyRaw(property, flags, true)
if not withRef or withRef == base then return base, nil end
if withRef:sub(1, #base) == base then
local citation = withRef:sub(#base + 1)
if citation ~= "" then return base, citation end
return base, nil
end
return withRef, nil
end
local function ensureLinked(value)
if not value or value == "" then return value end
local label, refSuffix = value:match("^(.-)(<ref.*)$")
if not label then
label = value
refSuffix = ""
end
if label:find("%[%[") or label:match("^%[https?://") then
return value
end
label = mw.text.trim(label)
if label == "" then return value end
return "[[" .. label .. "]]" .. refSuffix
end
-- Manx label of a Wikidata PROPERTY (e.g. P35 -> "head of state"), title
-- fallback. getLabelByLang avoids leaking an English fallback.
local function getWikidataPropertyLabel(property)
local ok, label = pcall(mw.wikibase.getLabelByLang, property, "gv")
if ok and label and label ~= "" then return label end
return nil
end
-- Raw QID of an entity-valued property on the current page's own item.
local function getWdRawPropertyId(property, extraFlags)
if not wdOK or not Wd or not Wd._property then return nil end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, "best")
table.insert(callArgs, property)
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawPropertyIds(property, extraFlags)
if not wdOK or not Wd or not Wd._properties then return {} end
local callArgs = {"raw"}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, property)
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
local function getWdQualifierRawId(property, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdQualifierRawIdForValue(property, valueQid, qualifierProperty)
if not wdOK or not Wd or not Wd._qualifier or not valueQid then return nil end
local ok, result = pcall(Wd._qualifier, {"raw", "best", property, valueQid, qualifierProperty})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
local function getWdRawForeignPropertyIds(eid, property, extraFlags, qualifiers)
if not wdOK or not Wd or not Wd._properties or not eid then return {} end
local callArgs = {}
for _, f in ipairs(extraFlags or {}) do table.insert(callArgs, f) end
table.insert(callArgs, "raw")
table.insert(callArgs, property)
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
for qid, value in pairs(qualifiers or {}) do
callArgs[qid] = value
end
local ok, result = pcall(Wd._properties, callArgs)
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- QID of the Wikidata item connected to the current page.
local function getCurrentCountryQid()
local ok, id = pcall(mw.wikibase.getEntityIdForCurrentPage)
if ok and id and id ~= "" then return id end
return nil
end
local function getCurrentCountryGenitive()
if not enmynOK or not EnmynCheerey or not EnmynCheerey.genitive then return nil end
local okTitle, title = pcall(function() return mw.title.getCurrentTitle().text end)
if not okTitle or not title or title == "" then return nil end
local okGen, genitive = pcall(EnmynCheerey.genitive, title)
if okGen and genitive and genitive ~= "" then return genitive end
return nil
end
local function getGenitiveLinkedLabel(baseWord)
local genitive = getCurrentCountryGenitive()
if genitive and genitive ~= "" then
return "[[" .. baseWord .. " " .. genitive .. "|" .. baseWord .. "]]"
end
return "[[" .. baseWord .. "]]"
end
local shortFormExceptions = {
["Çhiarn Vannin"] = true,
["Ree ny Belgee"] = true,
["Benrein ny Belgee"] = true,
-- Togo's head of government is titled "President of the Council of Ministers"
["Eaghtyrane Choonseil ny Shirveishee"] = true,
}
local function stripCountryGenitiveSuffix(text, countryGenitive)
if not text or not countryGenitive then return nil end
local suffix = " " .. countryGenitive
if #text > #suffix and text:sub(-#suffix) == suffix then
return text:sub(1, #text - #suffix)
end
local bareNoun = countryGenitive:match("^yn%s+(.+)$") or countryGenitive:match("^y%s+(.+)$")
if bareNoun and bareNoun ~= "" then
local suffix2 = " " .. bareNoun
if #text > #suffix2 and text:sub(-#suffix2) == suffix2 then
local remainder = text:sub(1, #text - #suffix2)
if remainder:sub(-3) == " yn" then
return remainder:sub(1, #remainder - 3)
elseif remainder:sub(-2) == " y" then
return remainder:sub(1, #remainder - 2)
end
return remainder
end
end
return nil
end
local function shortManxForm(title)
if not title or title == "" then return title end
if shortFormExceptions[title] then return title end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(title, countryGenitive)
if stripped then return stripped end
local short = title:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = title:match("^(.-)%syn%s")
if short and short ~= "" then return short end
-- "ny" is the plural/genitive connector
short = title:match("^(.-)%sny%s")
if short and short ~= "" then return short end
short = title:match("^(.+)%s%S+$")
if short and short ~= "" then return short end
return title
end
local function shortenCountrySuffixedName(name)
if not name or name == "" then return name end
local countryGenitive = getCurrentCountryGenitive()
local stripped = stripCountryGenitiveSuffix(name, countryGenitive)
if stripped then return stripped end
local short = name:match("^(.-)%sy%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%syn%s")
if short and short ~= "" then return short end
short = name:match("^(.-)%sny%s")
if short and short ~= "" then return short end
return name
end
local function shortenLinkedCountryName(value)
if not value or value == "" then return value end
local main, refSuffix = value:match("^(.-)(<ref.*)$")
if not main then
main = value
refSuffix = ""
end
local target, display = main:match("^%[%[([^%[%]|]+)|([^%[%]|]+)%]%]$")
if not target then
target = main:match("^%[%[([^%[%]|]+)%]%]$")
display = target
end
if not target then return value end
local short = shortenCountrySuffixedName(display)
if short ~= display then
return "[[" .. target .. "|" .. short .. "]]" .. refSuffix
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
local function getWdItemManxLink(qid, shorten, capitalize, forceRedlink, preferExternalForLabel)
if not qid then return nil end
if capitalize == nil then capitalize = true end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
if capitalize then
gvLabel = wikiUcfirst(gvLabel)
end
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if forceRedlink then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, _, _, rawLabel = pcall(EnnymWd.labelWithFallback, qid)
if ok and rawLabel and rawLabel ~= "" then
return "[[" .. wikiUcfirst(mw.text.nowiki(rawLabel)) .. "]]"
end
end
return nil
end
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
-- No gv sitelink yet
if not sitelinkTitle and preferExternalForLabel then
local display = (shorten == false) and gvLabel or shortManxForm(gvLabel)
return "[https://www.wikidata.org/wiki/" .. qid .. " " .. display .. "]"
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if shorten == false then
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
local short = shortManxForm(displayBase)
if short ~= target then
return "[[" .. target .. "|" .. short .. "]]"
end
return "[[" .. target .. "]]"
end
local function getWdOfficeItemTitle(officeProperty)
local officeQid = getWdRawPropertyId(officeProperty)
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
-- Same as getWdOfficeItemTitle, but the office property is read off a FOREIGN entity (eid) rather
local function getWdForeignOfficeItemTitle(eid, officeProperty)
local officeQid = getWdRawForeignPropertyIds(eid, officeProperty, {"best"})[1]
if not officeQid then return nil end
return getWdItemManxLink(officeQid)
end
local function getWdPositionTitleForPerson(personQid)
if not personQid then return nil end
local countryQid = getCurrentCountryQid()
local candidates = {}
if countryQid then
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"}, {["P1001"] = countryQid})) do
table.insert(candidates, id)
end
end
for _, id in ipairs(getWdRawForeignPropertyIds(personQid, "P39", {"current"})) do
table.insert(candidates, id)
end
local tried = {}
for _, qid in ipairs(candidates) do
if not tried[qid] then
tried[qid] = true
local link = getWdItemManxLink(qid)
if link then return link end
end
end
return nil
end
local function getWdPositionTitle(headProperty)
return getWdPositionTitleForPerson(getWdRawPropertyId(headProperty))
end
-- Wikidata's "upper house" / "lower house" class items.
local UPPER_HOUSE_QID = "Q637846"
local LOWER_HOUSE_QID = "Q375928"
local CLASS_WALK_DEPTH = 3
local function classReaches(classQid, targetQid, depth, seen)
if classQid == targetQid then return true end
if depth <= 0 then return false end
seen = seen or {}
if seen[classQid] then return false end
seen[classQid] = true
for _, superQid in ipairs(getWdRawForeignPropertyIds(classQid, "P279")) do
if classReaches(superQid, targetQid, depth - 1, seen) then return true end
end
return false
end
local function getWdChambers(legislatureQid)
if not legislatureQid then return nil, nil end
local partQids = getWdRawForeignPropertyIds(legislatureQid, "P527")
local upperQid, lowerQid = nil, nil
local upperAmbiguous, lowerAmbiguous = false, false
for _, partQid in ipairs(partQids) do
local isUpper, isLower = false, false
for _, classQid in ipairs(getWdRawForeignPropertyIds(partQid, "P31")) do
if classQid == UPPER_HOUSE_QID or classReaches(classQid, UPPER_HOUSE_QID, CLASS_WALK_DEPTH) then
isUpper = true
elseif classQid == LOWER_HOUSE_QID or classReaches(classQid, LOWER_HOUSE_QID, CLASS_WALK_DEPTH) then
isLower = true
end
end
if isUpper then
if upperQid and upperQid ~= partQid then upperAmbiguous = true end
upperQid = partQid
end
if isLower then
if lowerQid and lowerQid ~= partQid then lowerAmbiguous = true end
lowerQid = partQid
end
end
local upperLink = (upperQid and not upperAmbiguous) and getWdItemManxLink(upperQid, false, nil, nil, true) or nil
local lowerLink = (lowerQid and not lowerAmbiguous) and getWdItemManxLink(lowerQid, false, nil, nil, true) or nil
if upperLink then upperLink = upperLink .. getWdCitation("P527", upperQid, legislatureQid) end
if lowerLink then lowerLink = lowerLink .. getWdCitation("P527", lowerQid, legislatureQid) end
return upperLink, lowerLink
end
local JULIAN_CALENDAR_QID = "Q1985786"
local function getJulianCalendarSuffixLink()
local link = getWdItemManxLink(JULIAN_CALENDAR_QID, false)
if link then
local target = link:match("^%[%[([^%[%]|]+)") or link:match("^%[%[([^%[%]|]+)%]%]$")
if target then
return "[[" .. target .. "|Joolagh]]"
end
return link
end
return "Joolagh"
end
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Bullet rows (leaders etc.): the label may wrap (capped at 8em, else the column grows to fit the longest label), with a hanging indent so wrapped lines sit under the text, not the bullet
local SUBROW = '<tr%s><th style="vertical-align:top; text-align:left; font-weight:normal; width:8em; max-width:8em; padding-left:1.7em; padding-right:0.4em; text-indent:-0.8em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW_WRAP = SUBROW
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
-- Builds a class="..." attribute, or an empty string.
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function wikilinkLabel(label)
if not label or label == "" then return label end
if label:find("%[%[") then return label end
return "[[" .. label .. "]]"
end
local function appendIndentRun(rows, items, wrap)
local template = wrap and SUBROW_WRAP or SUBROW
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(template, trClass(class), item[1], item[2]))
end
end
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
function p.main(frame, args)
-- Allow being called as p.main(args) with no frame (used by tests).
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
local govRows = {}
local quaiylRows = {}
local foundingRows = {}
local govTypeRaw = getManual(args, {"sorçh_reiltys", "government_type"})
local govRef = getManual(args, {"imraa_reiltys"})
local govNote = getManual(args, {"noteyn_reiltys"})
local wdGovRef = nil
if not govTypeRaw then
local govTypeQids = getWdRawPropertyIds("P122")
local govTypeParts = {}
local govTypeCites = {}
for _, qid in ipairs(govTypeQids) do
local link = getWdItemManxLink(qid, false, false)
if link then
table.insert(govTypeParts, link)
table.insert(govTypeCites, getWdCitation("P122", qid))
end
end
wdGovRef = table.concat(govTypeCites)
if wdGovRef == "" then wdGovRef = nil end
if #govTypeParts > 0 then
govTypeRaw = capitalizeFirstLetter(table.concat(govTypeParts, ", "))
end
end
local govShown = govTypeRaw and not isNone(govTypeRaw)
local leaderPairs = {}
local manualLeaderGiven = false
for i = 1, 5 do
local title = getManual(args, {"enmys_toshiagh" .. i, "enmys" .. i .. "_fer-toshee"})
local name = getManual(args, {"ennym_toshiagh" .. i, "ennym" .. i .. "_fer-toshee"})
if title or name then
manualLeaderGiven = true
if not isNone(name) then
table.insert(leaderPairs, {title = title or "", name = name or ""})
end
end
end
local leaderRef = getManual(args, {"imraa_toshiagh", "imraa_fer-toshee"})
local leaderNote = getManual(args, {"noteyn_toshiagh", "noteyn_fer-toshee"})
local leadersSuppressed = isNone(getManual(args, {"fir_hoshee", "toshiaghyn"}))
local function resolvePersonName(qid)
if not qid then return nil end
return shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
end
local councillors = {}
for i = 1, 7 do
local name = getManual(args, {"ennym_coonseilagh" .. i})
if name and not isNone(name) then
table.insert(councillors, {slot = i, name = name})
end
end
local manualCouncillorsGiven = #councillors > 0
local swissBodyQid = getWdRawPropertyId("P35") or getWdRawPropertyId("P6")
local isSwissFederalCouncil = swissBodyQid == "Q30917"
if (manualCouncillorsGiven or isSwissFederalCouncil) and not leadersSuppressed then
manualLeaderGiven = true
local presidentAnnotation = ' ([[Eaghtyrane Chochiangle yn Elveeish|Eaghtyrane]])'
local vpAnnotation = ' ([[Lhiass-eaghtyrane yn Elveeish|Lhiass-eaghtyrane]])'
local nameLines = {}
local chancellor = nil
if manualCouncillorsGiven then
local presidentSlot = tonumber(getManual(args, {"eaghtyrane_coonseilagh"}))
local vicePresidentSlot = tonumber(getManual(args, {"lhiass-eaghtyrane_coonseilagh"}))
for _, entry in ipairs(councillors) do
local line = entry.name
if presidentSlot and entry.slot == presidentSlot then
line = line .. presidentAnnotation
elseif vicePresidentSlot and entry.slot == vicePresidentSlot then
line = line .. vpAnnotation
end
table.insert(nameLines, line)
end
chancellor = getManual(args, {"shansyleyr_conastagh"})
else
local presidentOverride = getManual(args, {"eaghtyrane_coonseilagh"})
local vpOverride = getManual(args, {"lhiass-eaghtyrane_coonseilagh"})
local chancellorOverride = getManual(args, {"shansyleyr_conastagh"})
local councillorQids = getWdRawForeignPropertyIds("Q30917", "P3320", {"best", "current"})
local presidentQid = not isNone(presidentOverride) and getWdRawForeignPropertyIds("Q688230", "P1308", {"best"})[1] or nil
local vpQid = not isNone(vpOverride) and getWdRawForeignPropertyIds("Q25550811", "P1308", {"best"})[1] or nil
for _, qid in ipairs(councillorQids) do
local name = resolvePersonName(qid)
if name then
name = name .. getWdCitation("P3320", qid, "Q30917")
if qid == presidentQid then
name = name .. presidentAnnotation .. getWdCitation("P1308", qid, "Q688230")
elseif qid == vpQid then
name = name .. vpAnnotation .. getWdCitation("P1308", qid, "Q25550811")
end
table.insert(nameLines, name)
end
end
if chancellorOverride and not isNone(chancellorOverride) then
chancellor = chancellorOverride
elseif not isNone(chancellorOverride) then
local chancellorQid = getWdRawForeignPropertyIds("Q687810", "P1308", {"best"})[1]
chancellor = resolvePersonName(chancellorQid)
if chancellor then chancellor = chancellor .. getWdCitation("P1308", chancellorQid, "Q687810") end
end
end
if #nameLines > 0 then
table.insert(leaderPairs, {
title = '[[Coonseil Chonastagh yn Elveeish|Coonseilee Chonastagh]]',
name = table.concat(nameLines, '<br/>'),
})
end
if chancellor and chancellor ~= "" then
table.insert(leaderPairs, {
title = '[[Shansyleyr yn Elveeish|Shansyleyr Conastagh]]',
name = chancellor,
})
end
end
local function isSanMarinoPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "San Marino"
end
local function isNorthernIrelandPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nerin Hwoaie"
end
local function isNicaraguaPage()
if getCurrentCountryQid() == "Q811" then return true end
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title == "Nickeraag"
end
-- US unincorporated territories
local US_QID = "Q30"
local usTerritoryTitles = {
["Yn Phurt Verçhagh"] = true, -- Puerto Rico
["Guam"] = true, -- Guam
["Ellanyn Americaanagh y Voidyn"] = true, -- US Virgin Islands
["Samoa Americaanagh"] = true, -- American Samoa
}
local function isUSTerritoryPage()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
return ok and title ~= nil and usTerritoryTitles[title] == true
end
local sanMarinoCaptains = {}
for i = 1, 2 do
local name = getManual(args, {"ennym_captan_reiree" .. i})
if name and not isNone(name) then
table.insert(sanMarinoCaptains, name)
end
end
local manualSanMarinoGiven = #sanMarinoCaptains > 0
if (manualSanMarinoGiven or isSanMarinoPage()) and not leadersSuppressed and not manualLeaderGiven then
manualLeaderGiven = true
local nameLines = {}
if manualSanMarinoGiven then
nameLines = sanMarinoCaptains
else
local captainQids = getWdRawPropertyIds("P35", {"best", "current"})
for _, qid in ipairs(captainQids) do
local name = resolvePersonName(qid)
if name then table.insert(nameLines, name .. getWdCitation("P35", qid)) end
end
end
if #nameLines > 0 then
local title = getManual(args, {"sorçh_kione_steat"}) or '[[Captanyn Reiree]]'
table.insert(leaderPairs, {
title = title,
name = table.concat(nameLines, '<br/>'),
})
end
end
if not manualLeaderGiven and not leadersSuppressed then
local hosQids = getWdRawPropertyIds("P35", {"best", "current"})
-- "current" matters here, not just "best"
local hogBase, hogCitation = getWdPropertyWithCitation("P6", {"linked", "current"})
local hog = ensureLinked(hogBase)
if hog and hogCitation then hog = hog .. hogCitation end
local hogQid = getWdRawPropertyId("P6", {"current"})
-- No P6 on the item: take the holder (P1308) of the office item named by
-- P1313, or of a known office for countries that lack both.
local hogFallbackTitle = nil
local HOG_OFFICE_FALLBACK = {
Q9648 = { office = "Q3064699", manx = "[[Ard-heckter ny Malveenaghyn|Ard-heckter]]" }, -- Falkland Islands
}
local known = HOG_OFFICE_FALLBACK[getCurrentCountryQid() or ""]
if not hog and not isNone(getManual(args, {"sorçh_kione_reiltys"})) then
local officeQid = getWdRawPropertyId("P1313") or (known and known.office)
if officeQid then
local holderQid = getWdRawForeignPropertyIds(officeQid, "P1308", {"best", "current"})[1]
local holderName = holderQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(holderQid, false, nil, true))) or nil
if holderName then
hog, hogQid = holderName .. getWdCitation("P1308", holderQid, officeQid), holderQid
hogFallbackTitle = getWdItemManxLink(officeQid) or (known and known.office == officeQid and known.manx) or nil
end
end
end
-- A listed country's own office title always wins over Wikidata's generic one.
if known and hog then hogFallbackTitle = known.manx end
if isNicaraguaPage() then
-- Nicaragua is a diarchy
local presidentQids = getWdRawForeignPropertyIds("Q852448", "P1308", {"best", "current"})
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local sameHeadOfStateAndGovernment = false
local presidentNames = {}
for _, qid in ipairs(presidentQids) do
local name = ensureLinked(getWdItemManxLink(qid, false, nil, true))
if name then
name = name .. getWdCitation("P1308", qid, "Q852448")
table.insert(leaderPairs, {title = presidentTitle, name = name})
end
if name then table.insert(presidentNames, name) end
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
if #presidentNames > 0 then
table.insert(leaderPairs, {
title = presidentTitle,
name = table.concat(presidentNames, '<br/>'),
})
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313")
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
elseif #hosQids > 1 then
local sameHeadOfStateAndGovernment = false
if hog and hogQid then
for _, qid in ipairs(hosQids) do
if qid == hogQid then sameHeadOfStateAndGovernment = true end
end
end
local officeQids = getWdRawPropertyIds("P1906")
local pairsBuilt = 0
if #officeQids > 1 then
for _, officeQid in ipairs(officeQids) do
local personQid = getWdQualifierRawIdForValue("P1906", officeQid, "P1308")
local name = personQid and shortenLinkedCountryName(ensureLinked(getWdItemManxLink(personQid, false, nil, true))) or nil
if name then
name = name .. getWdCitation("P1906", officeQid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink(officeQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
pairsBuilt = pairsBuilt + 1
end
end
end
if pairsBuilt == 0 then
for _, qid in ipairs(hosQids) do
local name = shortenLinkedCountryName(ensureLinked(getWdItemManxLink(qid, false, nil, true)))
if name then
name = name .. getWdCitation("P35", qid)
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or getWdPositionTitleForPerson(qid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = name})
end
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or getWdOfficeItemTitle("P1313") -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
end
else
local hosBase, hosCitation = getWdPropertyWithCitation("P35", {"linked", "current"})
local hos = shortenLinkedCountryName(ensureLinked(hosBase))
if hos and hosCitation then hos = hos .. hosCitation end
local hosQid = getWdRawPropertyId("P35", {"current"})
-- Some countries (e.g. Benin since 2016) have literally merged the head-of-state and
local hosOfficeQid = getWdRawPropertyId("P1906")
local hogOfficeQid = getWdRawPropertyId("P1313")
-- Iran only: its head-of-state offices are the Supreme Leader and the President, but
-- Wikidata ranks the President (also the government's office) as preferred, so the
-- module only ever sees that one. Use the Supreme Leader's office (Q332486) directly.
if getCurrentCountryQid() == "Q794" and hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid then
hosOfficeQid = "Q332486"
end
local sameOffice = hosOfficeQid and hogOfficeQid and hosOfficeQid == hogOfficeQid
local sameHeadOfStateAndGovernment = sameOffice
or (hos and hog and hosQid and hogQid and hosQid == hogQid)
if hos then
local hosTitle = getManual(args, {"sorçh_kione_steat"})
or (hosOfficeQid and getWdItemManxLink(hosOfficeQid)) -- office held by head of state
or getWdPositionTitle("P35")
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = hosTitle, name = hos})
if not isNone(getManual(args, {"ynnydee_kione_steat"})) then
local proxyOfficeQid = getWdQualifierRawId("P35", "P1393")
if proxyOfficeQid then
local proxyPersonIds = getWdRawForeignPropertyIds(proxyOfficeQid, "P1308", {"best"})
local proxyPersonQid = proxyPersonIds[1]
local proxyName = proxyPersonQid and ensureLinked(getWdItemManxLink(proxyPersonQid, false, nil, true)) or nil
if proxyName then
proxyName = proxyName .. getWdCitation("P1308", proxyPersonQid, proxyOfficeQid)
local proxyTitle = getManual(args, {"sorçh_ynnydee"})
or getWdItemManxLink(proxyOfficeQid)
or "Ynnydee"
table.insert(leaderPairs, {title = proxyTitle, name = proxyName})
end
end
end
elseif isUSTerritoryPage() then
-- No P35 at all on the territory's own item
local presidentQid = getWdRawForeignPropertyIds(US_QID, "P35", {"best", "current"})[1]
local presidentName = resolvePersonName(presidentQid)
if presidentName then
presidentName = presidentName .. getWdCitation("P35", presidentQid, US_QID)
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdForeignOfficeItemTitle(US_QID, "P1906")
or getWdPositionTitleForPerson(presidentQid)
or getWikidataPropertyLabel("P35")
or "Kione steat"
table.insert(leaderPairs, {title = presidentTitle, name = presidentName})
end
end
if hog and not sameHeadOfStateAndGovernment then
local hogTitle = getManual(args, {"sorçh_kione_reiltys"})
or hogFallbackTitle
or (hogOfficeQid and getWdItemManxLink(hogOfficeQid)) -- office held by head of government
or getWdPositionTitle("P6")
or getWikidataPropertyLabel("P6")
or "Kione reiltys"
table.insert(leaderPairs, {title = hogTitle, name = hog})
if isNorthernIrelandPage() then
local dfmPersonQid = getWdRawForeignPropertyIds("Q11954685", "P1308", {"best"})[1]
local dfmName = dfmPersonQid and ensureLinked(getWdItemManxLink(dfmPersonQid, false, nil, true)) or nil
local dfmTitle = getWdItemManxLink("Q11954685")
if dfmName and dfmTitle then
dfmName = dfmName .. getWdCitation("P1308", dfmPersonQid, "Q11954685")
table.insert(leaderPairs, {title = dfmTitle, name = dfmName})
end
end
end
end
end
local reiltysLabel = getGenitiveLinkedLabel("Reiltys")
if govShown then
local govClass = (#leaderPairs > 0) and "mergedtoprow" or ""
table.insert(govRows, string.format(ROW, trClass(govClass), reiltysLabel, applyRefNote(govTypeRaw, govRef or wdGovRef, govNote, frame)))
elseif #leaderPairs > 0 then
table.insert(govRows, string.format(HEADER, reiltysLabel))
end
if isNicaraguaPage() and #leaderPairs > 1 then
local presidentTitle = getManual(args, {"sorçh_kione_steat"})
or getWdItemManxLink("Q852448")
or getWikidataPropertyLabel("P35")
or "Kione steat"
local combinedNames, seenNames = {}, {}
local firstPresidentIndex = nil
local filteredLeaderPairs = {}
for _, leader in ipairs(leaderPairs) do
if leader.title == presidentTitle then
if not firstPresidentIndex then firstPresidentIndex = #filteredLeaderPairs + 1 end
local remaining = leader.name or ""
while true do
local name, rest = remaining:match("^(.-)<br%s*/>(.*)$")
if not name then name = remaining end
name = mw.text.trim(name)
local nameKey = mw.ustring.gsub(name, "\127[^\127]*\127", "")
if name ~= "" and not seenNames[nameKey] then
seenNames[nameKey] = true
table.insert(combinedNames, name)
end
if not rest then break end
remaining = rest
end
else
table.insert(filteredLeaderPairs, leader)
end
end
if firstPresidentIndex and #combinedNames > 0 then
table.insert(filteredLeaderPairs, firstPresidentIndex, {
title = presidentTitle,
name = table.concat(combinedNames, "<br/>"),
})
leaderPairs = filteredLeaderPairs
end
end
if #leaderPairs > 0 then
local last = leaderPairs[#leaderPairs]
last.name = applyRefNote(last.name, leaderRef, leaderNote, frame)
local items = {}
for _, leader in ipairs(leaderPairs) do
table.insert(items, {leader.title, leader.name})
end
appendIndentRun(govRows, items)
end
local quaiyl = getManual(args, {"çhionnal", "quaiyl"})
local quaiylSyrjey = getManual(args, {"thie_heose", "quaiyl_syrjey"})
local quaiylInshley = getManual(args, {"thie_heese", "quaiyl_s'inshley", "quaiyl_sinshley"})
local quaiylRef = getManual(args, {"imraa_çhionnal", "imraa_quaiyl"})
local quaiylNote = getManual(args, {"noteyn_çhionnal", "noteyn_quaiyl"})
local quaiylQid = nil
local wdQuaiylRef = nil
if not quaiyl then
quaiylQid = getWdRawPropertyId("P194")
if quaiylQid then
quaiyl = getWdItemManxLink(quaiylQid, false, nil, nil, true)
if quaiyl then wdQuaiylRef = getWdCitation("P194", quaiylQid) end
if wdQuaiylRef == "" then wdQuaiylRef = nil end
end
end
if not quaiylSyrjey or not quaiylInshley then
local legislatureQid = quaiylQid or getWdRawPropertyId("P194")
if legislatureQid then
local wdUpper, wdLower = getWdChambers(legislatureQid)
if not quaiylSyrjey then quaiylSyrjey = wdUpper end
if not quaiylInshley then quaiylInshley = wdLower end
end
end
if quaiyl and not isNone(quaiyl) then
local houseItems = {}
if quaiylSyrjey and not isNone(quaiylSyrjey) then
table.insert(houseItems, {"[[Thie heose]]", quaiylSyrjey})
end
if quaiylInshley and not isNone(quaiylInshley) then
table.insert(houseItems, {"[[Thie heese]]", quaiylInshley})
end
local quaiylClass = (#houseItems > 0) and "mergedtoprow" or ""
table.insert(quaiylRows, string.format(ROW, trClass(quaiylClass), "[[Çhionnal slattyssagh]]", applyRefNote(quaiyl, quaiylRef or wdQuaiylRef, quaiylNote, frame)))
appendIndentRun(quaiylRows, houseItems)
end
local foundingLabel = getManual(args, {"sorçh_kionedeeaght", "sorçh_kiondeeaght"}) or "Bunneeaght"
local foundingValue = getManual(args, {"bunnit"})
local foundingQualifier = getManual(args, {"note_kionedeeaght", "note_kiondeeaght"})
local foundingFootnote = getManual(args, {"noteyn_kionedeeaght", "noteyn_kiondeeaght"})
local foundingRef = getManual(args, {"imraa_kionedeeaght", "imraa_kiondeeaght"})
local function foundingLabelWithQualifier(label)
local linked = wikilinkLabel(label)
if foundingQualifier and foundingQualifier ~= "" then
return linked .. ' <span style="font-weight:normal;">' .. foundingQualifier .. '</span>'
end
return linked
end
local establishmentRows = {}
for i = 1, 30 do
local event = getManual(args, {"taghyrt_bunneeaght" .. i, "taghyrt" .. i .. "_bunnit"})
local date = getManual(args, {"date_bunneeaght" .. i, "date" .. i .. "_bunnit"})
if event then
table.insert(establishmentRows, {event, date or ""})
end
end
if foundingValue or #establishmentRows > 0 then
if foundingValue and not isNone(foundingValue) then
local foundingClass = (#establishmentRows > 0) and "mergedtoprow" or ""
table.insert(foundingRows, string.format(ROW, trClass(foundingClass), foundingLabelWithQualifier(foundingLabel), applyRefNote(foundingValue, foundingRef, foundingFootnote, frame)))
elseif #establishmentRows > 0 then
local headerLabel = applyRefNote(foundingLabelWithQualifier(foundingLabel), foundingRef, foundingFootnote, frame)
table.insert(foundingRows, string.format(HEADER, headerLabel))
end
appendIndentRun(foundingRows, establishmentRows, true)
elseif not isNone(getManual(args, {"bunnit"})) then
-- Wikidata fallback: inception (P571), only when unset (not none).
local inception = getWdProperty("P571")
if inception and inception:find(" (Joolagh)", 1, true) then
inception = inception:gsub(" %(Joolagh%)", " (" .. getJulianCalendarSuffixLink() .. ")", 1)
end
if inception then
table.insert(foundingRows, string.format(ROW, "", foundingLabelWithQualifier(foundingLabel), applyRefNote(inception, foundingRef, foundingFootnote, frame)))
end
end
local aarheynnRows = {}
if aarheynnOK and Aarheynn and Aarheynn.main then
local okAarheynn, resultAarheynn = pcall(Aarheynn.main, frame, args)
if okAarheynn and resultAarheynn then aarheynnRows = resultAarheynn end
end
appendSection(rows, govRows)
appendSection(rows, quaiylRows)
appendSection(rows, aarheynnRows)
appendSection(rows, foundingRows)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
m77xpbhx4id9ggehca3cam39o0d137r
Module:Kishtey fys çheer/craueeaght
828
55872
394737
394653
2026-10-18T15:15:07Z
MacTire02
219
++
394737
Scribunto
text/plain
local p = {}
-- Shared "Manx label, else linked Wikidata fallback" helper, for a religion
-- item with no gv label at all.
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Wraps a manual citation in <ref>...</ref>, unless it's already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Capitalizes via the content language's ucfirst (UTF-8/digraph-safe --
-- plain Lua string.upper mangles multi-byte characters).
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
-- Capitalizes the first VISIBLE letter, even through a leading wikilink or an ennym-wd external-link
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos -- piped: capitalize the display half only
else
splitPos = 2 -- unpiped: capitalize just past the leading "[["
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
-- ennym-wd external link: "[url label] <sup>(lang)</sup>" --
-- capitalize the label, right after the URL's own space.
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
-- Splits a value on "<br/>"
local function capitalizeEachEntry(text)
if not text or text == "" then return text end
local pieces = {}
local lastEnd = 1
local searchStart = 1
while true do
local s, e = text:find("<%s*[Bb][Rr]%s*/?%s*>", searchStart)
if not s then
table.insert(pieces, text:sub(lastEnd))
break
end
table.insert(pieces, text:sub(lastEnd, s - 1))
lastEnd = e + 1
searchStart = e + 1
end
local capitalized = {}
for _, piece in ipairs(pieces) do
local trimmed = mw.text.trim(piece)
if trimmed ~= "" then
table.insert(capitalized, capitalizeFirstLetter(trimmed))
else
table.insert(capitalized, piece)
end
end
return table.concat(capitalized, "<br/>")
end
local ROW = '<tr><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Resolves a religion item to a link: gv sitelink, else gv label (as a
-- redlink), else an ennym-wd external link to Wikidata.
local function getWdItemLink(qid)
if not qid then return nil end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if not (okLabel and gvLabel and gvLabel ~= "") then gvLabel = nil end
if not sitelinkTitle and not gvLabel then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
local target = sitelinkTitle or gvLabel
local display = gvLabel or sitelinkTitle
if target == display then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. display .. "]]"
end
-- e.g. 0.547 -> "54.7%"; drops a trailing ".0".
local function formatProportion(fraction)
local formatted = string.format("%.1f", fraction * 100)
return formatted:gsub("%.0$", "") .. "%"
end
-- Wikidata references for a claim value (empty if none); value = raw item id or raw quantity amount.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
-- Wikidata fallback
local function getWdReligions()
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements("P140")
if not statements or #statements == 0 then return nil end
local items = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid" then
local idValue = mainsnak.datavalue.value
local qid = idValue.id or ("Q" .. tostring(idValue["numeric-id"]))
local link = getWdItemLink(qid)
if link then link = capitalizeFirstLetter(link) end
if link then
local pct = nil
local quals = statement.qualifiers and statement.qualifiers.P1107
local qualSnak = quals and quals[1]
if qualSnak and qualSnak.datavalue and qualSnak.datavalue.value then
pct = tonumber(qualSnak.datavalue.value.amount)
end
table.insert(items, { link = link, pct = pct, qid = qid })
end
end
end
if #items == 0 then return nil end
local allHavePct = true
for _, item in ipairs(items) do
if not item.pct then allHavePct = false break end
end
if allHavePct then
table.sort(items, function(a, b) return a.pct > b.pct end)
end
local parts = {}
for _, item in ipairs(items) do
local cite = getWdCitation("P140", item.qid) or ""
if item.pct then
table.insert(parts, formatProportion(item.pct) .. " " .. item.link .. cite)
else
table.insert(parts, item.link .. cite)
end
end
return table.concat(parts, "<br/>")
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local value = getManual(args, {"craueeaght"})
if value then
-- manual value is output exactly as entered
else
value = getWdReligions()
end
if not value or isNone(value) then return nil end
local year = getManual(args, {"blein_craueeaght"})
local ref = getManual(args, {"imraa_craueeaght"})
local note = getManual(args, {"noteyn_craueeaght"})
local label = "[[Craueeaght]]"
if year then
label = label .. " <span style='font-weight:normal;'>(" .. year .. ")</span>"
end
label = applyRefNote(label, ref, note, frame)
return string.format(ROW, label, value)
end
return p
9mio0bilkjilwrpdou71o1sfdyfxlcc
Module:Kishtey fys çheer/possanyn kynneeagh
828
55873
394735
394650
2026-10-18T15:14:23Z
MacTire02
219
++
394735
Scribunto
text/plain
local p = {}
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Same plain 2-cell row grid as every other submodule (see Module:Kishtey
-- fys çheer/reiltys's own ROW comment for the full rationale).
local ROW = '<tr><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Drops a trailing " 'sy <...>"/" 'syn <...>" locative qualifier ("in the <country>") from a
local function shortenDiasporaName(display)
if not display or display == "" then return display end
local short = display:match("^(.-)%s'syn%s.+$") or display:match("^(.-)%s'sy%s.+$")
if short and short ~= "" then return short end
return display
end
-- Resolves an ethnic-group item to a link: gv sitelink, else gv label (as a
-- redlink), else an ennym-wd external link to Wikidata.
local function getWdItemLink(qid)
if not qid then return nil end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if not (okLabel and gvLabel and gvLabel ~= "") then gvLabel = nil end
if not sitelinkTitle and not gvLabel then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
local target = sitelinkTitle or gvLabel
local display = shortenDiasporaName(gvLabel or sitelinkTitle)
if target == display then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. display .. "]]"
end
-- e.g. 0.947 -> "94.7%"; drops a trailing ".0".
local function formatProportion(fraction)
local formatted = string.format("%.1f", fraction * 100)
return formatted:gsub("%.0$", "") .. "%"
end
-- Wikidata references for a claim value (empty if none); value = raw item id or raw quantity amount.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
-- Wikidata fallback
local function getWdEthnicGroups()
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements("P172")
if not statements or #statements == 0 then return nil end
local items = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid" then
local idValue = mainsnak.datavalue.value
local qid = idValue.id or ("Q" .. tostring(idValue["numeric-id"]))
local link = getWdItemLink(qid)
if link then
local pct = nil
local quals = statement.qualifiers and statement.qualifiers.P1107
local qualSnak = quals and quals[1]
if qualSnak and qualSnak.datavalue and qualSnak.datavalue.value then
pct = tonumber(qualSnak.datavalue.value.amount)
end
table.insert(items, { link = link, pct = pct, qid = qid })
end
end
end
if #items == 0 then return nil end
local allHavePct = true
for _, item in ipairs(items) do
if not item.pct then allHavePct = false break end
end
if allHavePct then
table.sort(items, function(a, b) return a.pct > b.pct end)
end
local parts = {}
for _, item in ipairs(items) do
local cite = getWdCitation("P172", item.qid) or ""
if item.pct then
table.insert(parts, formatProportion(item.pct) .. " " .. item.link .. cite)
else
table.insert(parts, item.link .. cite)
end
end
return table.concat(parts, "<br/>")
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local value = getManual(args, {"possanyn_kynneeagh"})
if not value then
value = getWdEthnicGroups()
end
if not value or isNone(value) then return nil end
local year = getManual(args, {"blein_possanyn_kynneeagh"})
local ref = getManual(args, {"imraa_possanyn_kynneeagh"})
local note = getManual(args, {"noteyn_possanyn_kynneeagh"})
local label = "[[Possan kynneeagh|Possanyn kynneeagh]]"
if year then
label = label .. " <span style='font-weight:normal;'>(" .. year .. ")</span>"
end
label = applyRefNote(label, ref, note, frame)
return string.format(ROW, label, value)
end
return p
qpcx3dr8jm6rcv5qizni2yq5fcs0t6d
394759
394735
2026-10-19T00:58:42Z
MacTire02
219
++
394759
Scribunto
text/plain
local p = {}
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- Same plain 2-cell row grid as every other submodule (see Module:Kishtey
-- fys çheer/reiltys's own ROW comment for the full rationale).
local ROW = '<tr><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Drops a trailing " 'sy <...>"/" 'syn <...>" locative qualifier ("in the <country>") from a
local function shortenDiasporaName(display)
if not display or display == "" then return display end
local short = display:match("^(.-)%s'syn%s.+$") or display:match("^(.-)%s'sy%s.+$")
if short and short ~= "" then return short end
return display
end
-- Upper-cases the first letter of a display label ("pobbylyn Turkagh" -> "Pobbylyn Turkagh")
local function ucfirst(text)
if not text or text == "" then return text end
return mw.ustring.upper(mw.ustring.sub(text, 1, 1)) .. mw.ustring.sub(text, 2)
end
-- Resolves an ethnic-group item to a link: gv sitelink, else gv label (as a
-- redlink), else an ennym-wd external link to Wikidata.
local function getWdItemLink(qid)
if not qid then return nil end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if not (okLabel and gvLabel and gvLabel ~= "") then gvLabel = nil end
if not sitelinkTitle and not gvLabel then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
local target = sitelinkTitle or gvLabel
local display = ucfirst(shortenDiasporaName(gvLabel or sitelinkTitle))
if target == display then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. display .. "]]"
end
-- e.g. 0.947 -> "94.7%"; drops a trailing ".0".
local function formatProportion(fraction)
local formatted = string.format("%.1f", fraction * 100)
return formatted:gsub("%.0$", "") .. "%"
end
-- Wikidata references for a claim value (empty if none); value = raw item id or raw quantity amount.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
-- Wikidata fallback
local function getWdEthnicGroups()
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements("P172")
if not statements or #statements == 0 then return nil end
local items = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "wikibase-entityid" then
local idValue = mainsnak.datavalue.value
local qid = idValue.id or ("Q" .. tostring(idValue["numeric-id"]))
local link = getWdItemLink(qid)
if link then
local pct = nil
local quals = statement.qualifiers and statement.qualifiers.P1107
local qualSnak = quals and quals[1]
if qualSnak and qualSnak.datavalue and qualSnak.datavalue.value then
pct = tonumber(qualSnak.datavalue.value.amount)
end
table.insert(items, { link = link, pct = pct, qid = qid })
end
end
end
if #items == 0 then return nil end
local allHavePct = true
for _, item in ipairs(items) do
if not item.pct then allHavePct = false break end
end
if allHavePct then
table.sort(items, function(a, b) return a.pct > b.pct end)
end
-- One block per entry with a hanging indent, so a wrapped line can't be mistaken for a new entry
local ENTRY = '<div style="padding-left:1em; text-indent:-1em;">%s</div>'
local parts = {}
for _, item in ipairs(items) do
local cite = getWdCitation("P172", item.qid) or ""
local entry
if item.pct then
entry = formatProportion(item.pct) .. " " .. item.link .. cite
else
entry = item.link .. cite
end
table.insert(parts, string.format(ENTRY, entry))
end
return table.concat(parts)
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local value = getManual(args, {"possanyn_kynneeagh"})
if not value then
value = getWdEthnicGroups()
end
if not value or isNone(value) then return nil end
local year = getManual(args, {"blein_possanyn_kynneeagh"})
local ref = getManual(args, {"imraa_possanyn_kynneeagh"})
local note = getManual(args, {"noteyn_possanyn_kynneeagh"})
local label = "[[Possan kynneeagh|Possanyn kynneeagh]]"
if year then
label = label .. " <span style='font-weight:normal;'>(" .. year .. ")</span>"
end
label = applyRefNote(label, ref, note, frame)
return string.format(ROW, label, value)
end
return p
bsahc2uhcflzd600wr65xr8ewnr7q5e
Module:Kishtey fys çheer/eaghtyr
828
55874
394736
394654
2026-10-18T15:14:46Z
MacTire02
219
++
394736
Scribunto
text/plain
local p = {}
local KM2_PER_MI2 = 2.589988110336
-- Recognized Wikidata area units (P2046), mapped to their km² factor
local AREA_UNIT_FACTORS = {
Q712226 = 1,
Q232291 = KM2_PER_MI2,
}
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Wraps a manual citation in <ref>...</ref>, unless already fully <ref>-tagged
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Strips trailing literal spaces and/or " "
local function stripTrailingSpace(value)
local changed = true
while changed do
local stripped = value:gsub("%s+$", ""):gsub(" $", "")
changed = (stripped ~= value)
value = stripped
end
return value
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
local hasNote = note and note ~= "" and frame
local hasRef = ref and ref ~= ""
if hasNote or hasRef then
value = stripTrailingSpace(value)
end
if hasNote then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if hasRef then
value = value .. wrapReference(ref)
end
return value
end
-- Same row grid as Module:Kishtey fys çheer/reiltys (header + bulleted indented sub-rows), since
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local HEADER = '<tr class="mergedtoprow"><th colspan="2" style="text-align:left; padding-left:0.4em; padding-right:0.4em;">%s</th></tr>'
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function appendIndentRun(rows, items)
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(SUBROW, trClass(class), item[1], item[2]))
end
end
-- e.g. 1234567.5 -> "1,234,567.5"
local function formatNumber(n)
local isNeg = n < 0
n = math.abs(n)
local formatted = string.format("%.2f", n):gsub("%.?0+$", "")
local intPart, decPart = formatted:match("^(%d+)%.?(%d*)$")
local grouped = intPart:reverse():gsub("(%d%d%d)", "%1,"):reverse():gsub("^,", "")
local result = (decPart and decPart ~= "") and (grouped .. "." .. decPart) or grouped
return isNeg and ("-" .. result) or result
end
-- Wikidata references for a claim value (empty if none); value = raw item id or raw quantity amount.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
-- Wikidata fallback
local function getWdAreaKm2()
local entity = mw.wikibase.getEntityObject()
if not entity then return nil end
local statements = entity:getBestStatements("P2046")
if not statements or #statements == 0 then return nil end
local best, bestRaw = nil, nil
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
and mainsnak.datavalue.type == "quantity" then
local value = mainsnak.datavalue.value
local amount = tonumber(value.amount)
local unitQid = amount and value.unit and value.unit:match("Q%d+$")
local factor = unitQid and AREA_UNIT_FACTORS[unitQid]
if factor then
local km2 = amount * factor
if not best or km2 > best then best = km2; bestRaw = (value.amount:gsub("^%+", "")) end
end
end
end
return best, bestRaw
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local headerLabel = getManual(args, {"sorçh_eaghtyr"}) or "Eaghtyr"
local ref = getManual(args, {"imraa_eaghtyr"})
local note = getManual(args, {"noteyn_eaghtyr"})
-- ---------------------------------------------------------------- Total area ("Yn clane")
local km2Manual = getManual(args, {"eaghtyr_km2"})
local km2Str, km2Number, wdAreaRef
if km2Manual then
if not isNone(km2Manual) then
km2Str = km2Manual
km2Number = tonumber((km2Manual:gsub(",", "")))
end
else
local rawAmount
km2Number, rawAmount = getWdAreaKm2()
if km2Number then
km2Str = formatNumber(km2Number)
wdAreaRef = getWdCitation("P2046", rawAmount)
end
end
local totalItem = nil
if km2Str then
local label = getManual(args, {"eaghtyr_lipaid"}) or "Yn clane"
local foScreeuyn = getManual(args, {"eaghtyr_fo-screeuyn"}) or ""
local rhenk = getManual(args, {"eaghtyr_rhenk"})
local miKerManual = getManual(args, {"eaghtyr_mi_ker"})
local miKerStr = miKerManual
if not miKerStr and km2Number then
miKerStr = formatNumber(math.floor(km2Number / KM2_PER_MI2 + 0.5))
end
local value = km2Str .. " [[km²|km<sup>2</sup>]] " .. foScreeuyn
if rhenk then
value = value .. "([[Rolley çheeraghyn as thallooyn foddey ersooyl rere eaghtyr|" .. rhenk .. "]]) "
end
if miKerStr then
value = value .. "<br/>" .. miKerStr .. " [[Meeiley cherrinagh|mi ker]] "
end
value = applyRefNote(value, ref or wdAreaRef, note, frame)
totalItem = {label, value}
end
-- ---------------------------------------------------------------- Water (%)
local waterItem = nil
local water = getManual(args, {"ushtey_sy_cheead"})
if water and not isNone(water) then
waterItem = {"[[Ushtey]] ([['Sy cheead|%]])", water}
end
-- ---------------------------------------------------------------- Custom second stat row
local customItem = nil
local customLabel = getManual(args, {"eaghtyr_lipaid2"})
if customLabel then
local customValue = getManual(args, {"eaghtyr_fysseree2"}) or ""
customItem = {customLabel, customValue}
end
if not totalItem and not waterItem and not customItem then return nil end
local rows = {}
if totalItem then
table.insert(rows, string.format(HEADER, headerLabel))
else
-- No total row (e.g. |eaghtyr_km2=none with only water%/custom set):
-- attach the section's own citation to the header instead.
table.insert(rows, string.format(HEADER, applyRefNote(headerLabel, ref, note, frame)))
end
local items = {}
if totalItem then table.insert(items, totalItem) end
if waterItem then table.insert(items, waterItem) end
if customItem then table.insert(items, customItem) end
appendIndentRun(rows, items)
return table.concat(rows)
end
return p
asa9qb00idz50w23hy56bnotd3jgjaw
Module:Kishtey fys çheer/tarmaynys
828
55890
394733
394651
2026-10-18T15:13:36Z
MacTire02
219
++
394733
Scribunto
text/plain
local p = {}
-- Wikidata properties, verified individually before use (never guessed)
local GDP_NOMINAL_TOTAL = "P2131"
local GDP_NOMINAL_PERCAPITA = "P2132"
local GDP_PPP_TOTAL = "P4010"
local GDP_PPP_PERCAPITA = "P2299"
local GINI_PROPERTY = "P1125"
local HDI_PROPERTY = "P1081"
local CURRENCY_PROPERTY = "P38"
local ISO_CODE_PROPERTY = "P498"
local UNIT_SYMBOL_PROPERTY = "P5061" -- confirmed against Module:WikidataIB's own usage
-- P1082 population
local POPULATION_PROPERTY = "P1082"
local wdOK, Wd = pcall(require, "Module:Wd")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Capitalizes via the content language's own ucfirst (UTF-8/digraph-safe),
-- not a plain Lua upper() on byte 1. Duplicated from reiltys.lua.
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
-- Capitalizes the first letter a reader actually sees, even through a leading wikilink or
local function capitalizeFirstLetter(text)
if not text or text == "" then return text end
if text:match("^%[%[") then
local closePos = text:find("]]", 3, true)
local pipePos = text:find("|", 1, true)
local splitPos
if pipePos and (not closePos or pipePos < closePos) then
splitPos = pipePos
else
splitPos = 2
end
return text:sub(1, splitPos) .. wikiUcfirst(text:sub(splitPos + 1))
elseif text:match("^%[https?://") then
local spacePos = text:find(" ", 2, true)
if spacePos then
return text:sub(1, spacePos) .. wikiUcfirst(text:sub(spacePos + 1))
end
return text
end
return wikiUcfirst(text)
end
-- Strips trailing literal spaces and/or " "
local function stripTrailingSpace(value)
local changed = true
while changed do
local stripped = value:gsub("%s+$", ""):gsub(" $", "")
changed = (stripped ~= value)
value = stripped
end
return value
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
local hasNote = note and note ~= "" and frame
local hasRef = ref and ref ~= ""
if hasNote or hasRef then
value = stripTrailingSpace(value)
end
if hasNote then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if hasRef then
value = value .. wrapReference(ref)
end
return value
end
-- Same row grid as reiltys/pobble: ROW is a plain label+value row, SUBROW a
-- bulleted sub-item beneath a shared block.
local ROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local SUBROW = '<tr%s><th style="vertical-align:top; white-space:nowrap; text-align:left; font-weight:normal; padding-left:0.9em; padding-right:0.4em;">• %s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
local function trClass(name)
if name and name ~= "" then return ' class="' .. name .. '"' end
return ""
end
local function appendIndentRun(rows, items)
for idx, item in ipairs(items) do
local class = (idx == #items) and "mergedbottomrow" or "mergedrow"
table.insert(rows, string.format(SUBROW, trClass(class), item[1], item[2]))
end
end
-- Divider between this module's own internal blocks (CCC / LTS / Gini / ALD / Argid)
local dividerLine = '<tr><td colspan="2" style="border-top:1px solid #a2a9b1; padding:0; height:0px;"></td></tr>'
local function appendSection(rows, sectionRows)
if sectionRows and #sectionRows > 0 then
if #rows > 0 then table.insert(rows, dividerLine) end
for _, row in ipairs(sectionRows) do
table.insert(rows, row)
end
end
end
local function formatNumber(n, decimals)
decimals = decimals or 2
local isNeg = n < 0
n = math.abs(n)
local formatted = string.format("%." .. decimals .. "f", n)
if formatted:find("%.") then
formatted = formatted:gsub("0+$", ""):gsub("%.$", "")
end
local intPart, decPart = formatted:match("^(%d+)%.?(%d*)$")
local grouped = intPart:reverse():gsub("(%d%d%d)", "%1,"):reverse():gsub("^,", "")
local result = (decPart and decPart ~= "") and (grouped .. "." .. decPart) or grouped
return isNeg and ("-" .. result) or result
end
-- Large-number Manx words, as given directly by you
local SCALE_WORDS = {
{1e12, "trillioon"},
{1e9, "billoon"},
{1e6, "millioon"},
{1e3, "thousane"},
}
local function abbreviateNumber(n)
for _, scale in ipairs(SCALE_WORDS) do
local threshold, word = scale[1], scale[2]
if math.abs(n) >= threshold then
return formatNumber(n / threshold, 3) .. " " .. word
end
end
return formatNumber(n, 0)
end
-- Splits a manual numeric value into {number, tail}
local function splitManualNumber(text)
local stripped = text:gsub(",", "")
local numStr, tail = stripped:match("^(%-?%d+%.?%d*)(.*)$")
if not numStr then return nil, nil end
tail = mw.text.trim(tail)
return tonumber(numStr), tail ~= "" and tail or nil
end
-- Applies to a GDP field's own number, whether manual or Wikidata-sourced
local function formatGdpDisplay(field, abbreviate)
if not field.number then return field.str end
local numStr = abbreviate and abbreviateNumber(field.number) or formatNumber(field.number, 0)
if field.tail then return numStr .. field.tail end
return numStr
end
-- Matches the wiki's own {{Increase}}/{{Decrease}}/{{Steady}} styling exactly
local function trendArrow(direction)
if direction == "up" then
return "[[Coadan:Increase2.svg|11px|alt=Ardjaghey|link=|Ardjaghey]]"
elseif direction == "down" then
return "[[Coadan:Decrease2.svg|11px|alt=Leodaghey|link=|Leodaghey]]"
elseif direction == "steady" then
return '<span title="Corrym" style="color:#0AF; font-size: larger;">▬</span>'
end
return ""
end
-- A manual value can carry its OWN leading trend icon, typed by the editor as
local LEADING_TREND_PATTERNS = {
"^%[%[Coadan:Increase2%.svg.-%]%]",
"^%[%[Coadan:Decrease2%.svg.-%]%]",
"^%[%[File:Increase2%.svg.-%]%]",
"^%[%[File:Decrease2%.svg.-%]%]",
"^<span[^>]*>▬</span>",
}
local function splitLeadingTrendMarker(text)
if not text or text == "" then return nil, text end
for _, pattern in ipairs(LEADING_TREND_PATTERNS) do
local s, e = text:find(pattern)
if s then return text:sub(s, e), text:sub(e + 1) end
end
for _, marker in ipairs({"▲", "▼", "▬", "—"}) do
if text:sub(1, #marker) == marker then return marker, text:sub(#marker + 1) end
end
return nil, text
end
-- Strips whatever separator (plain spaces and/or a literal " ") an editor already put between
local function stripLeadingSeparator(text)
if not text then return text end
while true do
local stripped = text:gsub("^%s+", ""):gsub("^ ", "")
if stripped == text then return stripped end
text = stripped
end
end
-- Glues a trend icon to the number it belongs to, with a visible space between them, so a line-wrap
local function glueTrend(trend, text)
if trend then
return '<span style="white-space:nowrap;">' .. trendArrow(trend) .. " " .. text .. '</span>'
end
local marker, rest = splitLeadingTrendMarker(text)
if marker then
return '<span style="white-space:nowrap;">' .. marker .. " " .. stripLeadingSeparator(rest) .. '</span>'
end
return text
end
-- All non-deprecated statements of a quantity property, reduced to
-- {amount, rawAmount, year}, sorted ascending by year.
local function getWdQuantityStatements(property)
local entity = mw.wikibase.getEntityObject()
if not entity then return {} end
local statements = entity:getAllStatements(property)
if not statements then return {} end
local results = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if statement.rank ~= "deprecated" and mainsnak and mainsnak.snaktype == "value"
and mainsnak.datavalue and mainsnak.datavalue.type == "quantity" then
local rawAmount = mainsnak.datavalue.value.amount
local amount = tonumber(rawAmount)
local timeQuals = statement.qualifiers and statement.qualifiers.P585
local timeSnak = timeQuals and timeQuals[1]
local timeValue = timeSnak and timeSnak.datavalue and timeSnak.datavalue.value
local year = timeValue and timeValue.time and tonumber(timeValue.time:match("(%-?%d+)%-"))
-- The statement's OWN currency/unit (e.g. a specific country's dollar, not necessarily USD)
local unitQid = mainsnak.datavalue.value.unit and mainsnak.datavalue.value.unit:match("Q%d+$")
if amount then
table.insert(results, {
amount = amount,
rawAmount = rawAmount and rawAmount:gsub("^%+", ""),
year = year,
unitQid = unitQid,
})
end
end
end
table.sort(results, function(a, b) return (a.year or 0) < (b.year or 0) end)
return results
end
-- Compares `number` against whichever fetched statement is the closest one strictly before `year`
local function trendAgainstWikidata(number, year, allEntries)
if not number or not allEntries or #allEntries == 0 then return nil end
local prev = nil
for _, entry in ipairs(allEntries) do
if year then
if entry.year and entry.year < year and (not prev or entry.year > prev.year) then prev = entry end
elseif not prev or (entry.year or 0) > (prev.year or 0) then
prev = entry
end
end
if not prev then return nil end
if number > prev.amount then return "up" end
if number < prev.amount then return "down" end
return "steady"
end
local function getWdReferenceForValue(property, rawAmount)
if not wdOK or not Wd or not Wd._reference or not rawAmount then return nil end
local ok, result = pcall(Wd._reference, {"best", property, rawAmount})
if ok and result and result ~= "" then return result end
return nil
end
-- References on another item's own claim (e.g. a currency's ISO code); no value = its best statement.
local function getWdReferenceOnItem(eid, property)
if not wdOK or not Wd or not Wd._reference or not eid then return nil end
local ok, result = pcall(Wd._reference, {"best", "single", property, eid = eid})
if ok and result and result ~= "" then return result end
return nil
end
-- Raw QIDs of EVERY value of an entity-valued property on the current page's own item
local function getWdRawPropertyIds(property)
if not wdOK or not Wd or not Wd._properties then return {} end
local ok, result = pcall(Wd._properties, {"raw", property})
if not ok or not result or type(result) ~= "string" or result == "" then return {} end
local ids = {}
for id in result:gmatch("Q%d+") do
table.insert(ids, id)
end
return ids
end
-- Raw value of a property on a FOREIGN Wikidata item
local function getWdForeignPropertyRaw(eid, property)
if not wdOK or not Wd or not Wd._property or not eid then return nil end
local callArgs = {"raw", "best", property}
callArgs[Wd.args and Wd.args.eid or "eid"] = eid
local ok, result = pcall(Wd._property, callArgs)
if ok and result and type(result) == "string" and result ~= "" then return result end
return nil
end
-- The short symbol (e.g. "$") of a currency/unit item, via P5061
local function getWdUnitSymbol(unitQid)
if not unitQid then return nil end
local ok, statements = pcall(mw.wikibase.getBestStatements, unitQid, UNIT_SYMBOL_PROPERTY)
if not ok or not statements then return nil end
local fallback = nil
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
local value = mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue and mainsnak.datavalue.value
if value and value.text then
if value.language == "mul" or value.language == "en" then return value.text end
fallback = fallback or value.text
end
end
return fallback
end
-- Manx sitelink -> Manx label (redlink) -> English (or other) label with a language marker, linked to
local function getCurrencyLink(qid)
local sitelinkOk, sitelink = pcall(mw.wikibase.getSitelink, qid, "gvwiki")
local labelOk, label, lang = pcall(mw.wikibase.getLabelWithLang, qid)
local link
if sitelinkOk and sitelink then
local displayText = (labelOk and lang == "gv" and label) or sitelink
if displayText ~= sitelink then
link = "[[" .. sitelink .. "|" .. displayText .. "]]"
else
link = "[[" .. sitelink .. "]]"
end
elseif labelOk and label and lang == "gv" then
link = "[[" .. label .. "]]"
elseif labelOk and label then
link = "[https://www.wikidata.org/wiki/" .. qid .. "?uselang=gv " .. label .. "] <small>(" .. lang .. ")</small>"
end
return link and capitalizeFirstLetter(link) or nil
end
-- Resolves one quantity field
local function resolveQuantityField(args, names, yearNames, property, statements, decimals)
local manual = getManual(args, names)
if manual then
if isNone(manual) then return "none" end
-- splitManualNumber (not a plain tonumber) so a manual value with trailing content
local number, tail = splitManualNumber(manual)
local year = yearNames and getManual(args, yearNames)
local parsedYear = year and tonumber(year:match("%-?%d+"))
local trend = trendAgainstWikidata(number, parsedYear, statements)
return {str = manual, number = number, tail = tail, year = year, trend = trend, citation = nil}
end
local latest = nil
for _, entry in ipairs(statements) do
if not latest or (entry.year or 0) > (latest.year or 0) then latest = entry end
end
if not latest then return nil end
local trend = trendAgainstWikidata(latest.amount, latest.year, statements)
local citation = getWdReferenceForValue(property, latest.rawAmount)
return {
str = formatNumber(latest.amount, decimals),
number = latest.amount,
year = latest.year and tostring(latest.year) or nil,
trend = trend,
citation = citation,
unitQid = latest.unitQid,
}
end
-- All non-deprecated P1082 (population) statements on the current page's own item, reduced to
local function getWdPopulationStatements()
local entity = mw.wikibase.getEntityObject()
if not entity then return {} end
local statements = entity:getAllStatements(POPULATION_PROPERTY)
if not statements then return {} end
local results = {}
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
if statement.rank ~= "deprecated" and mainsnak and mainsnak.snaktype == "value"
and mainsnak.datavalue and mainsnak.datavalue.type == "quantity" then
local amount = tonumber(mainsnak.datavalue.value.amount)
local timeQuals = statement.qualifiers and statement.qualifiers.P585
local timeSnak = timeQuals and timeQuals[1]
local timeValue = timeSnak and timeSnak.datavalue and timeSnak.datavalue.value
local year = timeValue and timeValue.time and tonumber(timeValue.time:match("(%-?%d+)%-"))
if amount and year then
table.insert(results, {amount = amount, year = year})
end
end
end
return results
end
-- The population figure for an EXACT year, or nil if Wikidata has none for that year
local function getWdPopulationForYear(year)
if not year then return nil end
local match = nil
for _, entry in ipairs(getWdPopulationStatements()) do
if entry.year == year then match = entry end
end
return match and match.amount or nil
end
-- Computed LTS-per-capita fallback ("yn dooinney")
local function computeGdpPerCapita(total, decimals)
if not total or not total.number then return nil end
local year = total.year and tonumber(total.year:match("%-?%d+"))
if not year then return nil end
local population = getWdPopulationForYear(year)
if not population or population <= 0 then return nil end
local value = total.number / population
return {
str = formatNumber(value, decimals),
number = value,
year = total.year,
trend = nil,
citation = nil,
unitQid = total.unitQid,
}
end
-- One "total + per-capita" block (CCC/PPP or LTS/nominal)
local function buildGdpBlock(args, frame, spec)
local totalStatements = getWdQuantityStatements(spec.totalProperty)
local percapitaStatements = getWdQuantityStatements(spec.percapitaProperty)
local total = resolveQuantityField(args, spec.totalNames, spec.yearNames, spec.totalProperty, totalStatements, 0)
local percapita = resolveQuantityField(args, spec.percapitaNames, spec.yearNames, spec.percapitaProperty, percapitaStatements, 0)
-- Computed fallback
if percapita == nil and spec.populationFallback and type(total) == "table" then
percapita = computeGdpPerCapita(total, 0)
end
local totalShown = type(total) == "table"
local percapitaShown = type(percapita) == "table"
if not totalShown and not percapitaShown then return nil end
local year = getManual(args, spec.yearNames)
or (totalShown and total.year)
or (percapitaShown and percapita.year)
local rows = {}
local headerLabel = getManual(args, spec.headerOverrideNames) or spec.headerLabel
table.insert(rows, string.format(ROW, trClass("mergedtoprow"), headerLabel, year and ("Ooley " .. year) or ""))
local items = {}
if totalShown then
local rhenk = getManual(args, spec.totalRhenkNames)
local ref = getManual(args, spec.totalRefNames)
local note = getManual(args, spec.totalNoteNames)
-- Symbol from THIS statement's own currency (never assumed)
local symbol = getWdUnitSymbol(total.unitQid) or ""
local value = glueTrend(total.trend, symbol .. formatGdpDisplay(total, true)) .. " "
if rhenk then value = value .. "([[" .. spec.totalRhenkLink .. "|" .. rhenk .. "]]) " end
if total.citation then value = stripTrailingSpace(value) .. total.citation end
value = applyRefNote(value, ref, note, frame)
table.insert(items, {"Yn clane", value})
end
if percapitaShown then
local rhenk = getManual(args, spec.percapitaRhenkNames)
local ref = getManual(args, spec.percapitaRefNames)
local note = getManual(args, spec.percapitaNoteNames)
local symbol = getWdUnitSymbol(percapita.unitQid) or ""
-- Per-capita stays a plain grouped number, matching enwiki's own convention
local value = glueTrend(percapita.trend, symbol .. formatGdpDisplay(percapita, false)) .. " "
if rhenk then value = value .. "([[" .. spec.percapitaRhenkLink .. "|" .. rhenk .. "]]) " end
if percapita.citation then value = stripTrailingSpace(value) .. percapita.citation end
value = applyRefNote(value, ref, note, frame)
table.insert(items, {"Yn dooinney", value})
end
appendIndentRun(rows, items)
return table.concat(rows)
end
-- HDI (ALD) bands: thresholds, Manx labels, and font colours exactly as
-- given directly by you.
local function classifyHdiBand(value)
if not value then return nil end
if value >= 0.800 then return "feer ard", "darkgreen" end
if value >= 0.700 then return "ard", "green" end
if value >= 0.550 then return "meanagh", "orange" end
return "injil", "red"
end
-- Gini can be recorded as either a 0-1 fraction or a 0-100 percentage on Wikidata
local function normalizeGiniFraction(value)
if value > 1 then return value / 100 end
return value
end
-- Gini bands: thresholds, Manx labels, and font colours exactly as given directly by you. The medium
local function classifyGiniBand(value)
if not value then return nil end
local fraction = normalizeGiniFraction(value)
if fraction < 0.30 then return "anchorrymid injil", "green" end
if fraction <= 0.40 then return "anchorrymid veanagh", "dimgray" end
return "anchorrymid ard", "red"
end
-- One flat label+value row (Gini, ALD)
local function buildSingleRow(args, frame, spec)
local statements = getWdQuantityStatements(spec.property)
local field = resolveQuantityField(args, spec.valueNames, spec.yearNames, spec.property, statements, spec.decimals)
if not field or field == "none" then return nil end
local label = getManual(args, spec.headerOverrideNames) or spec.headerLabel
local year = getManual(args, spec.yearNames) or field.year
if year then label = label .. " <span style='font-weight:normal;'>(" .. year .. ")</span>" end
local rhenk = getManual(args, spec.rhenkNames)
local ref = getManual(args, spec.refNames)
local note = getManual(args, spec.noteNames)
-- Band: a manual value always wins outright, including |..._ronney=none to suppress it entirely
local rawBand = spec.bandNames and getManual(args, spec.bandNames)
local band, bandColor
if rawBand then
if not isNone(rawBand) then band = rawBand end
elseif spec.classifyBand and field.number then
band, bandColor = spec.classifyBand(field.number)
end
local value = glueTrend(field.trend, field.str) .. " "
if band then
-- Nowrapped so the band's own words (e.g. "anchorrymid ard") can't split across lines
local bandText = bandColor and ('<span style="color:' .. bandColor .. ';">' .. band .. "</span>") or band
value = value .. '<span style="white-space:nowrap;">(' .. bandText .. ")</span> "
end
if rhenk then value = value .. "([[" .. spec.rhenkLink .. "|" .. rhenk .. "]]) " end
if field.citation then value = stripTrailingSpace(value) .. field.citation end
value = applyRefNote(value, ref, note, frame)
return string.format(ROW, "", label, value)
end
-- One "name ($) (CODE)" line for a single currency item.
local function buildCurrencyLine(qid, codeOverride)
local nameStr = getCurrencyLink(qid)
if not nameStr then return nil end
local symbol = getWdUnitSymbol(qid)
local codeStr = codeOverride or getWdForeignPropertyRaw(qid, ISO_CODE_PROPERTY)
local line = nameStr
local refs = getWdReferenceForValue(CURRENCY_PROPERTY, qid) or ""
if symbol then
line = line .. " (" .. symbol .. ")"
refs = refs .. (getWdReferenceOnItem(qid, UNIT_SYMBOL_PROPERTY) or "")
end
if codeStr then
line = line .. " (<code>[[ISO 4217|" .. codeStr .. "]]</code>)"
if not codeOverride then refs = refs .. (getWdReferenceOnItem(qid, ISO_CODE_PROPERTY) or "") end
end
return line .. refs
end
local function buildCurrencyRow(args, frame)
local nameManual = getManual(args, {"argid"})
local codeManual = getManual(args, {"coad_argid"})
local ref = getManual(args, {"imraa_argid"})
local note = getManual(args, {"noteyn_argid"})
local headerLabel = getManual(args, {"sorçh_argid"}) or "[[Argid cadjin|Argid]]"
if isNone(nameManual) then return nil end
local value
if nameManual then
-- Manual text passes through as typed
local line1 = nameManual
if codeManual then line1 = line1 .. " (<code>[[ISO 4217|" .. codeManual .. "]]</code>)" end
local lines = {line1}
local n = 2
while true do
local name = getManual(args, {"argid" .. n})
if not name then break end
local code = getManual(args, {"coad_argid" .. n})
local line = name
if code then line = line .. " (<code>[[ISO 4217|" .. code .. "]]</code>)" end
table.insert(lines, line)
n = n + 1
end
value = table.concat(lines, "<br/>")
else
-- Every P38 currency (a country can use more than one), each its
-- own line -- not just the single "best" one.
local currencyQids = getWdRawPropertyIds(CURRENCY_PROPERTY)
if #currencyQids == 0 then return nil end
local lines = {}
for _, qid in ipairs(currencyQids) do
local line = buildCurrencyLine(qid, #currencyQids == 1 and codeManual or nil)
if line then table.insert(lines, line) end
end
if #lines == 0 then return nil end
value = table.concat(lines, "<br/>")
end
value = applyRefNote(value, ref, note, frame)
return string.format(ROW, "", headerLabel, value)
end
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
-- Old template order: PPP (CCK/CCC) block first, nominal (ennymagh)
-- second, then Gini, ALD, Currency.
local cccBlock = buildGdpBlock(args, frame, {
totalNames = {"ccc", "LTS_CCK"},
percapitaNames = {"ccc_dooinney", "LTS_CCK_yn_dooinney"},
yearNames = {"blein_ccc", "blein_LTS_CCK"},
totalRhenkNames = {"rhenk_ccc", "rhenk_LTS_CCK"},
percapitaRhenkNames = {"rhenk_ccc_dooinney", "rhenk_LTS_CCK_yn_dooinney"},
totalRefNames = {"imraa_ccc"}, totalNoteNames = {"noteyn_ccc"},
percapitaRefNames = {"imraa_ccc_dooinney"}, percapitaNoteNames = {"noteyn_ccc_dooinney"},
headerOverrideNames = {"sorçh_ccc"},
headerLabel = "[[Lane troar sthie|LTS]] (CCC)",
totalProperty = GDP_PPP_TOTAL, percapitaProperty = GDP_PPP_PERCAPITA,
totalRhenkLink = "Rolley çheeraghyn rere LTS (CCC)",
percapitaRhenkLink = "Rolley çheeraghyn rere LTS (CCC) yn dooinney",
})
appendSection(rows, cccBlock and {cccBlock} or nil)
local ltsBlock = buildGdpBlock(args, frame, {
totalNames = {"lts_ennymagh", "LTS_ennymagh"},
percapitaNames = {"lts_ennymagh_dooinney", "LTS_ennymagh_yn_dooinney"},
yearNames = {"blein_lts_ennymagh", "blein_LTS_ennymagh"},
totalRhenkNames = {"rhenk_lts_ennymagh", "rhenk_LTS_ennymagh"},
percapitaRhenkNames = {"rhenk_lts_ennymagh_dooinney", "rhenk_LTS_ennymagh_yn_dooinney"},
totalRefNames = {"imraa_lts_ennymagh"}, totalNoteNames = {"noteyn_lts_ennymagh"},
percapitaRefNames = {"imraa_lts_ennymagh_dooinney"}, percapitaNoteNames = {"noteyn_lts_ennymagh_dooinney"},
headerOverrideNames = {"sorçh_lts_ennymagh"},
headerLabel = "[[Lane troar sthie|LTS]] (ennymagh)",
totalProperty = GDP_NOMINAL_TOTAL, percapitaProperty = GDP_NOMINAL_PERCAPITA,
totalRhenkLink = "Rolley çheeraghyn rere LTS (ennymagh)",
percapitaRhenkLink = "Rolley çheeraghyn rere LTS (ennymagh) yn dooinney",
populationFallback = true,
})
appendSection(rows, ltsBlock and {ltsBlock} or nil)
local giniRow = buildSingleRow(args, frame, {
valueNames = {"gini", "Gini"},
yearNames = {"blein_gini", "blein_Gini"},
bandNames = {"ronney_gini", "ronney_Gini"},
rhenkNames = {"rhenk_gini", "rhenk_Gini"},
refNames = {"imraa_gini"}, noteNames = {"noteyn_gini"},
headerOverrideNames = {"sorçh_gini"},
headerLabel = "[[Co-effaght Gini|Gini]]",
rhenkLink = "Rolley çheeraghyn rere co-chormid çheet stiagh",
property = GINI_PROPERTY, decimals = 1,
classifyBand = classifyGiniBand,
})
appendSection(rows, giniRow and {giniRow} or nil)
local aldRow = buildSingleRow(args, frame, {
valueNames = {"ald", "ALD"},
yearNames = {"blein_ald", "blein_ALD"},
bandNames = {"ronney_ald", "ronney_ALD"},
rhenkNames = {"rhenk_ald", "rhenk_ALD"},
refNames = {"imraa_ald"}, noteNames = {"noteyn_ald"},
headerOverrideNames = {"sorçh_ald"},
headerLabel = "[[Ayndagh Lhiasaghey Deiney|ALD]]",
rhenkLink = "Rolley çheeraghyn rere Ayndagh Lhiasaghey Deiney",
property = HDI_PROPERTY, decimals = 3,
classifyBand = classifyHdiBand,
})
appendSection(rows, aldRow and {aldRow} or nil)
local currencyRow = buildCurrencyRow(args, frame)
appendSection(rows, currencyRow and {currencyRow} or nil)
if #rows == 0 then return nil end
return table.concat(rows)
end
return p
rvevw71otur3j482ueqpi4xf6ne5gof
Module:Kishtey fys çheer/coadyn
828
55892
394739
394657
2026-10-18T15:16:54Z
MacTire02
219
++
394739
Scribunto
text/plain
local p = {}
-- ------------------------------------------------ Wikidata properties
local TIMEZONE_PROPERTY = "P421"
local DATE_FORMAT_PARAM = "format_date"
local CALLING_CODE_PROPERTY = "P474"
local ISO_CODE_PROPERTY = "P297"
local TLD_PROPERTY = "P78"
local WEBSITE_PROPERTY = "P856"
local VALID_PERIOD_QUALIFIER = "P1264"
local UTC_OFFSET_PROPERTY = "P2907"
-- ------------------------------------------------ Helpers
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
-- Wikidata references for a claim value (empty if none); value = raw item id or raw string.
local wdOK, Wd = pcall(require, "Module:Wd")
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
local function stripTrailingSpace(value)
local changed = true
while changed do
local stripped = value:gsub("%s+$", ""):gsub(" $", "")
changed = (stripped ~= value)
value = stripped
end
return value
end
local function appendInsideTrailingBlock(text, insertion)
if not insertion or insertion == "" then return text end
local trailingTags = {}
local rest = text
while true do
local tag = rest:match("(</%a[%w]*>)%s*$")
if not tag then break end
local tagStart = rest:find(tag .. "%s*$")
table.insert(trailingTags, 1, tag)
rest = rest:sub(1, tagStart - 1)
end
if #trailingTags == 0 then
return text .. insertion
end
return rest .. insertion .. table.concat(trailingTags)
end
local function applyRefNote(value, ref, note, frame)
if not value then
return value
end
local hasNote = note and note ~= "" and frame
local hasRef = ref and ref ~= ""
if hasNote or hasRef then
value = stripTrailingSpace(value)
end
if hasNote then
value = appendInsideTrailingBlock(value, frame:expandTemplate{ title = "efn", args = { note } })
end
if hasRef then
value = appendInsideTrailingBlock(value, wrapReference(ref))
end
return value
end
local function getEntity()
local ok, entity = pcall(mw.wikibase.getEntityObject)
if ok then
return entity
end
return nil
end
local function getStatements(property)
local entity = getEntity()
if not entity then
return {}
end
local statements = entity:getAllStatements(property)
if not statements then
return {}
end
local result = {}
for _, statement in ipairs(statements) do
if statement.rank ~= "deprecated"
and statement.mainsnak
and statement.mainsnak.snaktype == "value"
and statement.mainsnak.datavalue then
table.insert(result, statement)
end
end
return result
end
-- ------------------------------------------------ Wikidata item label
local function getLabel(qid)
if not qid then
return nil
end
local ok, label, lang =
pcall(mw.wikibase.getLabelWithLang, qid)
if ok and label then
return label, lang
end
return nil
end
-- ------------------------------------------------ UTC offset formatting
local function parseUtcOffset(label)
if not label then
return nil
end
local sign, hh, mm = mw.ustring.match(label, "^UTC(%+)(%d%d):(%d%d)$")
if not sign then
sign, hh, mm = mw.ustring.match(label, "^UTC(%-)(%d%d):(%d%d)$")
end
if not sign then
sign, hh, mm = mw.ustring.match(label, "^UTC(\226\136\146)(%d%d):(%d%d)$")
end
if not sign then
return nil
end
local totalMinutes = tonumber(hh) * 60 + tonumber(mm)
if sign ~= "+" then
totalMinutes = -totalMinutes
end
return {
minutes = totalMinutes,
offsetText = sign .. hh .. ":" .. mm,
}
end
local function formatUTCLabel(label)
if not label then
return nil
end
local parsed = parseUtcOffset(label)
if parsed then
return "[[UTC" .. parsed.offsetText .. "]]"
end
return label
end
local function roundHalfAwayFromZero(n)
if n >= 0 then
return math.floor(n + 0.5)
end
return -math.floor(-n + 0.5)
end
local function getWdUtcOffsetProperty(qid)
if not qid then
return nil
end
local ok, statements = pcall(mw.wikibase.getBestStatements, qid, UTC_OFFSET_PROPERTY)
if not ok or not statements then
return nil
end
for _, statement in ipairs(statements) do
local mainsnak = statement.mainsnak
local datavalue = mainsnak and mainsnak.snaktype == "value" and mainsnak.datavalue
if datavalue and datavalue.type == "quantity" and datavalue.value then
local amount = tonumber(datavalue.value.amount)
if amount then
local totalMinutes = roundHalfAwayFromZero(amount * 60)
local sign = totalMinutes < 0 and "-" or "+"
local absMinutes = math.abs(totalMinutes)
local hh = math.floor(absMinutes / 60)
local mm = absMinutes % 60
return {
minutes = totalMinutes,
offsetText = sign .. string.format("%02d", hh) .. ":" .. string.format("%02d", mm),
}
end
elseif datavalue and datavalue.type == "string" and datavalue.value then
local fromString = parseUtcOffset(datavalue.value) or parseUtcOffset("UTC" .. datavalue.value)
if fromString then
return fromString
end
end
end
return nil
end
local function getEffectiveOffset(zone)
if not zone then
return nil
end
return parseUtcOffset(zone.label) or getWdUtcOffsetProperty(zone.qid)
end
local function formatManualOffset(rawValue)
if not rawValue then
return nil
end
local withoutPrefix = mw.ustring.match(rawValue, "^UTC(.+)$") or rawValue
local sign, hh, mm = mw.ustring.match(withoutPrefix, "^(%+)(%d%d?):(%d%d)$")
if not sign then
sign, hh, mm = mw.ustring.match(withoutPrefix, "^(%-)(%d%d?):(%d%d)$")
end
if not sign then
sign, hh, mm = mw.ustring.match(withoutPrefix, "^(\226\136\146)(%d%d?):(%d%d)$")
end
if sign then
return "[[UTC" .. sign .. string.format("%02d", tonumber(hh)) .. ":" .. mm .. "]]"
end
return rawValue
end
local function combineNameAndOffset(offsetValue, nameValue)
local offsetDisplay = offsetValue and formatManualOffset(offsetValue)
if offsetDisplay and nameValue then
return offsetDisplay .. " (" .. nameValue .. ")"
end
return offsetDisplay or nameValue
end
-- ------------------------------------------------ Time-zone formatting
local function getTimeZoneData()
local statements = getStatements(TIMEZONE_PROPERTY)
local standard = nil
local daylight = nil
local ordinary = {}
for _, statement in ipairs(statements) do
local value = statement.mainsnak.datavalue.value
local qid = value and value.id
if qid then
local label = getLabel(qid)
local periodQualifiers =
statement.qualifiers
and statement.qualifiers[VALID_PERIOD_QUALIFIER]
local periodQid = nil
if periodQualifiers and periodQualifiers[1] then
local periodValue =
periodQualifiers[1].datavalue
and periodQualifiers[1].datavalue.value
periodQid = periodValue and periodValue.id
end
if periodQid == "Q1777301" then
-- Standard time
standard = {
qid = qid,
label = label,
}
elseif periodQid == "Q36669" then
-- Daylight saving time
daylight = {
qid = qid,
label = label,
}
else
table.insert(ordinary, {
qid = qid,
label = label,
})
end
end
end
return standard, daylight, ordinary
end
-- ------------------------------------------------ Time-zone line
local function formatZone(zone)
if not zone then
return nil
end
local label = zone.label
if not label then
return nil
end
-- ------------------------------------------------ Short name (P1813)
local shortName = nil
local ok, statements =
pcall(
mw.wikibase.getBestStatements,
zone.qid,
"P1813"
)
if ok and statements then
for _, statement in ipairs(statements) do
local value =
statement.mainsnak
and statement.mainsnak.datavalue
and statement.mainsnak.datavalue.value
if value and value.text then
if value.language == "en"
or value.language == "mul" then
shortName = value.text
break
end
shortName = shortName or value.text
end
end
end
-- ------------------------------------------------ (a) the label is already offset-shaped
local parsedFromLabel = parseUtcOffset(label)
if parsedFromLabel then
local utcLabel = "[[UTC" .. parsedFromLabel.offsetText .. "]]"
if shortName then
return utcLabel .. " (" .. shortName .. ")"
end
return utcLabel
end
-- ------------------------------------------------ (b) the label is a NAME
local fromProperty = getWdUtcOffsetProperty(zone.qid)
if fromProperty then
return "[[UTC" .. fromProperty.offsetText .. "]] (" .. (shortName or label) .. ")"
end
-- No numeric offset available anywhere -- fall back to the bare name
-- (better than nothing, but still missing the offset).
return label
end
local function formatOrdinaryZones(ordinary)
if not ordinary or #ordinary == 0 then
return nil
end
if #ordinary == 1 then
return formatZone(ordinary[1])
end
local parsed = {}
for _, zone in ipairs(ordinary) do
local p = getEffectiveOffset(zone)
if not p then
return formatZone(ordinary[1])
end
table.insert(parsed, p)
end
table.sort(parsed, function(a, b) return a.minutes < b.minutes end)
local lowest = parsed[1]
local highest = parsed[#parsed]
if lowest.minutes == highest.minutes then
return "[[UTC" .. lowest.offsetText .. "]]"
end
return "[[UTC" .. lowest.offsetText .. "]]" ..
" dys " ..
"[[UTC" .. highest.offsetText .. "|" .. highest.offsetText .. "]]"
end
local function buildTimezone()
local standard, daylight, ordinary = getTimeZoneData()
if not standard then
-- No period-qualified (standard/daylight-saving) statement at all
local refs = {}
for _, zone in ipairs(ordinary) do
table.insert(refs, getWdCitation(TIMEZONE_PROPERTY, zone.qid) or "")
end
return formatOrdinaryZones(ordinary), nil, table.concat(refs), nil
end
local standardText = formatZone(standard)
if not standardText then
return nil, nil
end
local daylightText = formatZone(daylight)
return standardText, daylightText,
getWdCitation(TIMEZONE_PROPERTY, standard.qid),
daylight and getWdCitation(TIMEZONE_PROPERTY, daylight.qid) or nil
end
-- ------------------------------------------------ Simple Wikidata string property
local function getStringProperty(property)
local statements = getStatements(property)
for _, statement in ipairs(statements) do
local value =
statement.mainsnak.datavalue
and statement.mainsnak.datavalue.value
if type(value) == "string" then
return value
end
end
return nil
end
-- ------------------------------------------------ Internet TLD
local function getTld()
local statements = getStatements(TLD_PROPERTY)
local values = {}
local refs = {}
for _, statement in ipairs(statements) do
local value =
statement.mainsnak.datavalue
and statement.mainsnak.datavalue.value
if value and value.id then
local label = getLabel(value.id)
if label then
table.insert(values, label)
table.insert(refs, getWdCitation(TLD_PROPERTY, value.id) or "")
end
end
end
if #values == 0 then
return nil
end
local joinedRefs = table.concat(refs)
return table.concat(values, "<br/>"), joinedRefs ~= "" and joinedRefs or nil
end
-- ------------------------------------------------ Official website
local function getWebsite()
local statements = getStatements(WEBSITE_PROPERTY)
local urls = {}
for _, statement in ipairs(statements) do
local value =
statement.mainsnak.datavalue
and statement.mainsnak.datavalue.value
if type(value) == "string" and value ~= "" then
table.insert(urls, value)
end
end
if #urls == 0 then
return nil
end
local links = {}
local refs = {}
for _, url in ipairs(urls) do
table.insert(refs, getWdCitation(WEBSITE_PROPERTY, url) or "")
table.insert(
links,
'<span class="url">[' ..
url ..
' ' ..
mw.text.encode(
url:gsub("^https?://", "")
) ..
']</span>'
)
end
local joinedRefs = table.concat(refs)
return table.concat(links, "<br/>"), joinedRefs ~= "" and joinedRefs or nil
end
-- ------------------------------------------------ Row builder
local function buildRow(label, value)
if not value or value == "" then
return nil
end
return '<tr>' ..
'<th style="vertical-align:top; white-space:nowrap; ' ..
'text-align:left; font-weight:bold; padding-left:0.4em; ' ..
'padding-right:0.4em; border-bottom:1px solid #a2a9b1;">' ..
label ..
'</th>' ..
'<td style="vertical-align:top; padding-left:0.4em; ' ..
'padding-right:0.4em; border-bottom:1px solid #a2a9b1;">' ..
value ..
'</td>' ..
'</tr>'
end
local function appendGroupedRows(rows, items)
local present = {}
for _, item in ipairs(items) do
if item.value and item.value ~= "" then
table.insert(present, item)
end
end
for idx, item in ipairs(present) do
local border = (idx == #present)
and "border-bottom:1px solid #a2a9b1;"
or ""
if item.indent then
table.insert(
rows,
'<tr><th style="vertical-align:top; white-space:nowrap; ' ..
'text-align:left; font-weight:normal; padding-left:0.9em; ' ..
'padding-right:0.4em; ' .. border .. '">' ..
'• ' .. item.label .. '</th>' ..
'<td style="vertical-align:top; padding-left:0.4em; ' ..
'padding-right:0.4em; ' .. border .. '">' ..
item.value .. '</td></tr>'
)
else
table.insert(
rows,
'<tr><th style="vertical-align:top; white-space:nowrap; ' ..
'text-align:left; font-weight:bold; padding-left:0.4em; ' ..
'padding-right:0.4em; ' .. border .. '">' ..
item.label .. '</th>' ..
'<td style="vertical-align:top; padding-left:0.4em; ' ..
'padding-right:0.4em; ' .. border .. '">' ..
item.value .. '</td></tr>'
)
end
end
end
-- ------------------------------------------------ Website row
local function buildWebsiteRow(value)
if not value or value == "" then
return nil
end
return '<tr>' ..
'<td colspan="2" style="text-align:center; ' ..
'padding:0.4em;">' ..
value ..
'</td>' ..
'</tr>'
end
-- ------------------------------------------------ Main
function p.main(frame, args)
if not args then
args = frame:getParent().args
end
local rows = {}
-- ------------------------------------------------ Time zone
local manualZoneName = getManual(args, {
"cryss_hraa",
"traa_ynnydagh"
})
local manualZoneOffset = getManual(args, {
"ashchur",
"ashchur_utc"
})
local imraaCryssHraa = getManual(args, {
"imraa_cryss_hraa",
"imraa_ashchur_utc",
"imraa_ashchur"
})
local noteynCryssHraa = getManual(args, {
"noteyn_cryss_hraa",
"noteyn_ashchur_utc",
"noteyn_ashchur"
})
local mainZoneValue = nil
local wikidataDaylightValue = nil
if manualZoneName or manualZoneOffset then
mainZoneValue = applyRefNote(
combineNameAndOffset(manualZoneOffset, manualZoneName),
imraaCryssHraa,
noteynCryssHraa,
frame
)
else
local standardText, daylightText, standardRef, daylightRef = buildTimezone()
if standardText then
if standardRef == "" then standardRef = nil end
mainZoneValue = applyRefNote(standardText, imraaCryssHraa or standardRef, noteynCryssHraa, frame)
wikidataDaylightValue = daylightText
if wikidataDaylightValue and daylightRef then
wikidataDaylightValue = applyRefNote(wikidataDaylightValue, daylightRef, nil, frame)
end
end
end
local manualTtlsName = getManual(args, {
"cryss_hraa_thhl",
"traa_ynnydagh_TTLS"
})
local manualTtlsOffset = getManual(args, {
"ashchur_TTLS",
"ashchur_utc_TTLS"
})
local noteTTLS = getManual(args, {
"noteyn_cryss_hraa_thhl",
"note_TTLS",
"noteyn_ashchur_TTLS",
"noteyn_ashchur_utc_TTLS"
})
local imraaTTLS = getManual(args, {
"imraa_cryss_hraa_thhl",
"imraa_ashchur_TTLS",
"imraa_ashchur_utc_TTLS"
})
local thhlValue = nil
if mainZoneValue then
if manualTtlsName or manualTtlsOffset then
thhlValue = applyRefNote(
combineNameAndOffset(manualTtlsOffset, manualTtlsName),
imraaTTLS,
nil,
frame
)
else
thhlValue = wikidataDaylightValue
end
end
appendGroupedRows(rows, {
{ label = "[[Cryss hraa]]", value = mainZoneValue },
{
label = "Sourey ([[Traa hashtee hollys y laa|THHL]])",
value = thhlValue,
indent = true
},
})
if noteTTLS then
table.insert(
rows,
buildRow(
"",
noteTTLS
)
)
end
-- ------------------------------------------------ Date format
local dateFormat = getManual(args, {
"format_date",
"date_format"
})
if dateFormat then
table.insert(
rows,
buildRow(
"Cummey date",
dateFormat
)
)
end
-- ------------------------------------------------ Calling code
local callingCode = getManual(args, {
"coad_çhellvane"
})
local callingCodeRef = nil
if not callingCode then
callingCode = getStringProperty(CALLING_CODE_PROPERTY)
callingCodeRef = callingCode and getWdCitation(CALLING_CODE_PROPERTY, callingCode)
end
if callingCode then
if not callingCode:match("^%+") then
callingCode = "+" .. callingCode
end
callingCode = applyRefNote(
callingCode,
getManual(args, { "imraa_coad_çhellvane" }) or callingCodeRef,
getManual(args, { "noteyn_coad_çhellvane" }),
frame
)
table.insert(
rows,
buildRow(
"[[Rolley coadyn çhellvane eddyr-ashoonagh|Coad çhellvane]]",
callingCode
)
)
end
-- ------------------------------------------------ ISO 3166-1 alpha-2
local isoCode = getManual(args, {
"coad_ISO",
"iso3166code"
})
local isoRef = nil
if not isoCode then
isoCode = getStringProperty(ISO_CODE_PROPERTY)
isoRef = isoCode and getWdCitation(ISO_CODE_PROPERTY, isoCode)
end
if isoCode then
isoCode = applyRefNote(
isoCode,
getManual(args, { "imraa_coad_iso" }) or isoRef,
getManual(args, { "noteyn_coad_iso" }),
frame
)
table.insert(
rows,
buildRow(
"[[ISO 3166|Coad ISO 3166]]",
isoCode
)
)
end
-- ------------------------------------------------ Internet TLD
local tld = getManual(args, {
"tld",
"cctld"
})
local tldRef = nil
if not tld then tld, tldRef = getTld() end
if tld then
tld = applyRefNote(
tld,
getManual(args, { "imraa_tld" }) or tldRef,
getManual(args, { "noteyn_tld" }),
frame
)
table.insert(
rows,
buildRow(
"[[TLD yn eddyr-voggyl]]",
tld
)
)
end
-- ------------------------------------------------ Official website
local website = getManual(args, {
"ynnyd-eggey",
"duillag",
"duillag_oikoil"
})
local websiteRef = nil
if not website then website, websiteRef = getWebsite() end
if website then
website = applyRefNote(
website,
getManual(args, { "imraa_ynnyd-eggey" }) or websiteRef,
getManual(args, { "noteyn_ynnyd-eggey" }),
frame
)
table.insert(
rows,
buildWebsiteRow(website)
)
end
-- ------------------------------------------------ Nothing to display
if #rows == 0 then
return nil
end
return table.concat(rows)
end
return p
08t3ctd51zhnbj2gedln9t8rjam54ab
Module:Kishtey fys çheer/aarheynn
828
55930
394742
394655
2026-10-18T15:29:24Z
MacTire02
219
++
394742
Scribunto
text/plain
local p = {}
-- Sovereignty/subdivision membership
local wdOK, Wd = pcall(require, "Module:Wd")
local ennymWdOK, EnnymWd = pcall(require, "Module:Kishtey fys çheer/ennym-wd")
local function getManual(args, names)
for _, name in ipairs(names) do
local value = args[name]
if value and mw.text.trim(value) ~= "" then
return mw.text.trim(value)
end
end
return nil
end
local function isNone(value)
return value ~= nil and mw.text.trim(value):lower() == "none"
end
-- Wraps a manual citation in <ref>, tolerating a value Scribunto already
-- pre-expanded into rendered "[N]" marker(s) or UNIQ...QINU strip markers.
local function wrapReference(ref)
if not ref or ref == "" then return nil end
-- Any <ref> already present (named or not, one or several) is left alone; only bare text is wrapped.
if mw.ustring.find(ref, "UNIQ--ref-", 1, true) or mw.ustring.find(mw.ustring.lower(ref), "<ref", 1, true) then
return ref
end
if mw.ustring.gsub(mw.ustring.gsub(ref, "%[%d+%]", ""), "%s+", "") == "" then
return ref
end
return "<ref>" .. ref .. "</ref>"
end
local function applyRefNote(value, ref, note, frame)
if not value then return value end
if note and note ~= "" and frame then
value = value .. frame:expandTemplate{ title = "efn", args = { note } }
end
if ref and ref ~= "" then
value = value .. wrapReference(ref)
end
return value
end
-- The row label is shown exactly as given -- never auto-wikilinked.
-- Linking is entirely the editor's own choice.
local function wikilinkLabel(label)
return label
end
local function getWdRawPropertyId(property)
if not wdOK or not Wd or not Wd._property then return nil end
local ok, result = pcall(Wd._property, {"raw", "best", property})
if ok and result and type(result) == "string" and result:match("^Q%d+$") then return result end
return nil
end
-- Wikidata references for a claim value (empty if none).
local function getWdCitation(property, value)
if not wdOK or not Wd or not Wd._reference or not value then return nil end
local ok, result = pcall(Wd._reference, {"best", property, value})
if ok and result and result ~= "" then return result end
return nil
end
local function wikiUcfirst(text)
if not text or text == "" then return text end
local ok, result = pcall(function() return mw.language.getContentLanguage():ucfirst(text) end)
if ok and result and result ~= "" then return result end
return text
end
-- Three-tier Wikidata-entity-to-Manx-link resolver
local function getWdItemManxLink(qid)
if not qid then return nil end
local okSite, sitelinkTitle = pcall(mw.wikibase.sitelink, qid)
if not okSite then sitelinkTitle = nil end
sitelinkTitle = (sitelinkTitle and sitelinkTitle ~= "") and sitelinkTitle or nil
local okLabel, gvLabel = pcall(mw.wikibase.getLabelByLang, qid, "gv")
if okLabel and gvLabel and gvLabel ~= "" then
gvLabel = wikiUcfirst(gvLabel)
else
gvLabel = nil
end
if not sitelinkTitle and not gvLabel then
if ennymWdOK and EnnymWd and EnnymWd.labelWithFallback then
local ok, annotated = pcall(EnnymWd.labelWithFallback, qid)
if ok and annotated then return annotated end
end
return nil
end
local target = sitelinkTitle or gvLabel
local displayBase = gvLabel or sitelinkTitle
if target == displayBase then return "[[" .. target .. "]]" end
return "[[" .. target .. "|" .. displayBase .. "]]"
end
-- Current page's own title, for the self-link guard below.
local function getCurrentPageTitle()
local ok, title = pcall(function() return mw.title.getCurrentTitle().text end)
if ok and title and title ~= "" then return title end
return nil
end
-- Strips a leading Manx definite article ("Yn "/"Y ") for self-link comparison only
local function stripLeadingArticle(text)
if not text then return text end
local stripped = text:match("^[Yy]n%s+(.+)$") or text:match("^[Yy]%s+(.+)$")
return stripped or text
end
-- True when a "[[Target]]"/"[[Target|Display]]" wikilink points at the current page itself
local function isSelfLink(link)
if not link then return false end
local target = link:match("^%[%[([^%[%]|]+)")
if not target then return false end
local current = getCurrentPageTitle()
if not current then return false end
if target == current then return true end
return stripLeadingArticle(target) == stripLeadingArticle(current)
end
-- No `white-space:nowrap` on the label cell
local ROW = '<tr><th style="vertical-align:top; text-align:left; font-weight:bold; padding-left:0.4em; padding-right:0.4em;">%s</th><td style="vertical-align:top; padding-left:0.4em; padding-right:0.4em;">%s</td></tr>'
-- Numbered levels supported (enwiki's own subdivision_type1/_2/_3...).
local MAX_LEVELS = 5
-- Level-1-only fallback label when |sorçh_aarheynn= isn't set but a Wikidata P17 value is found
local LEVEL1_FALLBACK_LABEL = "Steat kionedeeagh"
-- Returns an array of row strings (or nil), for reiltys.lua to splice into its own row list
function p.main(frame, args)
if not args then
args = frame
frame = mw.getCurrentFrame()
end
local rows = {}
for i = 1, MAX_LEVELS do
local suffix = tostring(i)
local typeNames = { "sorçh_aarheynn" .. suffix }
local nameNames = { "ennym_aarheynn" .. suffix }
local refNames = { "imraa_aarheynn" .. suffix }
local noteNames = { "noteyn_aarheynn" .. suffix }
if i == 1 then
-- Bare, unnumbered form (as used on the Netherlands article) is
-- a synonym for level 1.
table.insert(typeNames, 1, "sorçh_aarheynn")
table.insert(nameNames, 1, "ennym_aarheynn")
table.insert(refNames, 1, "imraa_aarheynn")
table.insert(noteNames, 1, "noteyn_aarheynn")
end
-- The type/label is always manual if given
local wdRef = nil
local typeRaw = getManual(args, typeNames)
if not isNone(typeRaw) then
local nameRaw = getManual(args, nameNames)
if isNone(nameRaw) then
nameRaw = nil
elseif not nameRaw and i == 1 then
-- Wikidata fallback (P17, "country")
local qid = getWdRawPropertyId("P17")
if qid then
local link = getWdItemManxLink(qid)
-- Skip a self-link automatically (e.g. P17 looping back to the current article)
if link and not isSelfLink(link) then
nameRaw = link
wdRef = getWdCitation("P17", qid)
end
end
end
local label = typeRaw
if not label and i == 1 and nameRaw then
label = LEVEL1_FALLBACK_LABEL
end
if label and nameRaw then
local ref = getManual(args, refNames)
local note = getManual(args, noteNames)
table.insert(rows, string.format(ROW, wikilinkLabel(label), applyRefNote(nameRaw, ref or wdRef, note, frame)))
end
end
end
if #rows == 0 then return nil end
return rows
end
return p
b8jcd3r7bhm9g3b1i3ih8h40q871s9v
Ronney:Artyn lesh teks ayns Kurdish
14
56269
394756
2026-10-18T19:49:42Z
MacTire02
219
ronney noa
394756
wikitext
text/x-wiki
{{Non-Manx-language text category}}
ftm4vo8zcojmgp8zf3wygcgvg0ztoi7
Ronney:Artyn lesh teks ayns Pershish
14
56270
394764
2026-10-19T01:35:18Z
MacTire02
219
ronney noa
394764
wikitext
text/x-wiki
{{Non-Manx-language text category}}
ftm4vo8zcojmgp8zf3wygcgvg0ztoi7
Ronney:Artyn lesh teks ayns Indoneeshish
14
56271
394774
2026-10-19T02:45:23Z
MacTire02
219
ronney noa
394774
wikitext
text/x-wiki
{{Non-Manx-language text category}}
ftm4vo8zcojmgp8zf3wygcgvg0ztoi7
Ronney:Artyn lesh teks ayns Kawish
14
56272
394775
2026-10-19T02:45:49Z
MacTire02
219
ronney noa
394775
wikitext
text/x-wiki
{{Non-Manx-language text category}}
ftm4vo8zcojmgp8zf3wygcgvg0ztoi7