删除 DevourClient/Localization/TranslationDict.cs

This commit is contained in:
2025-11-28 16:23:09 +00:00
parent 91cb5aee54
commit 2769f7a0b2

View File

@@ -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<string, string> ItemTranslations = new Dictionary<string, string>
{
{ "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<string, string> AnimalTranslations = new Dictionary<string, string>
{
{ "Goat", "山羊" },
{ "Rat", "老鼠" },
{ "Pig", "猪" },
};
private static readonly Dictionary<string, string> EnemyTranslations = new Dictionary<string, string>
{
{ "Azazel", "阿撒泻勒" },
{ "Demon", "恶魔" },
{ "Spider", "蜘蛛" },
{ "Ghost", "鬼魂" },
{ "Boar", "野猪" },
{ "Corpse", "尸体" },
{ "Crow", "乌鸦" },
{ "Lump", "肿块" },
{ "Monkey", "猴子" },
{ "Inmate", "囚犯" },
{ "AzazelSam", "阿撒泻勒-萨姆" },
{ "AzazelMolly", "阿撒泻勒-莫莉" },
{ "AzazelAnna", "阿撒泻勒-安娜" },
{ "AzazelZara", "阿撒泻勒-扎拉" },
{ "AzazelNathan", "阿撒泻勒-内森" },
{ "AzazelApril", "阿撒泻勒-艾普尔" },
{ "AzazelKai", "阿撒泻勒-凯" },
};
private static readonly Dictionary<string, string> MapTranslations = new Dictionary<string, string>
{
{ "Devour", "农舍" },
{ "Farmhouse", "农舍" },
{ "Molly", "精神病院" },
{ "Asylum", "精神病院" },
{ "Inn", "旅馆" },
{ "Town", "小镇" },
{ "Slaughterhouse", "屠宰场" },
{ "Manor", "庄园" },
{ "Carnival", "嘉年华" },
{ "Menu", "菜单" },
};
private static readonly Dictionary<string, string> OtherTranslations = new Dictionary<string, string>
{
{ "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<string, string> 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;
}
}
}