Módulo:BibRules: mudanças entre as edições

sem sumário de edição
imported>Jaideraf
Sem resumo de edição
imported>Jaideraf
Sem resumo de edição
end
-- Se existe o campo 041, mostra "(traduzido do... )" na mesma linha do idioma presente no 008
testlocal f041existance = frame:expandTemplate {title = "Exist", args = {"041", target}} or ""
if testf041existance ~= "" then
test = mw.text.trim ( frame:expandTemplate {title = "Field data string", args = {"041", "0", "1", fullpagename = target}} )
if test == "1" then
end
-- Testa o uso de maiúsculas no campo 041
if testf041existance ~= "" then
test = frame:expandTemplate {title = "Exist", args = {"041", target}} or false
if test ~= "" then
test = mw.text.trim ( frame:expandTemplate {title = "Field data string", args = {"041", "0", "1", fullpagename = target}} )
if test == "#" then
end
end
-- a seguir, testa a relação entre a presença do campo 240 em relação a presença do campo 041 e a presença do subcampo $l -->
testlocal f240existance = frame:expandTemplate {title = "Exist", args = {"041240", target}} or false
if f240existance ~= "" then
local f240 = mw.text.trim( frame:expandTemplate {title = "Field data string", args = {"240", "0", "0", fullpagename = target}} )
if f041existance == "" then
info = "* <strong class='error'>Normalmente, quando há um campo 240, deve haver um campo 041.</strong>"
table.insert(infos, info)
end
local f240l = frame:expandTemplate {title = "Select", args = {"240", "l", target}} or ""
if f240l ~= "" then
if string.match(f240l, "^[a-zA-Z]{3}$") then
info = "* <strong class='error'>É necessário informar o idioma por extenso ($l do campo 240) antecedido por um ponto no subcampo $a.</strong>"
table.insert(infos, info)
end
if not string.match(f240, "\.\s?\$l") then
info = "* <strong class='error'>O subcampo $l do campo 240 necessita ser antecedido por um ponto no subcampo anterior.</strong>"
table.insert(infos, info)
end
else
info = "* <strong class='error'>Normalmente, quando há um campo 240 $a, deve haver também um 240 $l. 240 $l não foi detectado.</strong>"
table.insert(infos, info)
end
if f240:sub(1, 1) == "0" then
info = "* O título uniforme não será exibido."
table.insert(infos, info)
elseif f240:sub(1, 1) == "1" then
info = "* O título uniforme será exibido."
table.insert(infos, info)
elseif f240:sub(1, 1) == "#" then
info = "<strong class='error'>Está faltando o primeiro indicador do campo 240.</strong>"
table.insert(infos, info)
else
info = "* <strong class='error'>O primeiro indicador do campo 240 foi preenchido incorretamente.</strong>"
table.insert(infos, info)
end
if f240:sub(2, 2) == "#" then
info = "* <strong class='error'>Está faltando o segundo indicador do campo 240.</strong>"
table.insert(infos, info)
else
local f240a = mw.text.trim( frame:expandTemplate {title = "Select", args = {"240", "a", target}} )
info = "* O título uniforme será alfabetado como \"" .. ucfirst( f240a:sub( f240:sub(2, 2) + 1 ) ) .. '".'
table.insert(infos, info)
end
end
 
 
end -- end if 245
Usuário anônimo