Add missing localization to verb names (#1953)

This commit is contained in:
DrSmugleaf
2020-08-29 13:36:02 +02:00
committed by GitHub
parent 65a9a09049
commit 5a0f7d9316
14 changed files with 37 additions and 22 deletions

View File

@@ -234,7 +234,10 @@ namespace Content.Server.GameObjects.Components.Chemistry
var heldEntityName = hands.GetActiveHand.Owner?.Prototype?.Name ?? "<Item>"; var heldEntityName = hands.GetActiveHand.Owner?.Prototype?.Name ?? "<Item>";
var myName = component.Owner.Prototype?.Name ?? "<Item>"; var myName = component.Owner.Prototype?.Name ?? "<Item>";
data.Text= $"Transfer liquid from [{heldEntityName}] to [{myName}]."; var locHeldEntityName = Loc.GetString(heldEntityName);
var locMyName = Loc.GetString(myName);
data.Text = Loc.GetString("Transfer liquid from [{0}] to [{1}].", locHeldEntityName, locMyName);
return; return;
} }
@@ -334,7 +337,10 @@ namespace Content.Server.GameObjects.Components.Chemistry
var heldEntityName = hands.GetActiveHand.Owner?.Prototype?.Name ?? "<Item>"; var heldEntityName = hands.GetActiveHand.Owner?.Prototype?.Name ?? "<Item>";
var myName = component.Owner.Prototype?.Name ?? "<Item>"; var myName = component.Owner.Prototype?.Name ?? "<Item>";
data.Text = $"Transfer liquid from [{myName}] to [{heldEntityName}]."; var locHeldEntityName = Loc.GetString(heldEntityName);
var locMyName = Loc.GetString(myName);
data.Text = Loc.GetString("Transfer liquid from [{0}] to [{1}].", locMyName, locHeldEntityName);
return; return;
} }

View File

@@ -294,7 +294,7 @@ namespace Content.Server.GameObjects.Components.Disposal
{ {
protected override void GetData(IEntity user, IDisposalTubeComponent component, VerbData data) protected override void GetData(IEntity user, IDisposalTubeComponent component, VerbData data)
{ {
data.Text = "Tube Directions"; data.Text = Loc.GetString("Tube Directions");
data.CategoryData = VerbCategories.Debug; data.CategoryData = VerbCategories.Debug;
data.Visibility = VerbVisibility.Invisible; data.Visibility = VerbVisibility.Invisible;

View File

@@ -4,6 +4,7 @@ using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Verbs; using Content.Shared.GameObjects.Verbs;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Localization;
namespace Content.Server.GameObjects.Components.Fluids namespace Content.Server.GameObjects.Components.Fluids
{ {
@@ -28,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Fluids
return; return;
} }
data.Text = "Spill liquid"; data.Text = Loc.GetString("Spill liquid");
data.Visibility = solutionComponent.CurrentVolume > ReagentUnit.Zero data.Visibility = solutionComponent.CurrentVolume > ReagentUnit.Zero
? VerbVisibility.Visible ? VerbVisibility.Visible
: VerbVisibility.Disabled; : VerbVisibility.Disabled;

View File

@@ -273,12 +273,12 @@ namespace Content.Server.GameObjects.Components.Interactable
if (component.Cell == null) if (component.Cell == null)
{ {
data.Text = "Eject cell (cell missing)"; data.Text = Loc.GetString("Eject cell (cell missing)");
data.Visibility = VerbVisibility.Disabled; data.Visibility = VerbVisibility.Disabled;
} }
else else
{ {
data.Text = "Eject cell"; data.Text = Loc.GetString("Eject cell");
} }
} }

View File

@@ -428,7 +428,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
return; return;
} }
data.Text = component.Open ? "Close" : "Open"; data.Text = Loc.GetString(component.Open ? "Close" : "Open");
} }
void IExAct.OnExplosion(ExplosionEventArgs eventArgs) void IExAct.OnExplosion(ExplosionEventArgs eventArgs)

View File

@@ -15,6 +15,7 @@ using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Server.GameObjects.Components.Items.Storage namespace Content.Server.GameObjects.Components.Items.Storage
@@ -122,7 +123,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
return; return;
} }
data.Text = "Pick Up"; data.Text = Loc.GetString("Pick Up");
} }
protected override void Activate(IEntity user, ItemComponent component) protected override void Activate(IEntity user, ItemComponent component)

View File

@@ -146,7 +146,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
return; return;
} }
data.Text = component.Locked ? Loc.GetString("Unlock") : Loc.GetString("Lock"); data.Text = Loc.GetString(component.Locked ? "Unlock" : "Lock");
} }
protected override void Activate(IEntity user, SecureEntityStorageComponent component) protected override void Activate(IEntity user, SecureEntityStorageComponent component)

View File

