Modul:Multilingual: Unterschied zwischen den Versionen
+ format|start=
w>PerfektesChaos (update) |
w>PerfektesChaos (+ format|start=) |
||
| Zeile 1: | Zeile 1: | ||
--[=[ 2014-10- | --[=[ 2014-10-16 | ||
Multilingual | Multilingual | ||
]=] | ]=] | ||
| Zeile 91: | Zeile 91: | ||
Multilingual.format = function ( apply, alien, alter, active, alert, | Multilingual.format = function ( apply, alien, alter, active, alert, | ||
frame, assembly, adjacent ) | frame, assembly, adjacent, ahead ) | ||
-- Format one or more languages | -- Format one or more languages | ||
-- Precondition: | -- Precondition: | ||
| Zeile 106: | Zeile 106: | ||
-- assembly -- string with split pattern, if list expected | -- assembly -- string with split pattern, if list expected | ||
-- adjacent -- string with list separator, else assembly | -- adjacent -- string with list separator, else assembly | ||
-- ahead -- string to prepend first element, if any | |||
-- Postcondition: | -- Postcondition: | ||
-- Returns string, or false | -- Returns string, or false | ||
| Zeile 135: | Zeile 136: | ||
end | end | ||
end -- for k, v | end -- for k, v | ||
if r and ahead then | |||
r = ahead .. r | |||
end | |||
else | else | ||
local single = mw.text.trim( apply ) | local single = mw.text.trim( apply ) | ||
| Zeile 382: | Zeile 386: | ||
-- split -- split pattern, if list expected | -- split -- split pattern, if list expected | ||
-- separator -- list separator, else assembly | -- separator -- list separator, else assembly | ||
-- start -- prepend first element, if any | |||
local r | local r | ||
local link | local link | ||
| Zeile 394: | Zeile 399: | ||
frame, | frame, | ||
frame.args.split, | frame.args.split, | ||
frame.args.separator ) | frame.args.separator, | ||
frame.args.start ) | |||
return r or "" | return r or "" | ||
end -- p.format | end -- p.format | ||