Localize alerts (#11838)
This commit is contained in:
@@ -11,6 +11,9 @@ namespace Content.Shared.Alert
|
||||
[Prototype("alert")]
|
||||
public sealed class AlertPrototype : IPrototype, ISerializationHooks
|
||||
{
|
||||
private FormattedMessage _name = new ();
|
||||
private FormattedMessage _description = new ();
|
||||
|
||||
[ViewVariables]
|
||||
string IPrototype.ID => AlertType.ToString();
|
||||
|
||||
@@ -31,13 +34,21 @@ namespace Content.Shared.Alert
|
||||
/// Name to show in tooltip window. Accepts formatting.
|
||||
/// </summary>
|
||||
[DataField("name")]
|
||||
public FormattedMessage Name { get; private set; } = new();
|
||||
public FormattedMessage Name
|
||||
{
|
||||
get => _name;
|
||||
private set => _name = FormattedMessage.FromMarkup(Loc.GetString(value.ToString()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Description to show in tooltip window. Accepts formatting.
|
||||
/// </summary>
|
||||
[DataField("description")]
|
||||
public FormattedMessage Description { get; private set; } = new();
|
||||
public FormattedMessage Description
|
||||
{
|
||||
get => _description;
|
||||
private set => _description = FormattedMessage.FromMarkup(Loc.GetString(value.ToString()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Category the alert belongs to. Only one alert of a given category
|
||||
|
||||
Reference in New Issue
Block a user