Modul:Temp: Porovnání verzí
Smazaný obsah Přidaný obsah
oprava vzorů |
refaktorizace |
||
Řádek 145:
return output
local function getEqualityType( a, b )
return "≡"
return "≋"
else▼
return "≢"
end
Řádek 155 ⟶ 166:
return
end
"^(%a%a%a?%-%a%a%-)(.+)$",▼
"^(%a%a%a?%-)(.+)$",▼
"^(Paris%-%-)(.+)$"▼
"^(.+)(%-fr%-Paris)$",▼
"^(.+)( FR%-Paris)$",▼
"^(.+)(%-fr%-ouest)$",▼
local output = ""
Řádek 178 ⟶ 177:
local fileName
local fileExtension
local
local entry
local value
Řádek 184 ⟶ 183:
if file
output = output .. "[[Kategorie:Monitoring:Audio/1/]]"▼
else▼
file = string.gsub( file, "_", " " )
Řádek 190 ⟶ 191:
fileName, fileExtension = string.match( file, "^(.+)%.([^%.]+)$" )
if not fileName then
output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/?/%s]]", file )▼
else▼
local patterns = {
▲ { 2, "^([Ff]r%-Paris%-%-)(.+)$" },
▲ { 2, "^([Ff]r%-)(.+)( FR%-Paris)$" },
▲ { 2, "^([Ff]r%-)(.+)(%-fr%-Paris)$" },
▲ { 2, "^([Ff]r%-)(.+)(%-fr%-ouest)$" },
▲ { 2, "^(%a%a%a?%-%a%a%-)(.+)$" },
}▼
for _, pattern in ipairs(
if
entry = matches[pattern[1]]
valueType = string.format( "%s⌂", lang )▼
matches[pattern[1]] = "⌂"
break
▲ end
end
end
entry = entry and entry or fileName
equalityType = getEqualityType( entry, title )
output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/%s]]", equalityType )▼
▲ if entry == title then
▲ end
output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/⌂.%s]]", fileExtension )
Řádek 225 ⟶ 223:
output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/%s]]", valueType )
end
▲ output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/%s]]", equalityType )
if equalityType == "≢" then
output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/≢ */%s]]", entry )
end
▲ else
▲ output = output .. string.format( "[[Kategorie:Monitoring:Audio/1/?/%s]]", file )
end
▲ else
▲ output = output .. "[[Kategorie:Monitoring:Audio/1/]]"
end
if text
output = output .. "[[Kategorie:Monitoring:Audio/2/]]"▼
value, parentheses = string.match( text, "(.*) %(([^%)]+)%)$" )
if parentheses then
valueType = string.format( "%s (%s)", equalityType, parentheses )
else
▲ elseif mw.ustring.lower( text ) == mw.ustring.lower( title ) then
valueType = string.format( "%s *", equalityType )
end
Řádek 276 ⟶ 254:
output = output .. string.format( "[[Kategorie:Monitoring:Audio/2/≢ */%s]]", text )
end
▲ else
▲ output = output .. "[[Kategorie:Monitoring:Audio/2/]]"
end
|