Module:Term/Documentation: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
(Prod-you changed the content model of the page Module:Term/Documentation from "wikitext" to "plain text")
Tag: content model change
(Prod-you changed the content model of the page Module:Term/Documentation from "plain text" to "wikitext")
Tags: content model change Manual revert
 
(No difference)

Latest revision as of 16:21, 17 October 2022

This is the main module for the following templates:

In addition, this module exports the following functions.

FetchTerm

{{#invoke:Term|FetchTerm|page=|game=|plural=}}

Used by Template:Translation/Store to get the raw term without the extra output from Template:Term.

Parameters

ParameterStatus
pagerequired
gameoptional
pluraloptional

Examples

#InputOutput
1
{{#invoke:Term|FetchTerm|page= 2nd Potion|game= Series}}
Red Water of Life
2
{{#invoke:Term|FetchTerm|page= not a page}}

link

link(page, game, options)

Shorthand for printTerm(page, game, { link = true })

Returns

  • A link to a term page.

Examples

#InputOutputResultStatus
3
link("Bubble", nil, nil)
"[[Bubble|Bubble]]"
Bubble
Green check.svg

plural

plural(page, game, options)

Shorthand for printTerm(page, game, { plural = true })

Returns

  • A term in plural form.

Examples

#InputOutputResultStatus
4
plural("Bubble", nil, nil)
'<span class="term">Bubbles</span>'
Bubbles
Green check.svg

pluralLink

pluralLink(page, game, options)

Shorthand for printTerm(page, game, { plural = true, link = true })

Returns

  • A plural link to a term page.

Examples

#InputOutputResultStatus
5
pluralLink("Bubble", nil, nil)
"[[Bubble|Bubbles]]"
Bubbles
Green check.svg

printTerm

printTerm(page, [game], [options])

Parameters

Returns

  • A term with formatting.

Examples

#InputOutputResultStatus
6
printTerm("Dynalfos", "OoT")
'<span class="term">Dinolfos</span>'
Dinolfos
Green check.svg
7
printTerm("Kara Kara Bazaar", "BotW", { link = true })
"[[Kara Kara Bazaar#Breath of the Wild|Kara Kara Bazaar]]"
Kara Kara Bazaar
Green check.svg
8
printTerm(
  "Kara Kara Bazaar",
  "BotW",
  {
    section = "Shaillu's General Store",
    link = true,
  }
)
"[[Kara Kara Bazaar#Shaillu's General Store|Kara Kara Bazaar]]"
Kara Kara Bazaar
Green check.svg
9
printTerm(
  "Kara Kara Bazaar",
  "BotW",
  {
    display = "General Store",
    section = "Shaillu's General Store",
    link = true,
  }
)
"[[Kara Kara Bazaar#Shaillu's General Store|General Store]]"
General Store
Green check.svg
10
printTerm("invalid term")
'<span class="term--invalid"><span title="Invalid or missing term" class="tooltip">[[invalid term]]</span></span>[[Category:Articles with invalid or missing terms]][[Category:The Legend of Zelda Series articles with invalid or missing terms]]'
invalid term
Green check.svg
Checks for redundant display arguments.
11
printTerm("Link", "Series", { display = "Link" })
'<span class="term">Link</span>[[Category:Terms with redundant display arguments]]'
Link
Green check.svg

fetchTerm

fetchTerm(page, [game], [options])

Parameters

Returns

  • The term for the given article and game, or nil if none found.
  • An error category if no term was found.

Examples

#InputOutputStatus
12
fetchTerm("Dynalfos", "OoT")
"Dinolfos"
Green check.svg
nil
Green check.svg
Defaults to series term.
13
fetchTerm("Dinolfos")
"Dynalfos"
Green check.svg
nil
Green check.svg
Defaults to series term when term does not exist for specified game (nor its base game).
14
fetchTerm("Flying Tile", "TPHD")
"Flying Tile"
Green check.svg
nil
Green check.svg
Error when page does store any terms (game specified).
15
fetchTerm("Flippityfloppito", "SS")
nil
Green check.svg
{
  "Articles with invalid or missing terms",
  "Skyward Sword articles with invalid or missing terms",
}
Green check.svg
Error when page does store any terms (no game specified).
16
fetchTerm("Flippityfloppityfloo")
nil
Green check.svg
{
  "Articles with invalid or missing terms",
  "The Legend of Zelda Series articles with invalid or missing terms",
}
Green check.svg
Error when page has wrong casing
17
fetchTerm("captain's hat")
nil
Green check.svg
{
  "Articles with invalid or missing terms",
  "The Legend of Zelda Series articles with invalid or missing terms",
}
Green check.svg
Plural
18
fetchTerm("Bubble", "Series", { plural = true })
"Bubbles"
Green check.svg
nil
Green check.svg
Returns singular when no plural form exists.
19
fetchTerm("A Brother's Roast", "BotW", { plural = true })
"A Brother's Roast"
Green check.svg
{
  "Articles with invalid or missing terms",
  "Breath of the Wild articles with invalid or missing terms",
}
Green check.svg
Returns singular when no plural form exists.
20
fetchTerm(
  "Hestu",
  "HWAoC",
  {
    plural = true,
    allowSingular = true,
  }
)
"Hestu"
Green check.svg
nil
Green check.svg

fetchSubjects

fetchSubjects(term, [game])

See Module:Translation Page for usage.

Parameters

Returns

  • Returns the names of wiki articles that store the given term. If game is specified, the function will only return articles that store the term for that game.

Examples

#InputOutputResult
21
fetchSubjects("Wood")
{"Wood", "Wood (Character)"}
Green check.svg
22
fetchSubjects("Wood", "ST")
{"Wood (Character)"}
Green check.svg
23
fetchSubjects("Link", "MM")
{
  "Link",
  "Link (Goron)",
  "Mr. No Fairy",
  "Professor Link",
}
Green check.svg
24
fetchSubjects("Fooloo Limpah")
{}
Green check.svg