TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ WithFormatArgs()

LocalizedText Terraria.Localization.LocalizedText.WithFormatArgs ( params object[] args)
inline

Creates a new LocalizedText with the supplied arguments formatted into the value (via M:System.String.Format(System.String,System.Object[]))
Will automatically update to re-format the string with cached args when language changes.

The resulting LocalizedText should be stored statically. Should not be used to create 'throwaway' LocalizedText instances.
Use M:Terraria.Localization.LocalizedText.Format(System.Object[]) instead for repeated on-demand formatting with different args.
The Localization Guideteaches more about using placeholders in localization.

Parameters
argsThe substitution args
Returns

Definition at line 246 of file LocalizedText.cs.

247 {
248 return LanguageManager.Instance.BindFormatArgs(Key, args);
249 }

References Terraria.Localization.LanguageManager.Instance, and Terraria.Localization.LocalizedText.Key.