Module:Flags: Difference between revisions

Content deleted Content added
Found it. Doh.
Changing order of parameters in order to allow multiple keys e.g. GB UK pointing to a same flag value
Line 14:
-- 2 letter code search
if #territory.args[1] == 2 then
for englishflagParameter,localecommonsFile in pairs(master.twoLetter) do
if flagParameter == territory.args[1] == locale then
commonsName = englishcommonsFile
link = locale flagParameter
end -- FIXME this link is problematic, especially in non-English
end
Line 24:
-- 3 letter code search
if #territory.args[1] == 3 then
for englishflagParameter,localecommonsFile in pairs(master.threeLetter) do
if flagParameter == territory.args[1] == locale then
commonsName = englishcommonsFile
link = locale flagParameter
end -- FIXME this link is problematic, especially in non-English
end
end
-- Searching in bothFlagTranslations, tablesthen in FlagMaster
-- Full name search
flagTables = { mastertranslations.fullName, translationsmaster.fullName, }
for k,v in ipairs(flagTables) do
for englishflagParameter,localecommonsFile in pairs(v) do
if territory.args[1]flagParameter == locale or territory.args[1] == english then
commonsName = englishcommonsFile
link = locale flagParameter
elseif commonsFile == territory.args[1] then
commonsName = commonsFile
link = flagParameter
end
end