Fix serialization issue in GadgetType.ToTranslatedString

This commit is contained in:
2026-02-26 21:51:38 +08:00
parent 2b9278dd65
commit a1ad7d1de3

View File

@@ -88,7 +88,9 @@ namespace GrasscutterTools.Game.Props
public static string ToTranslatedString(string gadgetType, string language) public static string ToTranslatedString(string gadgetType, string language)
{ {
if (string.IsNullOrEmpty(gadgetType)) gadgetType = "Deprecated"; if (string.IsNullOrEmpty(gadgetType)) gadgetType = "Deprecated";
return language.StartsWith("zh") ? TextMapCHS[gadgetType] : gadgetType; if (language.StartsWith("zh") && TextMapCHS.TryGetValue(gadgetType, out var t))
return t;
return gadgetType;
} }
} }
} }