Localize secret stash part names (#11724)

This commit is contained in:
Morb
2022-10-09 22:24:07 +03:00
committed by GitHub
parent 2f6175de32
commit c6e9ff8119
5 changed files with 13 additions and 4 deletions

View File

@@ -15,6 +15,8 @@ namespace Content.Server.Storage.Components
[Access(typeof(SecretStashSystem))] [Access(typeof(SecretStashSystem))]
public sealed class SecretStashComponent : Component public sealed class SecretStashComponent : Component
{ {
private string _secretPartName = string.Empty;
/// <summary> /// <summary>
/// Max item size that can be fitted into secret stash. /// Max item size that can be fitted into secret stash.
/// </summary> /// </summary>
@@ -26,7 +28,11 @@ namespace Content.Server.Storage.Components
/// If empty string, will replace it with entity name in init. /// If empty string, will replace it with entity name in init.
/// </summary> /// </summary>
[ViewVariables] [DataField("secretPartName")] [ViewVariables] [DataField("secretPartName")]
public string SecretPartName = ""; public string SecretPartName
{
get => _secretPartName;
set => _secretPartName = Loc.GetString(value);
}
/// <summary> /// <summary>
/// Container used to keep secret stash item. /// Container used to keep secret stash item.

View File

@@ -25,7 +25,7 @@ namespace Content.Server.Storage.EntitySystems
private void OnInit(EntityUid uid, SecretStashComponent component, ComponentInit args) private void OnInit(EntityUid uid, SecretStashComponent component, ComponentInit args)
{ {
// set default secret part name // set default secret part name
if (component.SecretPartName == "") if (component.SecretPartName == string.Empty)
{ {
var meta = EntityManager.GetComponent<MetaDataComponent>(uid); var meta = EntityManager.GetComponent<MetaDataComponent>(uid);
var entityName = Loc.GetString("comp-secret-stash-secret-part-name", ("name", meta.EntityName)); var entityName = Loc.GetString("comp-secret-stash-secret-part-name", ("name", meta.EntityName));

View File

@@ -5,3 +5,6 @@ comp-secret-stash-action-hide-success = You hide {$item} in { $this }
comp-secret-stash-action-hide-container-not-empty = There's already something in here?! comp-secret-stash-action-hide-container-not-empty = There's already something in here?!
comp-secret-stash-action-hide-item-too-big = {$item} is too big to fit in {$stash}! comp-secret-stash-action-hide-item-too-big = {$item} is too big to fit in {$stash}!
comp-secret-stash-action-get-item-found-something = There was something inside {$stash}! comp-secret-stash-action-get-item-found-something = There was something inside {$stash}!
secret-stash-part-plant = the plant
secret-stash-part-toilet = the toilet cistern

View File

@@ -25,7 +25,7 @@
noRot: true noRot: true
- type: PottedPlantHide - type: PottedPlantHide
- type: SecretStash - type: SecretStash
secretPartName: the plant secretPartName: secret-stash-part-plant
- type: ContainerContainer - type: ContainerContainer
containers: containers:
stash: !type:ContainerSlot {} stash: !type:ContainerSlot {}

View File

@@ -17,7 +17,7 @@
netsync: false netsync: false
- type: Toilet - type: Toilet
- type: SecretStash - type: SecretStash
secretPartName: the toilet cistern secretPartName: secret-stash-part-toilet
- type: ContainerContainer - type: ContainerContainer
containers: containers:
stash: !type:ContainerSlot {} stash: !type:ContainerSlot {}