« Module:CleTri » : différence entre les versions
De MedFilm PPRD
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| Ligne 14 : | Ligne 14 : | ||
local first_word = mw.text.split(frame.args[1], "[_ ']") | local first_word = mw.text.split(frame.args[1], "[_ ']") | ||
return | return frame.args[1] | ||
-- return mw.text.split(frame.args[1], '[_ ]')[1] | -- return mw.text.split(frame.args[1], '[_ ]')[1] | ||
end | end | ||
Version du 25 mars 2025 à 13:09
La documentation pour ce module peut être créée à Module:CleTri/doc
local p = {}
local dict = {"le","la","les","l","die","the"}
function p.translate(pn)
if dict[pn] then
return("Oui")
end
return pn
end
function p.fw(frame)
local first_word = mw.text.split(frame.args[1], "[_ ']")
return frame.args[1]
-- return mw.text.split(frame.args[1], '[_ ]')[1]
end
function p.nom(frame)
local tpn = mw.text.split(frame.args[1], '[_ ]')
return(tpn[#tpn])
end
function p.transl(frame)
-- pn = string.gsub(frame.args[1], '^%s*(.-)%s*$', '%1')
pn = frame.args[1]
if dict[pn] then
return '[[' .. pn .. '|' .. dict[pn] .. ']]'
end
return '[[' .. pn .. ']]'
end
function p.translNoLink(frame)
-- pn = string.gsub(frame.args[1], '^%s*(.-)%s*$', '%1')
pn = frame.args[1]
if dict[pn] then
return dict[pn]
end
return pn
end
return p

