From 890e24b60157eab2d9a8eb728dd089a56b4631e9 Mon Sep 17 00:00:00 2001 From: lodicolo Date: Sat, 7 Oct 2023 23:05:27 -0400 Subject: [PATCH] fix: int dict to localedictionary (#1934) * int dict to localedictionary * swap exception for fallback string --- .../Annotations/EditorDictionaryAttribute.cs | 2 +- Intersect.Editor/Localization/Strings.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Intersect (Core)/GameObjects/Annotations/EditorDictionaryAttribute.cs b/Intersect (Core)/GameObjects/Annotations/EditorDictionaryAttribute.cs index 795a9a9308..b74f7b7344 100644 --- a/Intersect (Core)/GameObjects/Annotations/EditorDictionaryAttribute.cs +++ b/Intersect (Core)/GameObjects/Annotations/EditorDictionaryAttribute.cs @@ -64,7 +64,7 @@ public override string Format(Type stringsType, object value) if (!intKeyDictionary.TryGetValue(key, out var localizedString)) { - throw new ArgumentOutOfRangeException($"Key missing: {key}"); + localizedString = $"KEY_MISSING=\"{key}\""; } return localizedString; diff --git a/Intersect.Editor/Localization/Strings.cs b/Intersect.Editor/Localization/Strings.cs index a670790a0d..960aafb814 100644 --- a/Intersect.Editor/Localization/Strings.cs +++ b/Intersect.Editor/Localization/Strings.cs @@ -4121,12 +4121,12 @@ public partial struct MapList public partial struct Mapping { - public static Dictionary InstanceTypes = new Dictionary() + public static LocaleDictionary InstanceTypes = new LocaleDictionary() { - {(int)MapInstanceType.Overworld, @"Overworld"}, - {(int)MapInstanceType.Personal, @"Personal"}, - {(int)MapInstanceType.Guild, @"Guild"}, - {(int)MapInstanceType.Shared, @"Shared"}, + {MapInstanceType.Overworld, @"Overworld"}, + {MapInstanceType.Personal, @"Personal"}, + {MapInstanceType.Guild, @"Guild"}, + {MapInstanceType.Shared, @"Shared"}, }; public static LocalizedString createmap = @"Create new map.";