Modül:Lua banner: Revizyonlar arasındaki fark

İçerik silindi İçerik eklendi
Değişiklik özeti yok
Değişiklik özeti yok
1. satır:
-- This module implements the {{lua}} template.
local yesno = require('ModuleModül:Yesno')
local mList = require('ModuleModül:List')
local mTableTools = require('ModuleModül:TableTools')
local mMessageBox = require('ModuleModül:Message box')
 
local p = {}
28. satır:
function p.renderBox(modules)
local boxArgs = {}
iflocal moduleCount = #modules < 1 then
local moduleText = 'modülünü'
boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
if moduleCount < 1 then
boxArgs.text = '<strong class="error">ErrorHata: noModül modules specifiedbelirtilmedi</strong>'
else
if moduleCount > 1 then moduleText = 'modüllerini' end
local moduleLinks = {}
for i, module in ipairs(modules) do
Satır 38 ⟶ 41:
boxArgs.text = 'Bu ' ..
(mw.title.getCurrentTitle():inNamespaces(828,829) and 'modül' or 'şablon') ..
' şu [[WikipediaVikipedi:Lua|Lua]] ' .. moduleText .. ' kullanıyor:\n yazılımı kullanır' .. moduleList
end
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.image = '[[FileDosya:Lua-logo-nolabel.svg|30px|alt=Lua&#39;nın logosu|link=Vikipedi:Lua]]'
return mMessageBox.main('mbox', boxArgs)
end
Satır 55 ⟶ 58:
-- Error category
if #modules < 1 then
cats[#cats + 1] = 'LuaHata templatesiçeren withLua errorsşablonları'
end
Satır 72 ⟶ 75:
if not category then
local categories = {
['ModuleModül:String'] = 'Lua String-based templatestabanlı şablonlar',
['ModuleModül:Math'] = 'TemplatesMath basedLua onmodülü the Math Luadayalı moduleşablonlar',
['ModuleModül:BaseConvert'] = 'TemplatesBaseConvert basedLua onmodülü the BaseConvert Luadayalı moduleşablonlar',
['ModuleModül:Citation'] = 'Lua-based citationtabanlı templateskaynak şablonları'
}
categories['ModuleModül:Citation/CS1'] = categories['ModuleModül:Citation']
category = modules[1] and categories[modules[1]]
category = category or 'Lua-based templatestabanlı şablonlar'
end
cats[#cats + 1] = category
local protLevels = {
autoconfirmed = 1,
extendedconfirmed = 2,
templateeditor = 3,
sysop = 4
}
local currentProt = titleObj.protectionLevels["edit"][1]
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt < currentProt then
cats[#cats + 1] = "Templates using under-protected Lua modules"
break
end
end
end
for i, cat in ipairs(cats) do
cats[i] = string.format('[[CategoryKategori:%s]]', cat)
end
return table.concat(cats)