Move hard-coded gender pronouns from TextManager to Texts.xml
This commit is contained in:
@@ -85,6 +85,14 @@
|
|||||||
<DeleteDialogQuestion>Are you sure you want to delete "[file]"?</DeleteDialogQuestion>
|
<DeleteDialogQuestion>Are you sure you want to delete "[file]"?</DeleteDialogQuestion>
|
||||||
<DeleteFileError>Could not delete file "[file]"!</DeleteFileError>
|
<DeleteFileError>Could not delete file "[file]"!</DeleteFileError>
|
||||||
|
|
||||||
|
<!-- Pronouns -->
|
||||||
|
<PronounMale>He</PronounMale>
|
||||||
|
<PronounPossessiveMale>His</PronounPossessiveMale>
|
||||||
|
<PronounReflexiveMale>Himself</PronounReflexiveMale>
|
||||||
|
<PronounFemale>She</PronounFemale>
|
||||||
|
<PronounPossessiveFemale>Her</PronounPossessiveFemale>
|
||||||
|
<PronounReflexiveFemale>Herself</PronounReflexiveFemale>
|
||||||
|
|
||||||
<!-- Mission info -->
|
<!-- Mission info -->
|
||||||
<NoMission>No mission</NoMission>
|
<NoMission>No mission</NoMission>
|
||||||
<MissionReward>Reward: [reward]</MissionReward>
|
<MissionReward>Reward: [reward]</MissionReward>
|
||||||
@@ -243,12 +251,12 @@
|
|||||||
<TraitorMoreAgentsMessage>It is possible that there are other agents on this submarine. You don't know their names, but you do have a method of communication. Use the code words to greet the agent and code response to respond. Disguise such words in a normal-looking phrase so the crew doesn't suspect anything.\n\nThe code words are: [codewords].\nThe code response is: [coderesponse].</TraitorMoreAgentsMessage>
|
<TraitorMoreAgentsMessage>It is possible that there are other agents on this submarine. You don't know their names, but you do have a method of communication. Use the code words to greet the agent and code response to respond. Disguise such words in a normal-looking phrase so the crew doesn't suspect anything.\n\nThe code words are: [codewords].\nThe code response is: [coderesponse].</TraitorMoreAgentsMessage>
|
||||||
<TraitorStartMessageServer>[traitorname] is the traitor and the target is [targetname].</TraitorStartMessageServer>
|
<TraitorStartMessageServer>[traitorname] is the traitor and the target is [targetname].</TraitorStartMessageServer>
|
||||||
|
|
||||||
<TraitorEndMessageSuccess>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname]. The task was successful.</TraitorEndMessageSuccess>
|
<TraitorEndMessageSuccess>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task was successful.</TraitorEndMessageSuccess>
|
||||||
<TraitorEndMessageSuccessTraitorDead>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname]. The task was successful, but the traitor did not make it out alive either.</TraitorEndMessageSuccessTraitorDead>
|
<TraitorEndMessageSuccessTraitorDead>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task was successful, but the traitor did not make it out alive either.</TraitorEndMessageSuccessTraitorDead>
|
||||||
<TraitorEndMessageSuccessTraitorDetained>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname]. The task was successful, but the traitor was succesfully detained.</TraitorEndMessageSuccessTraitorDetained>
|
<TraitorEndMessageSuccessTraitorDetained>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task was successful, but the traitor was succesfully detained.</TraitorEndMessageSuccessTraitorDetained>
|
||||||
<TraitorEndMessageFailure>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname]. The task was unsuccessful.</TraitorEndMessageFailure>
|
<TraitorEndMessageFailure>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task was unsuccessful.</TraitorEndMessageFailure>
|
||||||
<TraitorEndMessageFailureTraitorDead>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname], but [gendernoun] got [gendernounreflexive] killed before completing it.</TraitorEndMessageFailureTraitorDead>
|
<TraitorEndMessageFailureTraitorDead>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname], but [genderpronoun] got [genderpronounreflexive] killed before completing it.</TraitorEndMessageFailureTraitorDead>
|
||||||
<TraitorEndMessageFailureTraitorDetained>[traitorname] was a traitor! [Gendernounpossessive] task was to assassinate [targetname]. The task failed - [gendernoun] was successfully detained.</TraitorEndMessageFailureTraitorDetained>
|
<TraitorEndMessageFailureTraitorDetained>[traitorname] was a traitor! [Genderpronounpossessive] task was to assassinate [targetname]. The task failed - [genderpronoun] was successfully detained.</TraitorEndMessageFailureTraitorDetained>
|
||||||
|
|
||||||
<!-- Causes of death -->
|
<!-- Causes of death -->
|
||||||
<CauseOfDeath.Damage>Succumbed to their injuries</CauseOfDeath.Damage>
|
<CauseOfDeath.Damage>Succumbed to their injuries</CauseOfDeath.Damage>
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
endMessage += (TextManager.ReplaceGenderNouns(TextManager.Get(messageTag), traitorCharacter.Info.Gender) + "\n")
|
endMessage += (TextManager.ReplaceGenderPronouns(TextManager.Get(messageTag), traitorCharacter.Info.Gender) + "\n")
|
||||||
.Replace("[traitorname]", traitorCharacter.Name)
|
.Replace("[traitorname]", traitorCharacter.Name)
|
||||||
.Replace("[targetname]", targetCharacter.Name);
|
.Replace("[targetname]", targetCharacter.Name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,26 +57,36 @@ namespace Barotrauma
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ReplaceGenderNouns(string text, Gender gender)
|
public static string ReplaceGenderPronouns(string text, Gender gender)
|
||||||
{
|
{
|
||||||
if (gender == Gender.Male)
|
if (gender == Gender.Male)
|
||||||
{
|
{
|
||||||
return text.Replace("[gendernoun]", "he")
|
return text.Replace("[genderpronoun]", Get("PronounMale").ToLower())
|
||||||
.Replace("[gendernounpossessive]", "his")
|
.Replace("[genderpronounpossessive]", Get("PronounPossessiveMale").ToLower())
|
||||||
.Replace("[gendernounreflexive]", "himself")
|
.Replace("[genderpronounreflexive]", Get("PronounReflexiveMale").ToLower())
|
||||||
.Replace("[Gendernoun]", "He")
|
.Replace("[Genderpronoun]", Capitalize(Get("PronounMale")))
|
||||||
.Replace("[Gendernounpossessive]", "His")
|
.Replace("[Genderpronounpossessive]", Capitalize(Get("PronounPossessiveMale")))
|
||||||
.Replace("[Gendernounreflexive]", "Himself");
|
.Replace("[Genderpronounreflexive]", Capitalize(Get("PronounReflexiveMale")));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return text.Replace("[gendernoun]", "she")
|
return text.Replace("[genderpronoun]", Get("PronounFemale").ToLower())
|
||||||
.Replace("[gendernounpossessive]", "her")
|
.Replace("[genderpronounpossessive]", Get("PronounPossessiveFemale").ToLower())
|
||||||
.Replace("[gendernounreflexive]", "herself")
|
.Replace("[genderpronounreflexive]", Get("PronounReflexiveFemale").ToLower())
|
||||||
.Replace("[Gendernoun]", "She")
|
.Replace("[Genderpronoun]", Capitalize(Get("PronounFemale")))
|
||||||
.Replace("[Gendernounpossessive]", "Her")
|
.Replace("[Genderpronounpossessive]", Capitalize(Get("PronounPossessiveFemale")))
|
||||||
.Replace("[Gendernounreflexive]", "Herself");
|
.Replace("[Genderpronounreflexive]", Capitalize(Get("PronounReflexiveFemale")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string Capitalize(string str)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(str))
|
||||||
|
{
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
return char.ToUpper(str[0]) + str.Substring(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user