Terraria Wiki

  • Discussions are now available on the Terraria Wiki.
  • Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.

READ MORE

Terraria Wiki
Advertisement
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
This template uses Lua.
This template uses Module:GameText, a script written in the Lua programming language. To learn more about Lua, see Terraria Wiki:Lua.
Template-info 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

{{ gameText | <index key> | lang = <lang> | x_<name> = <value> | ... | y_<name> = <value> | ... | keepnl = y/yes }}

First unnamed parameter

The index key for the text. It is the same as in the in-game language JSON files. See examples below.

lang

Language code, defaults to {{lang}}. Currently, there are nine languages, as in-game: English (en), Spanish (es), Italian (it), Chinese (zh), German (de), Russian (ru), French (fr), Polish (pl), and Portuguese (pt). All other languages will use the English database.

All x_<name> and y_<name> parameters

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

Notes

  • You can use {{#invoke:gameText|getRaw|{{{key|}}}}} to get a raw string from the GameText info database. It also takes lang and replacement arguments. This is mainly for use in other templates.
  • {{gameText}} will keep leading/trailing spaces.
  • {{gameText}} is roughly equal to <span class="gameText">{{nl2br| {{#invoke:gameText | getRaw |{{{key|}}}}} }}</span>, except for the latter will trim leading/trailing spaces.

Examples

Code Result
{{gameText|ItemName.IronPickaxe}} Iron Pickaxe
{{gameText|LegacyMultiplayer.21}} /players
x{{gameText|LegacyMenu.108}}x xZoom In x
{{gameText|ItemTooltip.BeeKeeper}} 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|UI.LightMode_Color}} Lighting: Color
{{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}}}}  Interact to open
{{gameText|ItemName.IronPickaxe|lang=es}} Iron Pickaxe FAIL! (expected: Pico de hierro)
{{gameText|ItemName.IronPickaxe|lang=it}} Piccone di ferro
{{gameText|ItemName.IronPickaxe|lang=de}} Eisenspitzhacke
{{gameText|ItemName.IronPickaxe|lang=ru}} Железная кирка
{{#lstsep:{{gameText|TownNPCHousingFailureReasons|json=y}}|₪|<br/>}} Lua error in Module:GameText at line 65: bad argument #1 to 'gsub' (string expected, got table).


Data storage

Advertisement