Contains methods to access or retrieve localization values. The Localization Guideteaches more about localization.
More...
|
static bool | Exists (string key) |
| Checks if a LocalizedText with the provided key has been registered or not. This can be used to avoid retrieving dummy values from GetText(string) and GetTextValue(string) and instead load a fallback value or do other logic. If the key should be created if it doesn't exist, GetOrRegister(string, Func<string>) can be used instead.
Note that modded keys will be registered during mod loading and ModLoader.Mod.SetupContent is the earliest point where all keys should be registered with values loaded for the current language. More...
|
|
static LocalizedText[] | FindAll (LanguageSearchFilter filter) |
| Finds all LocalizedText that satisfy the filter parameter. Typically used with Lang.CreateDialogFilter(string) or Lang.CreateDialogFilter(string, object) as the filter argument to find all LocalizedText that have a specific key prefix and satisfy provided conditions. More...
|
|
static LocalizedText[] | FindAll (Regex regex) |
|
static int | GetCategorySize (string key) |
|
static LocalizedText | GetOrRegister (string key, Func< string > makeDefaultValue=null) |
| Returns a LocalizedText for a given key.
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 LocalizedText | GetOrRegister (Terraria.ModLoader.Mod mod, string key, Func< string > makeDefaultValue=null) |
|
static LocalizedText | GetText (string key) |
| Retrieves a LocalizedText object for a specified localization key. The actual text value can be retrieved from LocalizedText by accessing the LocalizedText.Value property or by using the GetTextValue(string) method directly.
Using LocalizedText instead of string is preferred when the value is stored. If the user switches languages or if resource packs or mods change text, the LocalizedText will automatically receive the new value. In turn, mods using those LocalizedText will also start displaying the updated values.
More...
|
|
static string | GetTextValue (string key) |
| Retrieves the text value for a specified localization key. The text returned will be for the currently selected language. More...
|
|
static string | GetTextValue (string key, object arg0) |
|
static string | GetTextValue (string key, object arg0, object arg1) |
|
static string | GetTextValue (string key, object arg0, object arg1, object arg2) |
|
static string | GetTextValue (string key, params object[] args) |
|
static string | GetTextValueWith (string key, object obj) |
|
static LocalizedText | RandomFromCategory (string categoryName, UnifiedRandom random=null) |
|
static LocalizedText | SelectRandom (LanguageSearchFilter filter, UnifiedRandom random=null) |
| Selects a single random LocalizedText that satisfies the filter parameter. Typically used with Lang.CreateDialogFilter(string) or Lang.CreateDialogFilter(string, object) as the filter argument to find a random LocalizedText that has a specific key prefix and satisfies the provided conditions. More...
|
|
Contains methods to access or retrieve localization values. The Localization Guide
teaches more about localization.