diff --git a/NewHorizons/Handlers/TranslationHandler.cs b/NewHorizons/Handlers/TranslationHandler.cs index f2e75075..d8130aa8 100644 --- a/NewHorizons/Handlers/TranslationHandler.cs +++ b/NewHorizons/Handlers/TranslationHandler.cs @@ -57,7 +57,7 @@ namespace NewHorizons.Handlers return translatedText; } // Try without whitespace if its missing - else if (table.TryGetValue(text.TruncateWhitespace(), out translatedText)) + else if (table.TryGetValue(text.TruncateWhitespaceAndToLower(), out translatedText)) { return translatedText; } @@ -99,7 +99,7 @@ namespace NewHorizons.Handlers // Fix new lines in dialogue translations, remove whitespace from keys else if the dialogue has weird whitespace and line breaks it gets really annoying // to write translation keys for (can't just copy paste out of xml, have to start adding \\n and \\r and stuff // If any of these issues become relevant to other dictionaries we can bring this code over, but for now why fix what isnt broke - var key = originalKey.Replace("\\n", "\n").TruncateWhitespace().Replace("<", "<").Replace(">", ">").Replace("", ""); + var key = originalKey.Replace("\\n", "\n").Replace("<", "<").Replace(">", ">").Replace("", "").TruncateWhitespaceAndToLower(); var value = config.DialogueDictionary[originalKey].Replace("\\n", "\n").Replace("<", "<").Replace(">", ">").Replace("", ""); if (!_dialogueTranslationDictionary[language].ContainsKey(key)) _dialogueTranslationDictionary[language].Add(key, value); diff --git a/NewHorizons/Utility/NewHorizonExtensions.cs b/NewHorizons/Utility/NewHorizonExtensions.cs index 1815ed87..9ded956b 100644 --- a/NewHorizons/Utility/NewHorizonExtensions.cs +++ b/NewHorizons/Utility/NewHorizonExtensions.cs @@ -351,7 +351,7 @@ namespace NewHorizons.Utility return parentNode.ChildNodes.Cast().First(node => node.LocalName == tagName); } - public static string TruncateWhitespace(this string text) + public static string TruncateWhitespaceAndToLower(this string text) { // return Regex.Replace(text.Trim(), @"[^\S\r\n]+", "GUH"); return Regex.Replace(text.Trim(), @"\s+", " ").ToLowerInvariant(); diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index fa5ca048..4f8d2554 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Clay, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.19.0", + "version": "1.19.1", "owmlVersion": "2.9.8", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ],