tModLoader v2022.09
A mod to make and play Terraria mods
Terraria.ModLoader.LocalizationLoader Class Reference

Classes

class  CommentedWscJsonObject
 

Public Member Functions

record LocalizationEntry (string key, string value, string comment, JsonType type=JsonType.String, string legacyKey=null)
 
record LocalizationFileEntry (string path, string prefix, List< LocalizationEntry > LocalizationEntries)
 

Static Public Member Functions

static void AddTranslation (ModTranslation translation)
 Adds a ModTranslation to the game so that you can use Language.GetText to get a LocalizedText.
 
static ModTranslation CreateTranslation (Mod mod, string key)
 Creates a ModTranslation object using the provided mod for a prefix to the key. You can use the resulting object in AddTranslation. More...
 
static ModTranslation CreateTranslation (string key)
 Creates a ModTranslation object using the provided full key. You can use the resulting object in AddTranslation. More...
 
static ModTranslation GetOrCreateTranslation (Mod mod, string key, bool defaultEmpty=false)
 
static ModTranslation GetOrCreateTranslation (string key, bool defaultEmpty=false)
 
static void RefreshModLanguage (GameCulture culture)
 

Member Function Documentation

◆ CreateTranslation() [1/2]

static ModTranslation Terraria.ModLoader.LocalizationLoader.CreateTranslation ( Mod  mod,
string  key 
)
static

Creates a ModTranslation object using the provided mod for a prefix to the key. You can use the resulting object in AddTranslation.

Parameters
modThe mod that this translation is for.
keyThe key for the ModTranslation. The full key will be 'Mods.{mod .Name}.{key }'.

◆ CreateTranslation() [2/2]

static ModTranslation Terraria.ModLoader.LocalizationLoader.CreateTranslation ( string  key)
static

Creates a ModTranslation object using the provided full key. You can use the resulting object in AddTranslation.

Parameters
keyThe full key for the ModTranslation.