From 49397adbc554e3ef8d0b6b33871038bc7fc59633 Mon Sep 17 00:00:00 2001
From: Morb <14136326+Morb0@users.noreply.github.com>
Date: Thu, 1 Sep 2022 05:37:54 +0300
Subject: [PATCH] Localize antag roles (#10638)
---
Content.Shared/Roles/AntagPrototype.cs | 15 ++++++++++++--
.../Locale/en-US/prototypes/roles/antags.ftl | 20 +++++++++++++++++++
.../Antags/Suspicion/suspicion_innocent.yml | 4 ++--
.../Antags/Suspicion/suspicion_traitor.yml | 4 ++--
Resources/Prototypes/Roles/Antags/nukeops.yml | 8 ++++----
Resources/Prototypes/Roles/Antags/traitor.yml | 4 ++--
Resources/Prototypes/Roles/Antags/zombie.yml | 8 ++++----
7 files changed, 47 insertions(+), 16 deletions(-)
create mode 100644 Resources/Locale/en-US/prototypes/roles/antags.ftl
diff --git a/Content.Shared/Roles/AntagPrototype.cs b/Content.Shared/Roles/AntagPrototype.cs
index f64c161c86..470d4897e9 100644
--- a/Content.Shared/Roles/AntagPrototype.cs
+++ b/Content.Shared/Roles/AntagPrototype.cs
@@ -8,6 +8,9 @@ namespace Content.Shared.Roles
[Prototype("antag")]
public sealed class AntagPrototype : IPrototype
{
+ private string _name = string.Empty;
+ private string _objective = string.Empty;
+
[ViewVariables]
[IdDataFieldAttribute]
public string ID { get; } = default!;
@@ -16,13 +19,21 @@ namespace Content.Shared.Roles
/// The name of this antag as displayed to players.
///
[DataField("name")]
- public string Name { get; } = string.Empty;
+ public string Name
+ {
+ get => _name;
+ private set => _name = Loc.GetString(value);
+ }
///
/// The antag's objective, displayed at round-start to the player.
///
[DataField("objective")]
- public string Objective { get; private set; } = string.Empty;
+ public string Objective
+ {
+ get => _objective;
+ private set => _objective = Loc.GetString(value);
+ }
///
/// Whether or not the antag role is one of the bad guys.
diff --git a/Resources/Locale/en-US/prototypes/roles/antags.ftl b/Resources/Locale/en-US/prototypes/roles/antags.ftl
new file mode 100644
index 0000000000..fb3e14d677
--- /dev/null
+++ b/Resources/Locale/en-US/prototypes/roles/antags.ftl
@@ -0,0 +1,20 @@
+roles-antag-syndicate-agent-name = Syndicate agent
+roles-antag-syndicate-agent-objective = Complete your objectives without being caught.
+
+roles-antag-initial-infected-name = Initial Infected
+roles-antag-initial-infected-objective = Once you turn, infect as many other crew members as possible.
+
+roles-antag-zombie-name = Zombie
+roles-antag-zombie-objective = Turn as many humans as possible into zombies.
+
+roles-antag-suspicion-innocent-name = Innocent
+roles-antag-suspicion-innocent-objective = Discover and eliminate all traitors.
+
+roles-antag-suspicion-suspect-name = Suspect
+roles-antag-suspicion-suspect-objective = Kill the innocents.
+
+roles-antag-nuclear-operative-commander-name = Nuclear operative commander
+roles-antag-nuclear-operative-commander-objective = Lead your team to the destruction of the station.
+
+roles-antag-nuclear-operative-name = Nuclear operative
+roles-antag-nuclear-operative-objective = Find the nuke disk and blow up the station.
diff --git a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml
index 810f15088d..9efbb6f6ab 100644
--- a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml
+++ b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_innocent.yml
@@ -1,6 +1,6 @@
- type: antag
id: SuspicionInnocent
- name: "Innocent"
+ name: roles-antag-suspicion-innocent-name
antagonist: false
setPreference: false
- objective: "Discover and eliminate all traitors."
+ objective: roles-antag-suspicion-innocent-objective
diff --git a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml
index c3a13f8524..27e47cacb2 100644
--- a/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml
+++ b/Resources/Prototypes/Roles/Antags/Suspicion/suspicion_traitor.yml
@@ -1,6 +1,6 @@
- type: antag
id: SuspicionTraitor
- name: "Suspect"
+ name: roles-antag-suspicion-suspect-name
antagonist: true
setPreference: true
- objective: "Kill the innocents."
+ objective: roles-antag-suspicion-suspect-objective
diff --git a/Resources/Prototypes/Roles/Antags/nukeops.yml b/Resources/Prototypes/Roles/Antags/nukeops.yml
index 506b7dabec..9dd30256b4 100644
--- a/Resources/Prototypes/Roles/Antags/nukeops.yml
+++ b/Resources/Prototypes/Roles/Antags/nukeops.yml
@@ -1,13 +1,13 @@
- type: antag
id: Nukeops
- name: "Nuclear Operative"
+ name: roles-antag-nuclear-operative-name
antagonist: true
setPreference: true
- objective: "Find the nuke disk and blow up the station."
+ objective: roles-antag-nuclear-operative-objective
- type: antag
id: NukeopsCommander
- name: "Nuclear Operative Commander"
+ name: roles-antag-nuclear-operative-commander-name
antagonist: true
setPreference: true
- objective: "Lead your team to the destruction of the station."
+ objective: roles-antag-nuclear-operative-commander-objective
diff --git a/Resources/Prototypes/Roles/Antags/traitor.yml b/Resources/Prototypes/Roles/Antags/traitor.yml
index ef434537d0..a4e1fe8d10 100644
--- a/Resources/Prototypes/Roles/Antags/traitor.yml
+++ b/Resources/Prototypes/Roles/Antags/traitor.yml
@@ -1,6 +1,6 @@
- type: antag
id: Traitor
- name: "Syndicate Agent"
+ name: roles-antag-syndicate-agent-name
antagonist: true
setPreference: true
- objective: "Complete your objectives without being caught."
+ objective: roles-antag-syndicate-agent-objective
diff --git a/Resources/Prototypes/Roles/Antags/zombie.yml b/Resources/Prototypes/Roles/Antags/zombie.yml
index 3da86c0555..2ba5640891 100644
--- a/Resources/Prototypes/Roles/Antags/zombie.yml
+++ b/Resources/Prototypes/Roles/Antags/zombie.yml
@@ -1,13 +1,13 @@
- type: antag
id: InitialInfected
- name: "Initial Infected"
+ name: roles-antag-initial-infected-name
antagonist: true
setPreference: true
- objective: "Once you turn, infect as many other crew members as possible"
+ objective: roles-antag-initial-infected-objective
- type: antag
id: Zombie
- name: "Zombie"
+ name: roles-antag-zombie-name
antagonist: true
setPreference: false
- objective: "Turn as many humans as possible into zombies."
\ No newline at end of file
+ objective: roles-antag-zombie-objective