Skip to content
Help:Lingua Functions

Contents

Overview

Lingua has a set of functions and special variable:
Function/Variable Comment Example
Arguments Get the associative array (key/value pairs) for the arguments to the template. You may modify this result. This can be useful to rename template argument names, but remain compatible with existing callers. Arguments["NewName"] = Arguments["OldName"]

String functions

Length(text)

Interprets arg as a string

Substring()

Print(text)

Display(text)

same as print

Collection functions

Count(collection)

Date and Time Functions

GetDate()

AddMonths()

AddSeconds()

AddYears()

Now()

UtcNow()

DayOfWeek()

Day()

Hour()

Minute()

Month()

Second()

Year()

Math Functions

Random(number)

Round(number)

RoundUp(number)

Ceiling

RoundDown(number)

floor

Miscellaneous

IsOpen(hourString, checkDate)

is this thing open on checkDate?

GetPageInfo(title)

parse a title into Name, Namespace, Region, Url, and Anchor values (as an assoc array)

GetFunctionList()

get a collection of all of the function names currently known by Lingua. This is useful for docs I hope.

IfNotEmpty(item, a, b)

if item is not empty, return a, else return b. If b isn’t passed, return empty string.

Choose(item,a1,a2,a3...)

Choose the option closest to the numeric value of item. So the “plural” thing is now:
TAGS IN THIS AREA