« Module:Langue » : différence entre les versions

Contenu supprimé Contenu ajouté
Od1n (discussion | contributions)
m retire espaces insécables qui pourrissent les diffs lors de copier-collers
Od1n (discussion | contributions)
n'était pas fonctionnel, car si frame est falsy, l'accès à frame.getParent en amont produit une erreur
Ligne 151 :
-- dir : direction de la langue (obsolète : peut être en paramètre 1, avec code en 2 et texte en 3).
function Langue.langue( frame )
local args = ( frame.getParent and frame:getParent().args ) or frame or { } -- préparation pour appel par modèle ou direct.
local code = mw.ustring.lower( mw.text.trim( args[1] or '' ) )
local texte = args.texte or ''
Ligne 246 :
-- dir : direction de la langue.
function Langue.indicationDeLangue( frame )
local args = ( frame.getParent and frame:getParent().args ) or frame or { }
local nomLangue = args[1] or ''
local code = args.langue or mw.text.trim( args[2] or '' )
Ligne 362 :
-- dir : direction de la langue.
function Langue.langueAvecNom( frame )
local args = ( frame.getParent and frame:getParent().args ) or frame or { }
local code = mw.ustring.lower( mw.text.trim( args [1] or '') )
local texte = args.texte or args[2] or ''