From 70a15dbfed13ea96716a8ade831522be103a5c47 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Thu, 27 Jul 2023 08:14:46 +0200 Subject: [PATCH] Made Letters Translatable, fixes #58 --- CHANGELOG.md | 1 + Common/Languages/English/Keyed/Hive.xml | 7 +++++++ Common/Languages/English/Keyed/Lifeforce.xml | 3 +++ Source/Genes/Hive/Helpers/HiveBirthLogic.cs | 8 +++++--- .../Events/SuccubusVisit/LordJob_SuccubusVisit.cs | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 Common/Languages/English/Keyed/Hive.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 559d8f9..186c315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - New Gene Lifeforce Empath: Gain Lifeforce for sexually satisfied pawns, loose for frustrated pawns. - More genes are configurable with XML, e.g. tick speed, distances or multipliers. I am getting the hang of it. - Halfed Succubus Fertilin-Need, increased cost of abilities. +- Translation Keys for some letters **Fixes:** diff --git a/Common/Languages/English/Keyed/Hive.xml b/Common/Languages/English/Keyed/Hive.xml new file mode 100644 index 0000000..60cff64 --- /dev/null +++ b/Common/Languages/English/Keyed/Hive.xml @@ -0,0 +1,7 @@ + + + + New Queen + A new Queen was born! Make sure to adress inheritance before the new queen reaches adolesence. + + \ No newline at end of file diff --git a/Common/Languages/English/Keyed/Lifeforce.xml b/Common/Languages/English/Keyed/Lifeforce.xml index 5b0520d..9ac9873 100644 --- a/Common/Languages/English/Keyed/Lifeforce.xml +++ b/Common/Languages/English/Keyed/Lifeforce.xml @@ -14,4 +14,7 @@ Dirty dreams The dirty dreams of your colonists have attracted succubi.\n\nThey will hang around for a couple of days trying to seduce your colonists. They may decide to join your colony, if they are impressed by your colonists's sexual prowess. + + Guest Joins + {0} enjoys it here and has decided to stay. \ No newline at end of file diff --git a/Source/Genes/Hive/Helpers/HiveBirthLogic.cs b/Source/Genes/Hive/Helpers/HiveBirthLogic.cs index 9dabac2..a706ea7 100644 --- a/Source/Genes/Hive/Helpers/HiveBirthLogic.cs +++ b/Source/Genes/Hive/Helpers/HiveBirthLogic.cs @@ -1,4 +1,5 @@ using RimWorld; +using rjw; using System; using System.Collections; using System.Collections.Generic; @@ -169,9 +170,10 @@ namespace RJW_Genes { if (bornQueen == null) return; - var letter= LetterMaker.MakeLetter( - "New Queen", "A new Queen was born! Make sure to adress succession before the new queen reaches adolesence.", LetterDefOf.NeutralEvent, bornQueen - ); + var letter = LetterMaker.MakeLetter( + "rjw_genes_queenbirth_letter_label".Translate(), + string.Format("rjw_genes_queenbirth_letter_description".Translate(), xxx.get_pawnname(bornQueen)), + LetterDefOf.NeutralEvent, bornQueen); Find.LetterStack.ReceiveLetter(letter); } diff --git a/Source/Genes/Life_Force/Events/SuccubusVisit/LordJob_SuccubusVisit.cs b/Source/Genes/Life_Force/Events/SuccubusVisit/LordJob_SuccubusVisit.cs index f2e9a99..7f3c32b 100644 --- a/Source/Genes/Life_Force/Events/SuccubusVisit/LordJob_SuccubusVisit.cs +++ b/Source/Genes/Life_Force/Events/SuccubusVisit/LordJob_SuccubusVisit.cs @@ -85,7 +85,7 @@ namespace RJW_Genes if(colonyJoiners.Contains(pawn)) { RecruitUtility.Recruit(pawn, Faction.OfPlayer); - Find.LetterStack.ReceiveLetter("Guest Joins", string.Format("{0} enjoys it here and has decided to stay", xxx.get_pawnname(pawn)), LetterDefOf.PositiveEvent, pawn, null, null, null, null); + Find.LetterStack.ReceiveLetter("rjw_genes_succubus_joins_letter_label".Translate(), string.Format("rjw_genes_succubus_joins_letter_description".Translate(), xxx.get_pawnname(pawn)), LetterDefOf.PositiveEvent, pawn, null, null, null, null); } else {