https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AFlags%2Fsandbox
Module:Flags/sandbox - Revision history
2025-05-25T17:31:54Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.2
https://en.wikipedia.org/w/index.php?title=Module:Flags/sandbox&diff=949282913&oldid=prev
Pppery: Pppery moved page Module:Flags/Sandbox to Module:Flags/sandbox without leaving a redirect
2020-04-05T16:16:46Z
<p>Pppery moved page <a href="/w/index.php?title=Module:Flags/Sandbox&action=edit&redlink=1" class="new" title="Module:Flags/Sandbox (page does not exist)">Module:Flags/Sandbox</a> to <a href="/wiki/Module:Flags/sandbox" title="Module:Flags/sandbox">Module:Flags/sandbox</a> without leaving a redirect</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 16:16, 5 April 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Pppery
https://en.wikipedia.org/w/index.php?title=Module:Flags/sandbox&diff=565462682&oldid=prev
QuimGil: Fix in translation variable
2013-07-23T11:23:33Z
<p>Fix in translation variable</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:23, 23 July 2013</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 11:</td>
<td colspan="2" class="diff-lineno">Line 11:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for translation, commonsName in pairs(translations.fullName) do</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> for translation, commonsName in pairs(translations.fullName) do</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if commonsName == name then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if commonsName == name then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> link = <del style="font-weight: bold; text-decoration: none;">tranlastion</del></div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> link = <ins style="font-weight: bold; text-decoration: none;">translation</ins></div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> break --if found break out from the loop</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> break --if found break out from the loop</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td>
</tr>
</table>
QuimGil
https://en.wikipedia.org/w/index.php?title=Module:Flags/sandbox&diff=565366038&oldid=prev
Moroboshi: test upload
2013-07-22T18:45:07Z
<p>test upload</p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
-- Loading the flag translations module --<br />
local translations = mw.loadData("Module:Flags/LocaleData")<br />
local master = mw.loadData("Module:Flags/MasterData")<br />
<br />
-- check if name is an original name in translation.fullname and<br />
-- return its value, otherwise return nil<br />
function check_translation(name)<br />
local link<br />
for translation, commonsName in pairs(translations.fullName) do<br />
if commonsName == name then<br />
link = tranlastion<br />
break --if found break out from the loop<br />
end<br />
end<br />
return link<br />
end<br />
<br />
-- Size of flag --<br />
-- Function to define the default size for the flag if needed<br />
function defaultSize()<br />
--todo: move exception to Module:Flags/MasterData<br />
local sizeExceptions = { "Nepal", "Switzerland", "the Vatican City", }<br />
local size = "20x22px" --initialize with default value<br />
for some,exceptions in pairs(sizeExceptions) do<br />
if commonsName == exceptions then<br />
size = "20x17px"<br />
break --if found break out from loop<br />
end<br />
end<br />
return size<br />
end<br />
<br />
-- Assigning the parameter to a flag and a link<br />
function p.flag(territory)<br />
--always declare local variable, they are more efficient and dont pollute global namespace<br />
local commonsName<br />
local flagOf = "Flag_of_" -- Converts "Flag of" in a variable in order to accept images that don't follow this name schema<br />
local link = ""<br />
-- more efficient to access<br />
local flag_code = territory.args[1] or ""<br />
-- Searching in the master table only.<br />
-- 2 letter code search<br />
if #flag_code == 2 then<br />
-- try to assign a value to commonsName and check for nil value<br />
commonsName = master.twoLetter[flag_code]<br />
--if check_translation return nil then it will execute the or part and assign commonsName to link<br />
if commonsName then link = check_translation(commonsName) or commonsName; end<br />
elseif #flag_code == 3 then -- 3 letter code search<br />
commonsName = master.threeLetter[flag_code]<br />
if commonsName then link = check_translation(commonsName) or commonsName; end<br />
end<br />
-- check if commonsName is still nil<br />
if commonsName == nil then<br />
-- check master.fullName table<br />
commonsName = master.fullName[flag_code]<br />
if commonsName then<br />
link = check_translation(commonsName) or commonsName;<br />
else -- Searching in FlagTranslations<br />
commonsName = translations.fullName[flag_code]<br />
if commonsName then<br />
link = flag_code<br />
else -- Fallback to Commons when the parameter doesn't have an entry in the tables<br />
commonsName = flag_code<br />
link = flag_code<br />
end<br />
end<br />
end<br />
<br />
-- Variant check for historical flags --<br />
local variant = territory.args[3]<br />
if variant and variant ~= "" then<br />
commonsName = master.variant[commonsName .. "|" .. variant]<br />
flagOf=""<br />
end<br />
<br />
-- Label check --<br />
variant = territory.args[2]<br />
if variant and variant ~="{{{2}}}" then<br />
commonsName = master.variant[commonsName .. "|" .. variant]<br />
flagOf=""<br />
end<br />
<br />
-- Digesting Commons flag files not following the format "Flag of "<br />
-- These filenamess must be preceded by "File:" in the table values.<br />
<br />
if commonsName ~= nil and string.find( commonsName, "File:", 1 ) == 1 then<br />
commonsName = string.sub( commonsName, 6)<br />
flagOf=""<br />
end<br />
<br />
-- Fallback for non-identified variant/label flags --<br />
if commonsName == nil then commonsName = "Flag of None" end<br />
<br />
-- Border for everybody except Nepal and Ohio<br />
-- todo: move exception to Module:Flags/MasterData<br />
local border = "border|"<br />
if commonsName == "Nepal" or commonsName == "Ohio" then<br />
border = ""<br />
end<br />
<br />
-- Checking whether a size parameter has been introduced, otherwise set default<br />
if territory.args[4]:find("px", -2) ~= nil then<br />
size = territory.args[4]<br />
else<br />
size = defaultSize(commonsName)<br />
end<br />
<br />
-- Customizing the link<br />
openBrackets = "[["<br />
closeBrackets = "]]"<br />
if territory.args[5] == "" then<br />
flagLink = ""<br />
textLink = ""<br />
openBrackets = ""<br />
closeBrackets = ""<br />
elseif territory.args[5] ~= "{{{link}}}" then<br />
flagLink = territory.args[5]<br />
textLink = territory.args[5] .. "|"<br />
else flagLink = link<br />
textLink = link .. "|"<br />
end<br />
<br />
-- Text in addition to flag<br />
if territory.args[6] == "" then<br />
text = " " .. openBrackets .. link .. closeBrackets<br />
elseif territory.args[6] ~= "{{{text}}}" then<br />
text = " " .. openBrackets .. textLink .. territory.args[6] .. closeBrackets<br />
else text = ""<br />
end<br />
<br />
return '[[File:' .. flagOf .. commonsName .. '.svg|' .. border .. 'link=' .. flagLink .. '|'.. size .. ']]' .. text<br />
end<br />
return p</div>
Moroboshi