tModLoader v0.11.8.9
A mod to make and play Terraria mods
Terraria.ModLoader.ModTranslation Class Reference
+ Collaboration diagram for Terraria.ModLoader.ModTranslation:

Public Member Functions

void AddTranslation (GameCulture culture, string value)
 
void AddTranslation (int culture, string value)
 
void AddTranslation (string culture, string value)
 
string GetDefault ()
 
string GetTranslation (GameCulture culture)
 
string GetTranslation (int culture)
 
string GetTranslation (string culture)
 
bool IsDefault ()
 
void SetDefault (string value)
 

Public Attributes

readonly string Key
 

Private Attributes

Dictionary< int, string > translations
 

Static Private Attributes

const int fallback = 1
 

Detailed Description

Definition at line 7 of file ModTranslation.cs.

Member Function Documentation

◆ AddTranslation() [1/3]

void Terraria.ModLoader.ModTranslation.AddTranslation ( GameCulture  culture,
string  value 
)

Definition at line 33 of file ModTranslation.cs.

33 {
34 AddTranslation(culture.LegacyId, value);
35 }
void AddTranslation(int culture, string value)

References Terraria.ModLoader.ModTranslation.AddTranslation().

+ Here is the call graph for this function:

◆ AddTranslation() [2/3]

void Terraria.ModLoader.ModTranslation.AddTranslation ( int  culture,
string  value 
)

Definition at line 25 of file ModTranslation.cs.

25 {
26 translations[culture] = value;
27 }
Dictionary< int, string > translations

References Terraria.ModLoader.ModTranslation.translations.

Referenced by Terraria.ModLoader.ModTranslation.AddTranslation(), Terraria.ModLoader.Mod.AutoloadLocalization(), and Terraria.ModLoader.ModTranslation.SetDefault().

+ Here is the caller graph for this function:

◆ AddTranslation() [3/3]

void Terraria.ModLoader.ModTranslation.AddTranslation ( string  culture,
string  value 
)

Definition at line 29 of file ModTranslation.cs.

29 {
30 AddTranslation(GameCulture.FromName(culture).LegacyId, value);
31 }

References Terraria.ModLoader.ModTranslation.AddTranslation().

+ Here is the call graph for this function:

◆ GetDefault()

string Terraria.ModLoader.ModTranslation.GetDefault ( )

Definition at line 41 of file ModTranslation.cs.

41 {
43 }
string GetTranslation(int culture)

References Terraria.ModLoader.ModTranslation.fallback, and Terraria.ModLoader.ModTranslation.GetTranslation().

+ Here is the call graph for this function:

◆ GetTranslation() [1/3]

string Terraria.ModLoader.ModTranslation.GetTranslation ( GameCulture  culture)

Definition at line 56 of file ModTranslation.cs.

56 {
57 return GetTranslation(culture.LegacyId);
58 }

References Terraria.ModLoader.ModTranslation.GetTranslation().

+ Here is the call graph for this function:

◆ GetTranslation() [2/3]

string Terraria.ModLoader.ModTranslation.GetTranslation ( int  culture)

Definition at line 45 of file ModTranslation.cs.

45 {
46 if (translations.ContainsKey(culture)) {
47 return translations[culture];
48 }
49 return translations[fallback];
50 }

References Terraria.ModLoader.ModTranslation.fallback, and Terraria.ModLoader.ModTranslation.translations.

Referenced by Terraria.ModLoader.ModTranslation.GetDefault(), Terraria.ModLoader.ModTranslation.GetTranslation(), and Terraria.ModLoader.ModContent.RefreshModLanguage().

+ Here is the caller graph for this function:

◆ GetTranslation() [3/3]

string Terraria.ModLoader.ModTranslation.GetTranslation ( string  culture)

Definition at line 52 of file ModTranslation.cs.

52 {
53 return GetTranslation(GameCulture.FromName(culture).LegacyId);
54 }

References Terraria.ModLoader.ModTranslation.GetTranslation().

+ Here is the call graph for this function:

◆ IsDefault()

◆ SetDefault()

void Terraria.ModLoader.ModTranslation.SetDefault ( string  value)

Member Data Documentation

◆ fallback

◆ Key

readonly string Terraria.ModLoader.ModTranslation.Key

◆ translations

Dictionary<int, string> Terraria.ModLoader.ModTranslation.translations
private