Content deleted Content added
No edit summary
No edit summary
Line 124:
end
 
-- Function to format country flag using flagicon templateframe:expandTemplate
-- @param country string: The country code or name
-- @param frame table: The current frame object for template expansion
-- @return string: Formatted country flag or empty string if country is nil or empty
local function formatCountryFlag(country, frame)
if not country or country == "" then
return ""
end
-- Use frame:expandTemplate to process the flagicon template
return string.format('{{flagicon|%s}} ', country)
local flagTemplate = frame:expandTemplate{
title = 'flagicon',
args = { country }
}
return flagTemplate .. ' '
end
 
Line 206 ⟶ 213:
local channelUrl = ""
local channelDisplay = channel.name
local countryFlag = formatCountryFlag(channel.country, frame)
if channel.channel and channel.channel ~= '' then