tModLoader v2024.05
A mod to make and play Terraria mods
ILocalizedModTypeExtensions Class Reference

Static Public Member Functions

static LocalizedText GetLocalization (this ILocalizedModType self, string suffix, Func< string > makeDefaultValue=null)
 Returns a LocalizedText for this piece of content with the provided suffix .
If no existing localization exists for the key, it will be defined so it can be exported to a matching mod localization file. More...
 
static string GetLocalizationKey (this ILocalizedModType self, string suffix)
 Gets a suitable localization key belonging to this piece of content.

Localization keys follow the pattern of "Mods.{ModName}.{Category}.{ContentName}.{DataName}", in this case the suffix corresponds to the DataName. More...
 
static string GetLocalizedValue (this ILocalizedModType self, string suffix)
 Retrieves the text value for a localization key belonging to this piece of content with the given suffix . The text returned will be for the currently selected language. More...
 

Member Function Documentation

◆ GetLocalization()

static LocalizedText ILocalizedModTypeExtensions.GetLocalization ( this ILocalizedModType  self,
string  suffix,
Func< string >  makeDefaultValue = null 
)
static

Returns a LocalizedText for this piece of content with the provided suffix .
If no existing localization exists for the key, it will be defined so it can be exported to a matching mod localization file.

Parameters
self
suffix
makeDefaultValueA factory method for creating the default value, used to update localization files with missing entries
Returns

◆ GetLocalizationKey()

static string ILocalizedModTypeExtensions.GetLocalizationKey ( this ILocalizedModType  self,
string  suffix 
)
static

Gets a suitable localization key belonging to this piece of content.

Localization keys follow the pattern of "Mods.{ModName}.{Category}.{ContentName}.{DataName}", in this case the suffix corresponds to the DataName.

Parameters
self
suffix
Returns

◆ GetLocalizedValue()

static string ILocalizedModTypeExtensions.GetLocalizedValue ( this ILocalizedModType  self,
string  suffix 
)
static

Retrieves the text value for a localization key belonging to this piece of content with the given suffix . The text returned will be for the currently selected language.

Parameters
self
suffix
Returns