Owl.png Wiki reading hard on the eyes? Try out our Dark Theme! Visit the preferences page while logged in and select Hydra Dark. Owl.png

Template:GameText

From Terraria Wiki
Jump to: navigation, search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for Templates to learn more.
Lua logo.svg
This template uses Module:GameText, a script written in the Lua programming language. Please see wikipedia:Lua and mw:Extension:Scribunto to learn more about Lua.
Template-info.svg Documentation The documentation below is transcluded from Template:GameText/doc. (edit | history)

This template is used to retrieve in-game text, based on the game text database which is taken from the source code.

Note: this template is relatively slow, so please use other database templates first, if possible.

Usage[edit source]

{{gameText|<index key>|lang=<lang>|nl2br=no|x_<name>=<value>...|y_<name>=<value>...}}

Unnamed Parameter 1

Index key for text. Same as in-game language JSON files. See examples below.

lang (optional)

Language code. Currently we have 9 languages (as in-game): en/es/it/de/fr/zh/pl/pt/ru. All other lang codes will use en database.

all x_<name> and y_<name> parameters

Replacement for placeholder. There are 2 types of placeholder in the game text: {xxx} and <yyy>, indexed by x_... and y_..., respectively. See examples below.

nl2br

By default, link breaks (\n) in gameText will be replaced with >br/<. If nl2br is set, it will output raw text.

Examples[edit source]

Code Result
{{gameText|ItemName.IronPickaxe}} Iron Pickaxe
{{gameText|LegacyMultiplayer.21}} /players
{{gameText|ItemTooltip.BeeKeeper}} Summons killer bees after striking your foe
Small chance to cause confusion
{{gameText|ItemTooltip.BeeKeeper|nl2br=no}} Summons killer bees after striking your foe

Small chance to cause confusion

{{gameText|UI.WorldSizeFormat}} {0} World
{{gameText|UI.WorldSizeFormat|x_0=Large}} Large World
{{gameText|LegacyDialog.19}} {PlayerName} is it? I've heard good things, friend!
{{gameText|LegacyDialog.19|x_PlayerName=myName}} myName is it? I've heard good things, friend!
{{gameText|Misc.ResolutionChanged}} Resolution changed to: {0}x{1}.
{{gameText|Misc.ResolutionChanged|x_1=768}} Resolution changed to: {0}x768.
{{gameText|Misc.ResolutionChanged|x_0=1024|x_1=768}} Resolution changed to: 1024x768.
{{gameText|ItemTooltip.GoodieBag}} <right> to open
{{gameText|ItemTooltip.GoodieBag|y_right=Right click}} Right click to open
{{gameText|ItemTooltip.GoodieBag|y_right={{key|open}}}} Open / Activate to open
{{gameText|ItemName.IronPickaxe|lang=es}} Pico de hierro
{{gameText|ItemName.IronPickaxe|lang=it}} Piccone di ferro
{{gameText|ItemName.IronPickaxe|lang=de}} Eisenspitzhacke