Module:Country links: Difference between revisions

Content deleted Content added
No edit summary
refactor for easier testing of different languages
Line 65:
 
function p.get_donate_url( language_code, country_code )
local url = 'https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage'
url = url .. '?utm_medium=Waystogive&utm_source=Waystogive&utm_campaign=C11_Waystogive'
url = url .. '&uselang=' .. language_code
url = url .. '&country=' .. country_code
Line 71 ⟶ 72:
end
 
function p.make_donate_links( language_code, country_list )
 
local language_code = p.page_language( frame )
local wikitext = ''
local t = {}
Line 92:
end
 
function p.mainbuild_all_regions( framelanguage_code )
local language_code = p.page_language( frame )
local wikitext = ''
for i,v in ipairs(p.regions) do
local region_name = p.get_country_name( language_code, v.name_code )
wikitext = wikitext .. '\n== ' .. region_name .. ' ==\n'
wikitext = wikitext .. p.make_donate_links( language_code, v.countries )
end
return wikitext
end
 
function p.main( frame )
local language_code = p.page_language( frame )
return p.build_all_regions( language_code )
end
function p.page_language( frame )
local full_title = mw.title.getCurrentTitle().prefixedText