Skip to content

Commit

Permalink
Localization of steal targets (#30153)
Browse files Browse the repository at this point in the history
* Localization of steal targets

* Correction of localization of theft objects

* The second correction of the localization of theft targets

* Update steal-target-groups.ftl

Co-authored-by: Ed <[email protected]>

* Revision of the localization method

* Choosing a simple option for localization

* Fix TechnologyDisk name

* Corrections based on feedback received

* correction of declension

---------

Co-authored-by: Ed <[email protected]>
  • Loading branch information
chavonadelal and TheShuEd committed Sep 16, 2024
1 parent af53d55 commit ccc5f61
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 63 deletions.
9 changes: 5 additions & 4 deletions Content.Server/Objectives/Systems/StealConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ private void OnAssigned(Entity<StealConditionComponent> condition, ref Objective
private void OnAfterAssign(Entity<StealConditionComponent> condition, ref ObjectiveAfterAssignEvent args)
{
var group = _proto.Index(condition.Comp.StealGroup);
string localizedName = Loc.GetString(group.Name);

var title =condition.Comp.OwnerText == null
? Loc.GetString(condition.Comp.ObjectiveNoOwnerText, ("itemName", group.Name))
: Loc.GetString(condition.Comp.ObjectiveText, ("owner", Loc.GetString(condition.Comp.OwnerText)), ("itemName", group.Name));
? Loc.GetString(condition.Comp.ObjectiveNoOwnerText, ("itemName", localizedName))
: Loc.GetString(condition.Comp.ObjectiveText, ("owner", Loc.GetString(condition.Comp.OwnerText)), ("itemName", localizedName));

var description = condition.Comp.CollectionSize > 1
? Loc.GetString(condition.Comp.DescriptionMultiplyText, ("itemName", group.Name), ("count", condition.Comp.CollectionSize))
: Loc.GetString(condition.Comp.DescriptionText, ("itemName", group.Name));
? Loc.GetString(condition.Comp.DescriptionMultiplyText, ("itemName", localizedName), ("count", condition.Comp.CollectionSize))
: Loc.GetString(condition.Comp.DescriptionText, ("itemName", localizedName));

_metaData.SetEntityName(condition.Owner, title, args.Meta);
_metaData.SetEntityDescription(condition.Owner, description, args.Meta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ namespace Content.Shared.Objectives;
public sealed partial class StealTargetGroupPrototype : IPrototype
{
[IdDataField] public string ID { get; private set; } = default!;
[DataField] public string Name { get; private set; } = string.Empty;
[DataField] public LocId Name { get; private set; } = string.Empty;
[DataField] public SpriteSpecifier Sprite { get; private set; } = SpriteSpecifier.Invalid;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Traitor single items
steal-target-groups-hypospray = hypospray
steal-target-groups-handheld-crew-monitor = handheld crew monitor
steal-target-groups-clothing-outer-hardsuit-rd = experimental research hardsuit
steal-target-groups-hand-teleporter = hand teleporter
steal-target-groups-clothing-shoes-boots-mag-adv = advanced magboots
steal-target-groups-box-folder-qm-clipboard = requisition digi-board
steal-target-groups-food-meat-corgi = prime-cut corgi meat
steal-target-groups-captain-id-card = captain ID card
steal-target-groups-jetpack-captain-filled = captain's jetpack
steal-target-groups-weapon-antique-laser = antique laser pistol
steal-target-groups-nuke-disk = nuclear authentication disk
steal-target-groups-weapon-energy-shot-gun = energy shotgun
# Thief Collection
steal-target-groups-figurines = figurine
steal-target-groups-heads-cloaks = head's cloak
steal-target-groups-heads-bedsheets = head's bedsheet
steal-target-groups-stamps = stamp
steal-target-groups-door-remotes = door remote
steal-target-groups-encryption-keys = encryption key
steal-target-groups-technology-disks = technology disk
steal-target-groups-id-cards = ID Card
steal-target-groups-lamps = LAMP
# Thief single item
steal-target-groups-forensic-scanner = forensic scanner
steal-target-groups-flippo-engraved-lighter = detective's Flippo engraved lighter
steal-target-groups-ammo-tech-fab-circuitboard = ammo techfab circuit board
steal-target-groups-clothing-head-hat-warden = warden's cap
steal-target-groups-clothing-outer-hardsuit-void-paramed = paramedic void suit
steal-target-groups-medical-tech-fab-circuitboard = medical techfab machine board
steal-target-groups-clothing-headset-alt-medical = chief medical officer's over-ear headset
steal-target-groups-research-and-development-server-machine-circuitboard = R&D server machine board
steal-target-groups-fire-axe = fireaxe
steal-target-groups-ame-part-flatpack = AME flatpack
steal-target-groups-salvage-expeditions-computer-circuitboard = salvage expeditions computer board
steal-target-groups-cargo-shuttle-console-circuitboard = cargo shuttle console board
steal-target-groups-clothing-eyes-hud-beer = beer goggles
steal-target-groups-bible = bible
steal-target-groups-clothing-neck-goldmedal = gold medal of crewmanship
steal-target-groups-clothing-neck-clownmedal = clown medal
# Thief structures
steal-target-groups-teg = teg generator part
steal-target-groups-freezer-heater = freezer or heater
steal-target-groups-altar-nanotrasen = nanotrasen altar (any)
steal-target-groups-nuclear-bomb = nuclear fission explosive
steal-target-groups-fax-machine-captain = captain long range fax machine
steal-target-groups-chem-dispenser = chemical dispenser
steal-target-groups-xeno-artifact = alien artifact
steal-target-groups-booze-dispenser = booze dispenser
steal-target-groups-plant-rd = "RD's potted plant"
steal-target-groups-toilet-golden-dirty-water = golden toilet
# Thief Animal
steal-target-groups-animal-named-cat = CMO's Cat
steal-target-groups-animal-ian = Ian
steal-target-groups-animal-mc-griff = McGriff
steal-target-groups-animal-walter = Walter
steal-target-groups-animal-morty = Morty
steal-target-groups-animal-renault = Renault
steal-target-groups-animal-shiva = Shiva
steal-target-groups-animal-tropico = Tropico
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/objectives/conditions/steal.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ objective-condition-steal-Ian = head of personnel's corgi
objective-condition-thief-description = The {$itemName} would be a great addition to my collection!
objective-condition-thief-animal-description = The {$itemName} would be a great addition to my collection! Most importantly, alive.
objective-condition-thief-multiply-description = I need to get {$count} {MAKEPLURAL($itemName)} and take them with me.
objective-condition-thief-multiply-description = I need to get {$count} {MAKEPLURAL($itemName)} (any) and take them with me.
Loading

0 comments on commit ccc5f61

Please sign in to comment.