Make RandomMetadata properly support localization (#36343)
* Make _outputSegments readonly * Remove mystery character * Use Fluent instead of string concatenation * Adjust format * Convert existing content * Don't need these anymore * Docs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Content.Shared.Dataset;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.RandomMetadata;
|
||||
namespace Content.Server.RandomMetadata;
|
||||
|
||||
/// <summary>
|
||||
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
|
||||
@@ -15,9 +15,17 @@ public sealed partial class RandomMetadataComponent : Component
|
||||
[DataField]
|
||||
public List<ProtoId<LocalizedDatasetPrototype>>? NameSegments;
|
||||
|
||||
/// <summary>
|
||||
/// LocId of the formatting string to use to assemble the <see cref="NameSegments"/> into the entity's name.
|
||||
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string NameSeparator = " ";
|
||||
public LocId NameFormat = "random-metadata-name-format-default";
|
||||
|
||||
/// <summary>
|
||||
/// LocId of the formatting string to use to assemble the <see cref="DescriptionSegments"/> into the entity's description.
|
||||
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public string DescriptionSeparator = " ";
|
||||
public LocId DescriptionFormat = "random-metadata-description-format-default";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user