From 2769f7a0b22acf6a08d3cbf75ed09909b5141ed1 Mon Sep 17 00:00:00 2001 From: manafeng Date: Fri, 28 Nov 2025 16:23:09 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20DevourClient/Localization/?= =?UTF-8?q?TranslationDict.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DevourClient/Localization/TranslationDict.cs | 154 ------------------- 1 file changed, 154 deletions(-) delete mode 100644 DevourClient/Localization/TranslationDict.cs diff --git a/DevourClient/Localization/TranslationDict.cs b/DevourClient/Localization/TranslationDict.cs deleted file mode 100644 index 627a994..0000000 --- a/DevourClient/Localization/TranslationDict.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System.Collections.Generic; - -namespace DevourClient.Localization -{ - public static class TranslationDict - { - public static bool EnableChineseTranslation { get; set; } = true; - - private static readonly Dictionary ItemTranslations = new Dictionary - { - { "Key", "钥匙" }, - { "Hay", "干草" }, - { "FirstAid", "急救包" }, - { "Battery", "电池" }, - { "Gasoline", "汽油" }, - { "Fuse", "保险丝" }, - { "Food", "食物" }, - { "RottenFood", "腐烂食物" }, - { "Bone", "骨头" }, - { "Bleach", "漂白剂" }, - { "Matchbox", "火柴盒" }, - { "Spade", "铲子" }, - { "Cake", "蛋糕" }, - { "MusicBox", "音乐盒" }, - { "Coin", "硬币" }, - - { "Egg", "鸡蛋" }, - { "Egg-Clean-1", "鸡蛋-1" }, - { "Egg-Clean-2", "鸡蛋-2" }, - { "Egg-Clean-3", "鸡蛋-3" }, - { "Egg-Clean-4", "鸡蛋-4" }, - { "Egg-Clean-5", "鸡蛋-5" }, - { "Egg-Clean-6", "鸡蛋-6" }, - { "Egg-Clean-7", "鸡蛋-7" }, - { "Egg-Clean-8", "鸡蛋-8" }, - { "Egg-Clean-9", "鸡蛋-9" }, - { "Egg-Clean-10", "鸡蛋-10" }, - { "RitualBook", "仪式书" }, - { "DollHead", "玩偶头" }, - { "Head", "头颅" }, - { "CleanHead", "干净的头颅" }, - }; - - private static readonly Dictionary AnimalTranslations = new Dictionary - { - { "Goat", "山羊" }, - { "Rat", "老鼠" }, - { "Pig", "猪" }, - }; - - private static readonly Dictionary EnemyTranslations = new Dictionary - { - { "Azazel", "阿撒泻勒" }, - { "Demon", "恶魔" }, - { "Spider", "蜘蛛" }, - { "Ghost", "鬼魂" }, - { "Boar", "野猪" }, - { "Corpse", "尸体" }, - { "Crow", "乌鸦" }, - { "Lump", "肿块" }, - { "Monkey", "猴子" }, - { "Inmate", "囚犯" }, - - { "AzazelSam", "阿撒泻勒-萨姆" }, - { "AzazelMolly", "阿撒泻勒-莫莉" }, - { "AzazelAnna", "阿撒泻勒-安娜" }, - { "AzazelZara", "阿撒泻勒-扎拉" }, - { "AzazelNathan", "阿撒泻勒-内森" }, - { "AzazelApril", "阿撒泻勒-艾普尔" }, - { "AzazelKai", "阿撒泻勒-凯" }, - }; - - private static readonly Dictionary MapTranslations = new Dictionary - { - { "Devour", "农舍" }, - { "Farmhouse", "农舍" }, - { "Molly", "精神病院" }, - { "Asylum", "精神病院" }, - { "Inn", "旅馆" }, - { "Town", "小镇" }, - { "Slaughterhouse", "屠宰场" }, - { "Manor", "庄园" }, - { "Carnival", "嘉年华" }, - { "Menu", "菜单" }, - }; - - private static readonly Dictionary OtherTranslations = new Dictionary - { - { "Player", "玩家" }, - { "Door", "门" }, - { "Gate", "大门" }, - { "Altar", "祭坛" }, - { "Fountain", "喷泉" }, - { "Mirror", "镜子" }, - { "Cage", "笼子" }, - }; - - public static string Translate(string englishName) - { - if (!EnableChineseTranslation || string.IsNullOrEmpty(englishName)) - { - return englishName; - } - - if (ItemTranslations.TryGetValue(englishName, out string itemTranslation)) - { - return itemTranslation; - } - - if (AnimalTranslations.TryGetValue(englishName, out string animalTranslation)) - { - return animalTranslation; - } - - if (EnemyTranslations.TryGetValue(englishName, out string enemyTranslation)) - { - return enemyTranslation; - } - - if (MapTranslations.TryGetValue(englishName, out string mapTranslation)) - { - return mapTranslation; - } - - if (OtherTranslations.TryGetValue(englishName, out string otherTranslation)) - { - return otherTranslation; - } - - return englishName; - } - - public static void AddCustomTranslations(Dictionary customTranslations) - { - if (customTranslations == null) return; - - foreach (var kvp in customTranslations) - { - if (!ItemTranslations.ContainsKey(kvp.Key)) - { - ItemTranslations.Add(kvp.Key, kvp.Value); - } - } - } - - public static int GetTotalTranslationCount() - { - return ItemTranslations.Count + AnimalTranslations.Count + - EnemyTranslations.Count + MapTranslations.Count + - OtherTranslations.Count; - } - } -} -