Module:Bac à sable/Lowercase
Apparence
La documentation de ce module est générée par le modèle {{Documentation module}}.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local p = {}
local dataLangue = mw.loadData( 'Module:Langue/Data' )
local noms = {}
for k, v in pairs( dataLangue ) do
noms[ #noms + 1 ] = v.nom
end
function p.v1( frame )
local args = frame:getParent().args
local texts
if args['data langue'] == 'oui' then
texts = noms
else
texts = { args.text }
end
local uLower = mw.ustring.lower
for i = 1, args.nb do
for j = 1, #texts do
local text = texts[ j ]
uLower( text )
end
end
end
function p.v2( frame )
local args = frame:getParent().args
local texts
if args['data langue'] == 'oui' then
texts = noms
else
texts = { args.text }
end
local uLower = mw.ustring.lower
for i = 1, args.nb do
for j = 1, #texts do
local text = texts[ j ]
if text:find( '[^a-z ]' ) then
uLower( text )
end
end
end
end
return p