@@ -137,11 +137,13 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
if (component._container.ContainedEntity != null || handsComponent.GetActiveHand == null) if (component._container.ContainedEntity != null || handsComponent.GetActiveHand == null)
{ {
data.Visibility = VerbVisibility.Disabled; data.Visibility = VerbVisibility.Disabled;
data.Text = "Insert"; data.Text = Loc.GetString("Insert");
return; return;
} }
data.Text = $"Insert {handsComponent.GetActiveHand.Owner.Name}"; var heldItemName = Loc.GetString(handsComponent.GetActiveHand.Owner.Name);
data.Text = Loc.GetString("Insert {0}", heldItemName);
} }
protected override void Activate(IEntity user, BaseCharger component) protected override void Activate(IEntity user, BaseCharger component)
@@ -173,12 +175,14 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
} }
if (component._container.ContainedEntity == null) if (component._container.ContainedEntity == null)
{ {
data.Text = "Eject"; data.Text = Loc.GetString("Eject");
data.Visibility = VerbVisibility.Disabled; data.Visibility = VerbVisibility.Disabled;
return; return;
} }
data.Text = $"Eject {component._container.ContainedEntity.Name}"; var containerItemName = Loc.GetString(component._container.ContainedEntity.Name);
data.Text = Loc.GetString("Eject {0}", containerItemName);
} }
protected override void Activate(IEntity user, BaseCharger component) protected override void Activate(IEntity user, BaseCharger component)

View File

@@ -43,7 +43,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
} }
data.CategoryData = VerbCategories.Rotate; data.CategoryData = VerbCategories.Rotate;
data.Text = "Rotate clockwise"; data.Text = Loc.GetString("Rotate clockwise");
data.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.96dpi.png"; data.IconTexture = "/Textures/Interface/VerbIcons/rotate_cw.svg.96dpi.png";
} }
@@ -65,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Rotatable
} }
data.CategoryData = VerbCategories.Rotate; data.CategoryData = VerbCategories.Rotate;
data.Text = "Rotate counter-clockwise"; data.Text = Loc.GetString("Rotate counter-clockwise");
data.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.96dpi.png"; data.IconTexture = "/Textures/Interface/VerbIcons/rotate_ccw.svg.96dpi.png";
} }

View File

@@ -215,7 +215,7 @@ namespace Content.Server.GameObjects.Components.Strap
} }
data.Visibility = VerbVisibility.Visible; data.Visibility = VerbVisibility.Visible;
data.Text = buckle.BuckledTo == null ? Loc.GetString("Buckle") : Loc.GetString("Unbuckle"); data.Text = Loc.GetString(buckle.BuckledTo == null ? "Buckle" : "Unbuckle");
} }
protected override void Activate(IEntity user, StrapComponent component) protected override void Activate(IEntity user, StrapComponent component)

View File

@@ -269,12 +269,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (component.Cell == null) if (component.Cell == null)
{ {
data.Text = "Eject cell (cell missing)"; data.Text = Loc.GetString("Eject cell (cell missing)");
data.Visibility = VerbVisibility.Disabled; data.Visibility = VerbVisibility.Disabled;
} }
else else
{ {
data.Text = "Eject cell"; data.Text = Loc.GetString("Eject cell");
} }
} }

View File

@@ -18,6 +18,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems; using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
@@ -302,12 +303,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
if (component.PowerCell == null) if (component.PowerCell == null)
{ {
data.Text = "Eject cell (cell missing)"; data.Text = Loc.GetString("Eject cell (cell missing)");
data.Visibility = VerbVisibility.Disabled; data.Visibility = VerbVisibility.Disabled;
} }
else else
{ {
data.Text = "Eject cell"; data.Text = Loc.GetString("Eject cell");
} }
} }

View File

@@ -6,6 +6,7 @@ using Robust.Server.Console;
using Robust.Server.Interfaces.GameObjects; using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Server.GlobalVerbs namespace Content.Server.GlobalVerbs
{ {
@@ -35,7 +36,7 @@ namespace Content.Server.GlobalVerbs
if (groupController.CanCommand(player.playerSession, "controlmob")) if (groupController.CanCommand(player.playerSession, "controlmob"))
{ {
data.Visibility = VerbVisibility.Visible; data.Visibility = VerbVisibility.Visible;
data.Text = "Control Mob"; data.Text = Loc.GetString("Control Mob");
data.CategoryData = VerbCategories.Debug; data.CategoryData = VerbCategories.Debug;
} }
} }

View File

@@ -6,6 +6,7 @@ using Robust.Server.Console;
using Robust.Server.Interfaces.GameObjects; using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization;
namespace Content.Server.GlobalVerbs namespace Content.Server.GlobalVerbs
{ {
@@ -20,7 +21,7 @@ namespace Content.Server.GlobalVerbs
public override void GetData(IEntity user, IEntity target, VerbData data) public override void GetData(IEntity user, IEntity target, VerbData data)
{ {
data.Text = "Rejuvenate"; data.Text = Loc.GetString("Rejuvenate");
data.CategoryData = VerbCategories.Debug; data.CategoryData = VerbCategories.Debug;
data.Visibility = VerbVisibility.Invisible; data.Visibility = VerbVisibility.Invisible;