Terraria Wiki
Terraria Wiki
1 577
páginas
Rye Greenwood (discussão | contribs)
(sync :: en revid:920180::)
 
Dinoxel (discussão | contribs)
Sem resumo de edição
Linha 1: Linha 1:
<includeonly>{{#if:{{{nl2br|}}}|{{#invoke:gameText|get|lang={{lang}}}}|{{nl2br|{{#invoke:gameText|get|lang={{lang}}}}}}}}</includeonly><noinclude>{{i18n-ready}}{{lua}}{{doc}}</noinclude>
+
<includeonly>{{#if:{{{nl2br|}}}|{{#invoke:gameText|{{#if:{{{json|}}}|get|query}}|lang={{lang|}}}}|{{nl2br|{{#invoke:gameText|{{#if:{{{json|}}}|get|query}}|lang={{lang|}}}}}}}}</includeonly><noinclude>{{i18n-ready}}{{lua}}{{doc}}</noinclude>

Revisão das 21h57min de 15 de outubro de 2020

Essa predefinição é pronta para i18n, o que significa que ela é simples de localizar para línguas diferentes. Veja I18n & l10n para Predefinições para entender melhor.
Esta predefinição utiliza Lua.
Esta predefinição utiliza Módulo:GameText, um script escrito na linguagem de programação Lua. Para aprender mais sobre Lua, veja Terraria Wiki:Lua (en).
Template-info Documentação A documentação que segue é transcluída de Predefinição:GameText/doc. (editar | histórico)

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>|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.

json

By default, gameText will query text from cargo database. If json is set, it will query from original game language files. This is a bit stable and accurate and supports returning all contents of a string array, at the cost of taking up much more resources.

Examples

Code Result
{{gameText|ItemName.IronPickaxe}} Erro de comando: A função "query" não existe. FAIL! (expected: Iron Pickaxe)
{{gameText|LegacyMultiplayer.21}} Erro de comando: A função "query" não existe. FAIL! (expected: /players)
{{gameText|ItemTooltip.BeeKeeper}} Erro de comando: A função "query" não existe. FAIL! (expected: Summons killer bees after striking your foe
Small chance to cause confusion)
{{gameText|ItemTooltip.BeeKeeper|nl2br=no}} Erro de comando: A função "query" não existe. FAIL! (expected: Summons killer bees after striking your foe

Small chance to cause confusion)

{{gameText|UI.WorldSizeFormat}} Erro de comando: A função "query" não existe. FAIL! (expected: {0} World)
{{gameText|UI.WorldSizeFormat|x_0=Large}} Erro de comando: A função "query" não existe. FAIL! (expected: Large World)
{{gameText|LegacyDialog.19}} Erro de comando: A função "query" não existe. FAIL! (expected: {PlayerName} is it? I've heard good things, friend!)
{{gameText|LegacyDialog.19|x_PlayerName=myName}} Erro de comando: A função "query" não existe. FAIL! (expected: myName is it? I've heard good things, friend!)
{{gameText|Misc.ResolutionChanged}} Erro de comando: A função "query" não existe. FAIL! (expected: Resolution changed to: {0}x{1}.)
{{gameText|Misc.ResolutionChanged|x_1=768}} Erro de comando: A função "query" não existe. FAIL! (expected: Resolution changed to: {0}x768.)
{{gameText|Misc.ResolutionChanged|x_0=1024|x_1=768}} Erro de comando: A função "query" não existe. FAIL! (expected: Resolution changed to: 1024x768.)
{{gameText|ItemTooltip.GoodieBag}} Erro de comando: A função "query" não existe. FAIL! (expected: <right> to open)
{{gameText|ItemTooltip.GoodieBag|y_right=Right click}} Erro de comando: A função "query" não existe. FAIL! (expected: Right click to open)
{{gameText|ItemTooltip.GoodieBag|y_right={{key|open}}}} Erro de comando: A função "query" não existe. FAIL! (expected: Abrir / Ativar to open)
{{gameText|ItemName.IronPickaxe|lang=es}} Erro de comando: A função "query" não existe. FAIL! (expected: Pico de hierro)
{{gameText|ItemName.IronPickaxe|lang=it}} Erro de comando: A função "query" não existe. FAIL! (expected: Piccone di ferro)
{{gameText|ItemName.IronPickaxe|lang=de}} Erro de comando: A função "query" não existe. FAIL! (expected: Eisenspitzhacke)

Data Store

Achievementsenpt
Bestiaryenpt
Buffenpt
CreditsRollCategoryenpt
Emojienpt
ItemNameenpt
ItemName2enpt
ItemName3enpt
ItemTooltipenpt
Legacyenpt
LoadingTipsenpt
NPCNameenpt
Othersenpt
ProjectileNameenpt
RandomWorldNameenpt
TownNPCMoodenpt
TownPetenpt