Decompiled source of ModSettingsLocalization v1.8.8

plugins\com.github.PEAKModding.PEAKLib.ModConfig.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using MonoDetour;
using PEAKLib.Core;
using PEAKLib.ModConfig.Components;
using PEAKLib.ModConfig.SettingOptions;
using PEAKLib.ModConfig.SettingOptions.SettingUI;
using PEAKLib.UI;
using PEAKLib.UI.Elements;
using TMPro;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Localization;
using UnityEngine.UI;
using Zorro.ControllerSupport;
using Zorro.Core;
using Zorro.Settings;
using Zorro.Settings.DebugUI;
using Zorro.Settings.UI;
using Zorro.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("youxia173")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.8.8.0")]
[assembly: AssemblyInformationalVersion("1.8.8")]
[assembly: AssemblyProduct("ModSettingsLocalization")]
[assembly: AssemblyTitle("ModSettingsLocalization")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.8.8.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace MonoDetour.HookGen
{
	internal static class DefaultMonoDetourManager
	{
		internal static MonoDetourManager Instance { get; } = New();

		internal static MonoDetourManager New()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			return new MonoDetourManager(typeof(DefaultMonoDetourManager).Assembly.GetName().Name);
		}
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
	internal class MonoDetourTargetsAttribute(Type? targetType = null) : Attribute(), IMonoDetourTargets
	{
		public Type? TargetType { get; } = targetType;

		public bool IncludeNestedTypes { get; set; } = true;

		public string[]? Members { get; set; }

		public string[]? MemberNamePrefixes { get; set; }

		public string[]? MemberNameSuffixes { get; set; }

		public bool GenerateControlFlowVariants { get; set; }
	}
}
namespace BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace PEAKLib.ModConfig
{
	internal static class BilingualConfigText
	{
		private static readonly Regex EnLinePrefix = new Regex("^\\s*EN\\s*[::]\\s*", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

		private static readonly Regex ZhLinePrefix = new Regex("^\\s*(?:中文|ZH|CN)\\s*[::]\\s*", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);

		internal static bool LooksBilingual(string? text)
		{
			if (string.IsNullOrWhiteSpace(text))
			{
				return false;
			}
			if (HasTaggedParts(text))
			{
				return true;
			}
			if (HasLatinLetter(text))
			{
				return HasCjk(text);
			}
			return false;
		}

		internal static string Pick(string? text, bool preferChinese)
		{
			if (string.IsNullOrWhiteSpace(text))
			{
				return text ?? string.Empty;
			}
			string text2 = text.Trim();
			if (TryPickTagged(text2, preferChinese, out string picked) && !string.IsNullOrWhiteSpace(picked))
			{
				return picked.Trim();
			}
			if (TryPickInline(text2, preferChinese, out string picked2) && !string.IsNullOrWhiteSpace(picked2))
			{
				return picked2.Trim();
			}
			return text2;
		}

		private static bool HasTaggedParts(string text)
		{
			bool flag = false;
			bool flag2 = false;
			string[] array = SplitLines(text);
			foreach (string input in array)
			{
				if (EnLinePrefix.IsMatch(input))
				{
					flag = true;
				}
				if (ZhLinePrefix.IsMatch(input))
				{
					flag2 = true;
				}
			}
			return flag && flag2;
		}

		private static bool TryPickTagged(string raw, bool preferChinese, out string picked)
		{
			picked = string.Empty;
			StringBuilder stringBuilder = new StringBuilder();
			StringBuilder stringBuilder2 = new StringBuilder();
			int num = 0;
			bool flag = false;
			string[] array = SplitLines(raw);
			foreach (string text in array)
			{
				Match match = EnLinePrefix.Match(text);
				if (match.Success)
				{
					flag = true;
					num = 1;
					AppendChunk(stringBuilder, text.Substring(match.Length));
					continue;
				}
				Match match2 = ZhLinePrefix.Match(text);
				if (match2.Success)
				{
					flag = true;
					num = 2;
					AppendChunk(stringBuilder2, text.Substring(match2.Length));
					continue;
				}
				switch (num)
				{
				case 1:
					AppendChunk(stringBuilder, text);
					break;
				case 2:
					AppendChunk(stringBuilder2, text);
					break;
				}
			}
			if (!flag)
			{
				return false;
			}
			string text2 = stringBuilder.ToString().Trim();
			string text3 = stringBuilder2.ToString().Trim();
			if (preferChinese)
			{
				picked = ((!string.IsNullOrWhiteSpace(text3)) ? text3 : text2);
			}
			else
			{
				picked = ((!string.IsNullOrWhiteSpace(text2)) ? text2 : text3);
			}
			return !string.IsNullOrWhiteSpace(picked);
		}

		private static bool TryPickInline(string raw, bool preferChinese, out string picked)
		{
			picked = string.Empty;
			if (!HasLatinLetter(raw) || !HasCjk(raw))
			{
				return false;
			}
			string text = string.Empty;
			string text2 = raw;
			Match match = Regex.Match(raw, "^(\\d+\\.\\s*)");
			if (match.Success)
			{
				text = match.Groups[1].Value;
				text2 = raw.Substring(match.Length);
			}
			int num = IndexOfCjk(text2);
			if (num <= 0)
			{
				return false;
			}
			string text3 = text2.Substring(0, num).Trim();
			string text4 = text2.Substring(num).Trim();
			if (string.IsNullOrWhiteSpace(text3) || string.IsNullOrWhiteSpace(text4))
			{
				return false;
			}
			picked = (preferChinese ? (text + text4) : (text + text3));
			return true;
		}

		private static void AppendChunk(StringBuilder sb, string chunk)
		{
			if (sb.Length > 0)
			{
				sb.Append('\n');
			}
			sb.Append(chunk.TrimEnd());
		}

		private static string[] SplitLines(string text)
		{
			return text.Replace("\r\n", "\n").Replace('\r', '\n').Split('\n');
		}

		private static bool HasLatinLetter(string text)
		{
			foreach (char c in text)
			{
				if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
				{
					return true;
				}
			}
			return false;
		}

		private static bool HasCjk(string text)
		{
			for (int i = 0; i < text.Length; i++)
			{
				if (IsCjk(text[i]))
				{
					return true;
				}
			}
			return false;
		}

		private static int IndexOfCjk(string text)
		{
			for (int i = 0; i < text.Length; i++)
			{
				if (IsCjk(text[i]))
				{
					return i;
				}
			}
			return -1;
		}

		private static bool IsCjk(char c)
		{
			if (CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.OtherLetter)
			{
				if ((c < '㐀' || c > '鿿') && (c < '豈' || c > '\ufaff') && (c < '\u3040' || c > 'ヿ'))
				{
					if (c >= '가')
					{
						return c <= '\ud7af';
					}
					return false;
				}
				return true;
			}
			if (c >= '一')
			{
				return c <= '鿿';
			}
			return false;
		}
	}
	internal static class BuiltInTranslations
	{
		private static Dictionary<string, Dictionary<string, string>>? _aliases;

		private static Dictionary<string, Dictionary<string, string>>? _sections;

		private static Dictionary<string, Dictionary<string, string>>? _entries;

		private static Dictionary<string, Dictionary<string, string>> Aliases
		{
			get
			{
				object obj = _aliases;
				if (obj == null)
				{
					obj = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase)
					{
						["zh-cn"] = ZhCnAliases,
						["zh-tw"] = ZhTwAliases,
						["fr"] = FrAliases,
						["de"] = DeAliases,
						["it"] = ItAliases,
						["es-es"] = EsAliases,
						["es-latam"] = EsAliases,
						["pt-br"] = PtAliases,
						["ru"] = RuAliases,
						["uk"] = UkAliases,
						["ja"] = JaAliases,
						["ko"] = KoAliases,
						["pl"] = PlAliases,
						["tr"] = TrAliases
					};
					_aliases = (Dictionary<string, Dictionary<string, string>>?)obj;
				}
				return (Dictionary<string, Dictionary<string, string>>)obj;
			}
		}

		private static Dictionary<string, Dictionary<string, string>> Sections
		{
			get
			{
				object obj = _sections;
				if (obj == null)
				{
					obj = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase)
					{
						["zh-cn"] = ZhCnSections,
						["zh-tw"] = ZhTwSections,
						["fr"] = FrSections,
						["de"] = DeSections,
						["it"] = ItSections,
						["es-es"] = EsSections,
						["es-latam"] = EsSections,
						["pt-br"] = PtSections,
						["ru"] = RuSections,
						["uk"] = UkSections,
						["ja"] = JaSections,
						["ko"] = KoSections,
						["pl"] = PlSections,
						["tr"] = TrSections
					};
					_sections = (Dictionary<string, Dictionary<string, string>>?)obj;
				}
				return (Dictionary<string, Dictionary<string, string>>)obj;
			}
		}

		private static Dictionary<string, Dictionary<string, string>> Entries
		{
			get
			{
				object obj = _entries;
				if (obj == null)
				{
					obj = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase)
					{
						["zh-cn"] = ZhCnEntries,
						["zh-tw"] = ZhTwEntries,
						["fr"] = FrEntries,
						["de"] = DeEntries,
						["it"] = ItEntries,
						["es-es"] = EsEntries,
						["es-latam"] = EsEntries,
						["pt-br"] = PtEntries,
						["ru"] = RuEntries,
						["uk"] = UkEntries,
						["ja"] = JaEntries,
						["ko"] = KoEntries,
						["pl"] = PlEntries,
						["tr"] = TrEntries
					};
					_entries = (Dictionary<string, Dictionary<string, string>>?)obj;
				}
				return (Dictionary<string, Dictionary<string, string>>)obj;
			}
		}

		private static Dictionary<string, string> ZhCnAliases => GameInstalledZhPresets.ModAliases;

		private static Dictionary<string, string> ZhTwAliases { get; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
		{
			["Fog Rise Speed Tweaks"] = "迷霧升起速度",
			["Symbiotic Ghost"] = "共生幽靈",
			["Campfire Faerie Aura"] = "營火精靈光環",
			["Campfire Teleport"] = "營火傳送",
			["Carry Rescue Bar Regen"] = "搬運就恢復救援條",
			["Easy Backpack Hold"] = "長按打開背包",
			["Luggage Distance Markers"] = "未開行李箱距離",
			["Stamina Cost Tweaks"] = "體力消耗調整",
			["Status Gain Tweaks"] = "負面狀態增加倍率",
			["Peak Convenient Backpacks"] = "便捷背包減重",
			["PEAK Fast Startup"] = "快速啟動",
			["Item Browser"] = "物品瀏覽器",
			["Item Info Display"] = "物品資訊顯示",
			["PEAK Trails"] = "軌跡追蹤",
			["Peak Stats Ex"] = "狀態統計擴展",
			["Bags For Everyone"] = "人人有背包",
			["Third Person Toggle"] = "第三人稱切換",
			["Eagles Eye"] = "鷹眼縮放",
			["Revive-n-Loot"] = "童子軍像復活撿東西",
			["My Prevision"] = "投擲軌跡預測",
			["Piggyback"] = "背人",
			["Splits Stats"] = "分段計時統計",
			["Peak Rescue Claw Mod"] = "救援爪準星配色",
			["PEAK Quick Resume"] = "營火存檔續玩",
			["Peak Level Select"] = "選關選難度",
			["PEAK Unlimited"] = "無限人數大廳",
			["Photon Ping GUI"] = "延遲顯示",
			["Catch Players"] = "抓住墜落隊友",
			["Simple Unlocker"] = "解鎖全成就外觀",
			["Peak Mod Settings"] = "模組設定",
			["PEAKLib.ModConfig"] = "模組設定",
			["PeakModSettings"] = "模組設定",
			["Blue Claw Crosshair Mod"] = "救援爪準星配色",
			["Rescue Claw Crosshair Mod"] = "救援爪準星配色"
		};

		private static Dictionary<string, string> FrAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Vitesse de brouillard"), ("Symbiotic Ghost", "Fantôme symbiotique"), ("Campfire Faerie Aura", "Aura de fée du feu"), ("Campfire Teleport", "Téléportation au feu"), ("Carry Rescue Bar Regen", "Régénération en portant"), ("Easy Backpack Hold", "Sac à dos maintenu"), ("Luggage Distance Markers", "Distance des bagages"), ("Stamina Cost Tweaks", "Coût d'endurance"), ("Status Gain Tweaks", "Gain de statuts"), ("Peak Convenient Backpacks", "Sacs allégés"), ("PEAK Fast Startup", "Démarrage rapide"), ("Item Browser", "Navigateur d'objets"), ("Item Info Display", "Infos d'objets"), ("PEAK Trails", "Traînées de joueurs"), ("Peak Stats Ex", "Stats étendues"), ("Bags For Everyone", "Sacs pour tous"), ("Third Person Toggle", "Vue à la 3e personne"), ("Eagles Eye", "Œil d'aigle"), ("Revive-n-Loot", "Revive et butin"), ("My Prevision", "Prévision de lancer"), ("Piggyback", "Portage"), ("Splits Stats", "Chrono segments"), ("Peak Rescue Claw Mod", "Viseur griffe"), ("PEAK Quick Resume", "Reprise feu de camp"), ("Peak Level Select", "Choix de niveau"), ("PEAK Unlimited", "Lobby illimité"), ("Photon Ping GUI", "Affichage du ping"), ("Catch Players", "Attraper les joueurs"), ("Simple Unlocker", "Déblocage cosmétique"), ("Peak Mod Settings", "PARAMÈTRES DU MOD"), ("PEAKLib.ModConfig", "PARAMÈTRES DU MOD"), ("PeakModSettings", "PARAMÈTRES DU MOD"), ("Blue Claw Crosshair Mod", "Viseur griffe"), ("Rescue Claw Crosshair Mod", "Viseur griffe"));

		private static Dictionary<string, string> DeAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Nebelansteig"), ("Symbiotic Ghost", "Symbiose-Geist"), ("Campfire Faerie Aura", "Lagerfeuer-Feenaura"), ("Campfire Teleport", "Lagerfeuer-Teleport"), ("Carry Rescue Bar Regen", "Rettungsleiste beim Tragen"), ("Easy Backpack Hold", "Rucksack gedrückt halten"), ("Luggage Distance Markers", "Gepäck-Entfernung"), ("Stamina Cost Tweaks", "Ausdauerkosten"), ("Status Gain Tweaks", "Statuszuwachs"), ("Peak Convenient Backpacks", "Leichtere Rucksäcke"), ("PEAK Fast Startup", "Schneller Start"), ("Item Browser", "Gegenstandsbrowser"), ("Item Info Display", "Gegenstandinfo"), ("PEAK Trails", "Spieler-Spuren"), ("Peak Stats Ex", "Erweiterte Stats"), ("Bags For Everyone", "Rucksäcke für alle"), ("Third Person Toggle", "Dritte Person"), ("Eagles Eye", "Adlerauge"), ("Revive-n-Loot", "Wiederbeleben & Loot"), ("My Prevision", "Wurfvorhersage"), ("Piggyback", "Huckepack"), ("Splits Stats", "Segmentzeiten"), ("Peak Rescue Claw Mod", "Rettungskralle-Visier"), ("PEAK Quick Resume", "Lagerfeuer-Fortsetzung"), ("Peak Level Select", "Levelauswahl"), ("PEAK Unlimited", "Unbegrenzte Lobby"), ("Photon Ping GUI", "Ping-Anzeige"), ("Catch Players", "Spieler fangen"), ("Simple Unlocker", "Kosmetik freischalten"), ("Peak Mod Settings", "MOD-EINSTELLUNGEN"), ("PEAKLib.ModConfig", "MOD-EINSTELLUNGEN"), ("PeakModSettings", "MOD-EINSTELLUNGEN"), ("Blue Claw Crosshair Mod", "Rettungskralle-Visier"), ("Rescue Claw Crosshair Mod", "Rettungskralle-Visier"));

		private static Dictionary<string, string> ItAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Velocità nebbia"), ("Symbiotic Ghost", "Fantasma simbiotico"), ("Campfire Faerie Aura", "Aura fata falò"), ("Campfire Teleport", "Teletrasporto falò"), ("Carry Rescue Bar Regen", "Regen barra soccorso"), ("Easy Backpack Hold", "Zaino tenendo premuto"), ("Luggage Distance Markers", "Distanza bagagli"), ("Stamina Cost Tweaks", "Costo stamina"), ("Status Gain Tweaks", "Guadagno stati"), ("Peak Convenient Backpacks", "Zaini leggeri"), ("PEAK Fast Startup", "Avvio rapido"), ("Item Browser", "Browser oggetti"), ("Item Info Display", "Info oggetti"), ("PEAK Trails", "Scie giocatori"), ("Peak Stats Ex", "Statistiche extra"), ("Bags For Everyone", "Zaini per tutti"), ("Third Person Toggle", "Terza persona"), ("Eagles Eye", "Occhio d'aquila"), ("Revive-n-Loot", "Rianima e loot"), ("My Prevision", "Previsione lancio"), ("Piggyback", "Trasporto"), ("Splits Stats", "Tempi di split"), ("Peak Rescue Claw Mod", "Mirino artiglio"), ("PEAK Quick Resume", "Ripresa falò"), ("Peak Level Select", "Selezione livello"), ("PEAK Unlimited", "Lobby illimitata"), ("Photon Ping GUI", "Mostra ping"), ("Catch Players", "Afferra giocatori"), ("Simple Unlocker", "Sblocca cosmetici"), ("Peak Mod Settings", "IMPOSTAZIONI MOD"), ("PEAKLib.ModConfig", "IMPOSTAZIONI MOD"), ("Blue Claw Crosshair Mod", "Mirino artiglio"), ("Rescue Claw Crosshair Mod", "Mirino artiglio"));

		private static Dictionary<string, string> EsAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Velocidad de niebla"), ("Symbiotic Ghost", "Fantasma simbiótico"), ("Campfire Faerie Aura", "Aura de hada"), ("Campfire Teleport", "Teletransporte a hoguera"), ("Carry Rescue Bar Regen", "Regen al cargar"), ("Easy Backpack Hold", "Mochila manteniendo"), ("Luggage Distance Markers", "Distancia de equipaje"), ("Stamina Cost Tweaks", "Coste de stamina"), ("Status Gain Tweaks", "Ganancia de estados"), ("Peak Convenient Backpacks", "Mochilas ligeras"), ("PEAK Fast Startup", "Inicio rápido"), ("Item Browser", "Explorador de objetos"), ("Item Info Display", "Info de objetos"), ("PEAK Trails", "Rastros de jugadores"), ("Peak Stats Ex", "Estadísticas extra"), ("Bags For Everyone", "Mochilas para todos"), ("Third Person Toggle", "Tercera persona"), ("Eagles Eye", "Ojo de águila"), ("Revive-n-Loot", "Revivir y botín"), ("My Prevision", "Previsión de tiro"), ("Piggyback", "A cuestas"), ("Splits Stats", "Tiempos parciales"), ("Peak Rescue Claw Mod", "Mira de garra"), ("PEAK Quick Resume", "Reanudar hoguera"), ("Peak Level Select", "Seleccionar nivel"), ("PEAK Unlimited", "Lobby ilimitado"), ("Photon Ping GUI", "Mostrar ping"), ("Catch Players", "Atrapar jugadores"), ("Simple Unlocker", "Desbloquear cosméticos"), ("Peak Mod Settings", "AJUSTES DEL MOD"), ("PEAKLib.ModConfig", "AJUSTES DEL MOD"), ("Blue Claw Crosshair Mod", "Mira de garra"), ("Rescue Claw Crosshair Mod", "Mira de garra"));

		private static Dictionary<string, string> PtAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Velocidade da névoa"), ("Symbiotic Ghost", "Fantasma simbiótico"), ("Campfire Faerie Aura", "Aura da fada"), ("Campfire Teleport", "Teleporte à fogueira"), ("Carry Rescue Bar Regen", "Regen ao carregar"), ("Easy Backpack Hold", "Mochila segurando"), ("Luggage Distance Markers", "Distância das bagagens"), ("Stamina Cost Tweaks", "Custo de stamina"), ("Status Gain Tweaks", "Ganho de status"), ("Peak Convenient Backpacks", "Mochilas leves"), ("PEAK Fast Startup", "Início rápido"), ("Item Browser", "Navegador de itens"), ("Item Info Display", "Info de itens"), ("PEAK Trails", "Rastros de jogadores"), ("Peak Stats Ex", "Stats estendidas"), ("Bags For Everyone", "Mochilas para todos"), ("Third Person Toggle", "Terceira pessoa"), ("Eagles Eye", "Olho de águia"), ("Revive-n-Loot", "Reviver e loot"), ("My Prevision", "Previsão de arremesso"), ("Piggyback", "Carregar nas costas"), ("Splits Stats", "Tempos parciais"), ("Peak Rescue Claw Mod", "Mira da garra"), ("PEAK Quick Resume", "Retomar fogueira"), ("Peak Level Select", "Selecionar nível"), ("PEAK Unlimited", "Lobby ilimitado"), ("Photon Ping GUI", "Mostrar ping"), ("Catch Players", "Pegar jogadores"), ("Simple Unlocker", "Desbloquear cosméticos"), ("Peak Mod Settings", "CONFIGURAÇÕES DE MOD"), ("PEAKLib.ModConfig", "CONFIGURAÇÕES DE MOD"), ("Blue Claw Crosshair Mod", "Mira da garra"), ("Rescue Claw Crosshair Mod", "Mira da garra"));

		private static Dictionary<string, string> RuAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Скорость тумана"), ("Symbiotic Ghost", "Симбиотический призрак"), ("Campfire Faerie Aura", "Аура феи у костра"), ("Campfire Teleport", "Телепорт к костру"), ("Carry Rescue Bar Regen", "Восстановление при переноске"), ("Easy Backpack Hold", "Рюкзак удержанием"), ("Luggage Distance Markers", "Дистанция до багажа"), ("Stamina Cost Tweaks", "Расход выносливости"), ("Status Gain Tweaks", "Прирост статусов"), ("Peak Convenient Backpacks", "Лёгкие рюкзаки"), ("PEAK Fast Startup", "Быстрый запуск"), ("Item Browser", "Браузер предметов"), ("Item Info Display", "Инфо предметов"), ("PEAK Trails", "Следы игроков"), ("Peak Stats Ex", "Расширенная статистика"), ("Bags For Everyone", "Рюкзаки всем"), ("Third Person Toggle", "Третье лицо"), ("Eagles Eye", "Орлиный глаз"), ("Revive-n-Loot", "Воскрешение и лут"), ("My Prevision", "Траектория броска"), ("Piggyback", "На спине"), ("Splits Stats", "Сплит-тайминг"), ("Peak Rescue Claw Mod", "Прицел клешни"), ("PEAK Quick Resume", "Продолжение у костра"), ("Peak Level Select", "Выбор уровня"), ("PEAK Unlimited", "Безлимитное лобби"), ("Photon Ping GUI", "Показ пинга"), ("Catch Players", "Ловить игроков"), ("Simple Unlocker", "Разблокировка косметики"), ("Peak Mod Settings", "НАСТРОЙКИ МОДА"), ("PEAKLib.ModConfig", "НАСТРОЙКИ МОДА"), ("Blue Claw Crosshair Mod", "Прицел клешни"), ("Rescue Claw Crosshair Mod", "Прицел клешни"));

		private static Dictionary<string, string> UkAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Швидкість туману"), ("Symbiotic Ghost", "Симбіотичний привид"), ("Campfire Faerie Aura", "Аура феї біля багаття"), ("Campfire Teleport", "Телепорт до багаття"), ("Carry Rescue Bar Regen", "Відновлення при перенесенні"), ("Easy Backpack Hold", "Рюкзак утриманням"), ("Luggage Distance Markers", "Відстань до багажу"), ("Stamina Cost Tweaks", "Витрата витривалості"), ("Status Gain Tweaks", "Приріст статусів"), ("Peak Convenient Backpacks", "Легкі рюкзаки"), ("PEAK Fast Startup", "Швидкий запуск"), ("Item Browser", "Оглядач предметів"), ("Item Info Display", "Інфо предметів"), ("PEAK Trails", "Сліди гравців"), ("Peak Stats Ex", "Розширена статистика"), ("Bags For Everyone", "Рюкзаки всім"), ("Third Person Toggle", "Від третьої особи"), ("Eagles Eye", "Орлине око"), ("Revive-n-Loot", "Воскресіння і лут"), ("My Prevision", "Траєкторія кидка"), ("Piggyback", "На спині"), ("Splits Stats", "Спліт-таймінг"), ("Peak Rescue Claw Mod", "Приціл кігтя"), ("PEAK Quick Resume", "Продовження біля багаття"), ("Peak Level Select", "Вибір рівня"), ("PEAK Unlimited", "Необмежене лобі"), ("Photon Ping GUI", "Показ пінггу"), ("Catch Players", "Ловити гравців"), ("Simple Unlocker", "Розблокування косметики"), ("Peak Mod Settings", "НАЛАШТУВАННЯ МОДА"), ("PEAKLib.ModConfig", "НАЛАШТУВАННЯ МОДА"), ("Blue Claw Crosshair Mod", "Приціл кігтя"), ("Rescue Claw Crosshair Mod", "Приціл кігтя"));

		private static Dictionary<string, string> JaAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "霧の上昇速度"), ("Symbiotic Ghost", "共生ゴースト"), ("Campfire Faerie Aura", "焚き火の妖精オーラ"), ("Campfire Teleport", "焚き火テレポート"), ("Carry Rescue Bar Regen", "搬送中の救助回復"), ("Easy Backpack Hold", "長押しでリュック"), ("Luggage Distance Markers", "荷物までの距離"), ("Stamina Cost Tweaks", "スタミナ消費調整"), ("Status Gain Tweaks", "状態異常増加"), ("Peak Convenient Backpacks", "軽いリュック"), ("PEAK Fast Startup", "高速起動"), ("Item Browser", "アイテムブラウザ"), ("Item Info Display", "アイテム情報"), ("PEAK Trails", "軌跡表示"), ("Peak Stats Ex", "ステータス拡張"), ("Bags For Everyone", "みんなにリュック"), ("Third Person Toggle", "三人称切替"), ("Eagles Eye", "イーグルアイ"), ("Revive-n-Loot", "蘇生とルート"), ("My Prevision", "投擲予測"), ("Piggyback", "おんぶ"), ("Splits Stats", "区間タイム"), ("Peak Rescue Claw Mod", "救助爪クロスヘア"), ("PEAK Quick Resume", "焚き火セーブ再開"), ("Peak Level Select", "ステージ選択"), ("PEAK Unlimited", "人数無制限ロビー"), ("Photon Ping GUI", "Ping表示"), ("Catch Players", "落下プレイヤーを掴む"), ("Simple Unlocker", "実績外見解除"), ("Peak Mod Settings", "MOD設定"), ("PEAKLib.ModConfig", "MOD設定"), ("Blue Claw Crosshair Mod", "救助爪クロスヘア"), ("Rescue Claw Crosshair Mod", "救助爪クロスヘア"));

		private static Dictionary<string, string> KoAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "안개 상승 속도"), ("Symbiotic Ghost", "공생 유령"), ("Campfire Faerie Aura", "모닥불 요정 오라"), ("Campfire Teleport", "모닥불 텔레포트"), ("Carry Rescue Bar Regen", "업고 있을 때 구조 회복"), ("Easy Backpack Hold", "길게 눌러 배낭"), ("Luggage Distance Markers", "짐 거리 표시"), ("Stamina Cost Tweaks", "스태미나 소모 조정"), ("Status Gain Tweaks", "상태이상 증가"), ("Peak Convenient Backpacks", "가벼운 배낭"), ("PEAK Fast Startup", "빠른 시작"), ("Item Browser", "아이템 브라우저"), ("Item Info Display", "아이템 정보"), ("PEAK Trails", "궤적 표시"), ("Peak Stats Ex", "스탯 확장"), ("Bags For Everyone", "전원 배낭"), ("Third Person Toggle", "3인칭 전환"), ("Eagles Eye", "독수리의 눈"), ("Revive-n-Loot", "부활과 루팅"), ("My Prevision", "투척 궤적"), ("Piggyback", "업기"), ("Splits Stats", "구간 타이밍"), ("Peak Rescue Claw Mod", "구조 발톱 조준점"), ("PEAK Quick Resume", "모닥불 세이브 이어하기"), ("Peak Level Select", "맵/난이도 선택"), ("PEAK Unlimited", "인원 무제한 로비"), ("Photon Ping GUI", "핑 표시"), ("Catch Players", "낙하 플레이어 잡기"), ("Simple Unlocker", "외형 전부 해금"), ("Peak Mod Settings", "모드 설정"), ("PEAKLib.ModConfig", "모드 설정"), ("Blue Claw Crosshair Mod", "구조 발톱 조준점"), ("Rescue Claw Crosshair Mod", "구조 발톱 조준점"));

		private static Dictionary<string, string> PlAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Prędkość mgły"), ("Symbiotic Ghost", "Duch symbiont"), ("Campfire Faerie Aura", "Aura wróżki przy ognisku"), ("Campfire Teleport", "Teleport do ogniska"), ("Carry Rescue Bar Regen", "Regen przy noszeniu"), ("Easy Backpack Hold", "Plecak przytrzymaniem"), ("Luggage Distance Markers", "Dystans do bagażu"), ("Stamina Cost Tweaks", "Koszt wytrzymałości"), ("Status Gain Tweaks", "Przyrost statusów"), ("Peak Convenient Backpacks", "Lżejsze plecaki"), ("PEAK Fast Startup", "Szybki start"), ("Item Browser", "Przeglądarka przedmiotów"), ("Item Info Display", "Info przedmiotów"), ("PEAK Trails", "Ślady graczy"), ("Peak Stats Ex", "Rozszerzone statystyki"), ("Bags For Everyone", "Plecaki dla wszystkich"), ("Third Person Toggle", "Trzecia osoba"), ("Eagles Eye", "Orle oko"), ("Revive-n-Loot", "Wskrzeszenie i loot"), ("My Prevision", "Predykcja rzutu"), ("Piggyback", "Na barana"), ("Splits Stats", "Czasy segmentów"), ("Peak Rescue Claw Mod", "Celownik pazura"), ("PEAK Quick Resume", "Wznowienie przy ognisku"), ("Peak Level Select", "Wybór poziomu"), ("PEAK Unlimited", "Lobby bez limitu"), ("Photon Ping GUI", "Wyświetlanie pingu"), ("Catch Players", "Łapanie graczy"), ("Simple Unlocker", "Odblokuj kosmetyki"), ("Peak Mod Settings", "USTAWIENIA MODÓW"), ("PEAKLib.ModConfig", "USTAWIENIA MODÓW"), ("Blue Claw Crosshair Mod", "Celownik pazura"), ("Rescue Claw Crosshair Mod", "Celownik pazura"));

		private static Dictionary<string, string> TrAliases { get; } = CloneAliases(("Fog Rise Speed Tweaks", "Sis yükselme hızı"), ("Symbiotic Ghost", "Simbiyotik hayalet"), ("Campfire Faerie Aura", "Kamp ateşi peri aurası"), ("Campfire Teleport", "Kamp ateşi ışınlanma"), ("Carry Rescue Bar Regen", "Taşırken kurtarma yenileme"), ("Easy Backpack Hold", "Basılı tutarak çanta"), ("Luggage Distance Markers", "Bagaj mesafesi"), ("Stamina Cost Tweaks", "Dayanıklılık maliyeti"), ("Status Gain Tweaks", "Durum artışı"), ("Peak Convenient Backpacks", "Hafif çantalar"), ("PEAK Fast Startup", "Hızlı başlatma"), ("Item Browser", "Eşya tarayıcı"), ("Item Info Display", "Eşya bilgisi"), ("PEAK Trails", "Oyuncu izleri"), ("Peak Stats Ex", "Geniş istatistik"), ("Bags For Everyone", "Herkese çanta"), ("Third Person Toggle", "Üçüncü şahıs"), ("Eagles Eye", "Kartal gözü"), ("Revive-n-Loot", "Dirilt ve yağmala"), ("My Prevision", "Atış tahmini"), ("Piggyback", "Sırtta taşıma"), ("Splits Stats", "Segment süreleri"), ("Peak Rescue Claw Mod", "Kurtarma pençesi nişangâhı"), ("PEAK Quick Resume", "Kamp ateşi devam"), ("Peak Level Select", "Seviye seçimi"), ("PEAK Unlimited", "Sınırsız lobi"), ("Photon Ping GUI", "Ping gösterimi"), ("Catch Players", "Oyuncuları yakala"), ("Simple Unlocker", "Kozmetikleri aç"), ("Peak Mod Settings", "MOD AYARLARI"), ("PEAKLib.ModConfig", "MOD AYARLARI"), ("Blue Claw Crosshair Mod", "Kurtarma pençesi nişangâhı"), ("Rescue Claw Crosshair Mod", "Kurtarma pençesi nişangâhı"));

		private static Dictionary<string, string> ZhCnSections { get; } = Sec(("General", "通用"), ("Controls", "操作"), ("Hotkeys", "快捷键"), ("Keybinds", "按键"), ("Display", "显示"), ("UI", "界面"), ("Debug", "调试"), ("Camera", "镜头"), ("Network", "网络"), ("Graph", "图表"), ("Stats", "统计"), ("Experimental", "实验性"), ("Extra", "额外"), ("Fog", "迷雾"), ("Lava", "岩浆"), ("Gloom", "幽暗"), ("Safety", "安全"), ("HealRates", "恢复速率"), ("HealToggles", "恢复开关"), ("StaminaCost", "体力消耗"), ("StaminaInfo", "体力信息"), ("Zoom", "缩放"), ("Custom Color", "自定义颜色"), ("Timing", "时机"), ("Teleport", "传送"), ("Teleport-Mitigation", "传送缓解"), ("Wake-Up", "醒来"), ("Pause-Menu", "暂停菜单"), ("Internal", "内部"), ("ItemBrowser", "物品浏览器"), ("ItemInfoDisplay", "物品信息"), ("ModAliases", "模组显示别名"), ("总开关", "总开关"), ("显示", "显示"), ("快捷键", "快捷键"));

		private static Dictionary<string, string> ZhTwSections { get; } = Sec(("General", "通用"), ("Controls", "操作"), ("Hotkeys", "快捷鍵"), ("Keybinds", "按鍵"), ("Display", "顯示"), ("UI", "介面"), ("Debug", "除錯"), ("Camera", "鏡頭"), ("Network", "網路"), ("Graph", "圖表"), ("Stats", "統計"), ("Experimental", "實驗性"), ("Extra", "額外"), ("Fog", "迷霧"), ("Lava", "岩漿"), ("Gloom", "幽暗"), ("Safety", "安全"), ("HealRates", "恢復速率"), ("HealToggles", "恢復開關"), ("StaminaCost", "體力消耗"), ("StaminaInfo", "體力資訊"), ("Zoom", "縮放"), ("Custom Color", "自訂顏色"), ("Timing", "時機"), ("Teleport", "傳送"), ("Teleport-Mitigation", "傳送緩解"), ("Wake-Up", "醒來"), ("Pause-Menu", "暫停選單"), ("Internal", "內部"), ("ItemBrowser", "物品瀏覽器"), ("ItemInfoDisplay", "物品資訊"), ("ModAliases", "模組顯示別名"));

		private static Dictionary<string, string> FrSections { get; } = Sec(("General", "Général"), ("Controls", "Commandes"), ("Hotkeys", "Raccourcis"), ("Keybinds", "Touches"), ("Display", "Affichage"), ("UI", "Interface"), ("Camera", "Caméra"), ("Safety", "Sécurité"), ("Zoom", "Zoom"), ("Custom Color", "Couleur perso"), ("ModAliases", "Alias des mods"));

		private static Dictionary<string, string> DeSections { get; } = Sec(("General", "Allgemein"), ("Controls", "Steuerung"), ("Hotkeys", "Hotkeys"), ("Keybinds", "Tasten"), ("Display", "Anzeige"), ("UI", "Oberfläche"), ("Camera", "Kamera"), ("Safety", "Sicherheit"), ("Zoom", "Zoom"), ("Custom Color", "Eigene Farbe"), ("ModAliases", "Mod-Aliasse"));

		private static Dictionary<string, string> ItSections { get; } = Sec(("General", "Generale"), ("Controls", "Comandi"), ("Hotkeys", "Tasti rapidi"), ("Keybinds", "Tasti"), ("Display", "Schermo"), ("UI", "Interfaccia"), ("Camera", "Fotocamera"), ("Safety", "Sicurezza"), ("Zoom", "Zoom"), ("Custom Color", "Colore personalizzato"), ("ModAliases", "Alias dei mod"));

		private static Dictionary<string, string> EsSections { get; } = Sec(("General", "General"), ("Controls", "Controles"), ("Hotkeys", "Atajos"), ("Keybinds", "Teclas"), ("Display", "Pantalla"), ("UI", "Interfaz"), ("Camera", "Cámara"), ("Safety", "Seguridad"), ("Zoom", "Zoom"), ("Custom Color", "Color personalizado"), ("ModAliases", "Alias de mods"));

		private static Dictionary<string, string> PtSections { get; } = Sec(("General", "Geral"), ("Controls", "Controles"), ("Hotkeys", "Atalhos"), ("Keybinds", "Teclas"), ("Display", "Tela"), ("UI", "Interface"), ("Camera", "Câmera"), ("Safety", "Segurança"), ("Zoom", "Zoom"), ("Custom Color", "Cor personalizada"), ("ModAliases", "Aliases de mods"));

		private static Dictionary<string, string> RuSections { get; } = Sec(("General", "Общие"), ("Controls", "Управление"), ("Hotkeys", "Горячие клавиши"), ("Keybinds", "Клавиши"), ("Display", "Экран"), ("UI", "Интерфейс"), ("Camera", "Камера"), ("Safety", "Безопасность"), ("Zoom", "Зум"), ("Custom Color", "Свой цвет"), ("ModAliases", "Псевдонимы модов"));

		private static Dictionary<string, string> UkSections { get; } = Sec(("General", "Загальні"), ("Controls", "Керування"), ("Hotkeys", "Гарячі клавіші"), ("Keybinds", "Клавіші"), ("Display", "Екран"), ("UI", "Інтерфейс"), ("Camera", "Камера"), ("Safety", "Безпека"), ("Zoom", "Зум"), ("Custom Color", "Власний колір"), ("ModAliases", "Псевдоніми модів"));

		private static Dictionary<string, string> JaSections { get; } = Sec(("General", "一般"), ("Controls", "操作"), ("Hotkeys", "ホットキー"), ("Keybinds", "キー設定"), ("Display", "表示"), ("UI", "UI"), ("Camera", "カメラ"), ("Safety", "安全"), ("Zoom", "ズーム"), ("Custom Color", "カスタム色"), ("ModAliases", "Mod表示名"));

		private static Dictionary<string, string> KoSections { get; } = Sec(("General", "일반"), ("Controls", "조작"), ("Hotkeys", "단축키"), ("Keybinds", "키 설정"), ("Display", "표시"), ("UI", "UI"), ("Camera", "카메라"), ("Safety", "안전"), ("Zoom", "줌"), ("Custom Color", "사용자 색상"), ("ModAliases", "모드 표시 이름"));

		private static Dictionary<string, string> PlSections { get; } = Sec(("General", "Ogólne"), ("Controls", "Sterowanie"), ("Hotkeys", "Skróty"), ("Keybinds", "Klawisze"), ("Display", "Wyświetlanie"), ("UI", "Interfejs"), ("Camera", "Kamera"), ("Safety", "Bezpieczeństwo"), ("Zoom", "Zoom"), ("Custom Color", "Własny kolor"), ("ModAliases", "Aliasy modów"));

		private static Dictionary<string, string> TrSections { get; } = Sec(("General", "Genel"), ("Controls", "Kontroller"), ("Hotkeys", "Kısayollar"), ("Keybinds", "Tuşlar"), ("Display", "Görüntü"), ("UI", "Arayüz"), ("Camera", "Kamera"), ("Safety", "Güvenlik"), ("Zoom", "Yakınlaştırma"), ("Custom Color", "Özel renk"), ("ModAliases", "Mod takma adları"));

		private static Dictionary<string, string> ZhCnEntries { get; } = Ent(("Enabled", "启用"), ("EnableMod", "启用模组"), ("ModEnabled", "启用模组"), ("TeleportKey", "传送按键"), ("HoldKey", "按住键"), ("BackpackKey", "背包键"), ("AlternativeBackpackKey", "备用背包键"), ("Toggle Key", "开关按键"), ("ToggleKey", "切换键"), ("Resume-Key", "继续按键"), ("ResumeKey", "继续按键"), ("AlsoAcceptKeypad0", "小键盘0也可用"), ("ShowBinocularOverlay", "显示望远镜遮罩"), ("Controls|TeleportKey", "传送按键"), ("Zoom|HoldKey", "按住键"), ("Keybinds|BackpackKey", "背包键"), ("Keybinds|AlternativeBackpackKey", "备用背包键"), ("ItemBrowser|Toggle Key", "开关按键"), ("Camera|ToggleKey", "切换键"), ("Hotkeys|ToggleFreeStaminaKey", "无限体力切换键"));

		private static Dictionary<string, string> ZhTwEntries { get; } = Ent(("Enabled", "啟用"), ("EnableMod", "啟用模組"), ("ModEnabled", "啟用模組"), ("TeleportKey", "傳送按鍵"), ("HoldKey", "按住鍵"), ("BackpackKey", "背包鍵"), ("AlternativeBackpackKey", "備用背包鍵"), ("Toggle Key", "開關按鍵"), ("ToggleKey", "切換鍵"), ("Resume-Key", "繼續按鍵"), ("ResumeKey", "繼續按鍵"), ("AlsoAcceptKeypad0", "小鍵盤0也可用"), ("ShowBinocularOverlay", "顯示望遠鏡遮罩"), ("Controls|TeleportKey", "傳送按鍵"), ("Zoom|HoldKey", "按住鍵"), ("Keybinds|BackpackKey", "背包鍵"), ("Keybinds|AlternativeBackpackKey", "備用背包鍵"), ("ItemBrowser|Toggle Key", "開關按鍵"), ("Camera|ToggleKey", "切換鍵"), ("Hotkeys|ToggleFreeStaminaKey", "無限體力切換鍵"));

		private static Dictionary<string, string> FrEntries { get; } = Ent(("Enabled", "Activé"), ("EnableMod", "Activer le mod"), ("ModEnabled", "Activer le mod"), ("TeleportKey", "Touche téléportation"), ("HoldKey", "Touche maintien"), ("BackpackKey", "Touche sac"), ("AlternativeBackpackKey", "Touche sac alt."), ("Toggle Key", "Touche bascule"), ("ToggleKey", "Touche bascule"), ("Resume-Key", "Touche reprendre"), ("ResumeKey", "Touche reprendre"), ("AlsoAcceptKeypad0", "Accepter aussi pavé 0"), ("ShowBinocularOverlay", "Overlay jumelles"), ("Hotkeys|ToggleFreeStaminaKey", "Endurance illimitée"));

		private static Dictionary<string, string> DeEntries { get; } = Ent(("Enabled", "Aktiv"), ("EnableMod", "Mod aktivieren"), ("ModEnabled", "Mod aktivieren"), ("TeleportKey", "Teleport-Taste"), ("HoldKey", "Halten-Taste"), ("BackpackKey", "Rucksack-Taste"), ("AlternativeBackpackKey", "Alt. Rucksack-Taste"), ("Toggle Key", "Umschalt-Taste"), ("ToggleKey", "Umschalt-Taste"), ("Resume-Key", "Fortsetzen-Taste"), ("ResumeKey", "Fortsetzen-Taste"), ("AlsoAcceptKeypad0", "Auch Ziffernblock 0"), ("ShowBinocularOverlay", "Fernglas-Overlay"), ("Hotkeys|ToggleFreeStaminaKey", "Unendliche Ausdauer"));

		private static Dictionary<string, string> ItEntries { get; } = Ent(("Enabled", "Attivo"), ("EnableMod", "Abilita mod"), ("ModEnabled", "Abilita mod"), ("TeleportKey", "Tasto teletrasporto"), ("HoldKey", "Tasto tieni"), ("BackpackKey", "Tasto zaino"), ("AlternativeBackpackKey", "Tasto zaino alt."), ("Toggle Key", "Tasto attiva/disattiva"), ("ToggleKey", "Tasto attiva/disattiva"), ("Resume-Key", "Tasto riprendi"), ("ResumeKey", "Tasto riprendi"), ("AlsoAcceptKeypad0", "Accetta anche tastierino 0"), ("ShowBinocularOverlay", "Overlay binocolo"), ("Hotkeys|ToggleFreeStaminaKey", "Stamina infinita"));

		private static Dictionary<string, string> EsEntries { get; } = Ent(("Enabled", "Activado"), ("EnableMod", "Activar mod"), ("ModEnabled", "Activar mod"), ("TeleportKey", "Tecla de teletransporte"), ("HoldKey", "Tecla mantener"), ("BackpackKey", "Tecla mochila"), ("AlternativeBackpackKey", "Tecla mochila alt."), ("Toggle Key", "Tecla alternar"), ("ToggleKey", "Tecla alternar"), ("Resume-Key", "Tecla reanudar"), ("ResumeKey", "Tecla reanudar"), ("AlsoAcceptKeypad0", "Aceptar también teclado 0"), ("ShowBinocularOverlay", "Overlay de binoculares"), ("Hotkeys|ToggleFreeStaminaKey", "Stamina infinita"));

		private static Dictionary<string, string> PtEntries { get; } = Ent(("Enabled", "Ativado"), ("EnableMod", "Ativar mod"), ("ModEnabled", "Ativar mod"), ("TeleportKey", "Tecla de teleporte"), ("HoldKey", "Tecla segurar"), ("BackpackKey", "Tecla mochila"), ("AlternativeBackpackKey", "Tecla mochila alt."), ("Toggle Key", "Tecla alternar"), ("ToggleKey", "Tecla alternar"), ("Resume-Key", "Tecla retomar"), ("ResumeKey", "Tecla retomar"), ("AlsoAcceptKeypad0", "Aceitar também teclado 0"), ("ShowBinocularOverlay", "Overlay de binóculos"), ("Hotkeys|ToggleFreeStaminaKey", "Stamina infinita"));

		private static Dictionary<string, string> RuEntries { get; } = Ent(("Enabled", "Включено"), ("EnableMod", "Включить мод"), ("ModEnabled", "Включить мод"), ("TeleportKey", "Клавиша телепорта"), ("HoldKey", "Клавиша удержания"), ("BackpackKey", "Клавиша рюкзака"), ("AlternativeBackpackKey", "Доп. клавиша рюкзака"), ("Toggle Key", "Клавиша переключения"), ("ToggleKey", "Клавиша переключения"), ("Resume-Key", "Клавиша продолжения"), ("ResumeKey", "Клавиша продолжения"), ("AlsoAcceptKeypad0", "Также numpad 0"), ("ShowBinocularOverlay", "Оверлей бинокля"), ("Hotkeys|ToggleFreeStaminaKey", "Бесконечная выносливость"));

		private static Dictionary<string, string> UkEntries { get; } = Ent(("Enabled", "Увімкнено"), ("EnableMod", "Увімкнути мод"), ("ModEnabled", "Увімкнути мод"), ("TeleportKey", "Клавіша телепорту"), ("HoldKey", "Клавіша утримання"), ("BackpackKey", "Клавіша рюкзака"), ("AlternativeBackpackKey", "Дод. клавіша рюкзака"), ("Toggle Key", "Клавіша перемикання"), ("ToggleKey", "Клавіша перемикання"), ("Resume-Key", "Клавіша продовження"), ("ResumeKey", "Клавіша продовження"), ("AlsoAcceptKeypad0", "Також numpad 0"), ("ShowBinocularOverlay", "Оверлей бінокля"), ("Hotkeys|ToggleFreeStaminaKey", "Нескінченна витривалість"));

		private static Dictionary<string, string> JaEntries { get; } = Ent(("Enabled", "有効"), ("EnableMod", "Modを有効化"), ("ModEnabled", "Modを有効化"), ("TeleportKey", "テレポートキー"), ("HoldKey", "押し続けキー"), ("BackpackKey", "リュックキー"), ("AlternativeBackpackKey", "予備リュックキー"), ("Toggle Key", "切替キー"), ("ToggleKey", "切替キー"), ("Resume-Key", "再開キー"), ("ResumeKey", "再開キー"), ("AlsoAcceptKeypad0", "テンキー0も可"), ("ShowBinocularOverlay", "双眼鏡オーバーレイ"), ("Hotkeys|ToggleFreeStaminaKey", "無限スタミナ切替"));

		private static Dictionary<string, string> KoEntries { get; } = Ent(("Enabled", "사용"), ("EnableMod", "모드 사용"), ("ModEnabled", "모드 사용"), ("TeleportKey", "텔레포트 키"), ("HoldKey", "유지 키"), ("BackpackKey", "배낭 키"), ("AlternativeBackpackKey", "보조 배낭 키"), ("Toggle Key", "토글 키"), ("ToggleKey", "토글 키"), ("Resume-Key", "이어하기 키"), ("ResumeKey", "이어하기 키"), ("AlsoAcceptKeypad0", "숫자패드 0도 허용"), ("ShowBinocularOverlay", "쌍안경 오버레이"), ("Hotkeys|ToggleFreeStaminaKey", "무한 스태미나 전환"));

		private static Dictionary<string, string> PlEntries { get; } = Ent(("Enabled", "Włączone"), ("EnableMod", "Włącz moda"), ("ModEnabled", "Włącz moda"), ("TeleportKey", "Klawisz teleportu"), ("HoldKey", "Klawisz przytrzymania"), ("BackpackKey", "Klawisz plecaka"), ("AlternativeBackpackKey", "Alt. klawisz plecaka"), ("Toggle Key", "Klawisz przełączania"), ("ToggleKey", "Klawisz przełączania"), ("Resume-Key", "Klawisz wznów"), ("ResumeKey", "Klawisz wznów"), ("AlsoAcceptKeypad0", "Akceptuj też num 0"), ("ShowBinocularOverlay", "Nakładka lornetki"), ("Hotkeys|ToggleFreeStaminaKey", "Nieskończona stamina"));

		private static Dictionary<string, string> TrEntries { get; } = Ent(("Enabled", "Açık"), ("EnableMod", "Modu aç"), ("ModEnabled", "Modu aç"), ("TeleportKey", "Işınlanma tuşu"), ("HoldKey", "Basılı tutma tuşu"), ("BackpackKey", "Çanta tuşu"), ("AlternativeBackpackKey", "Yedek çanta tuşu"), ("Toggle Key", "Aç/kapa tuşu"), ("ToggleKey", "Aç/kapa tuşu"), ("Resume-Key", "Devam tuşu"), ("ResumeKey", "Devam tuşu"), ("AlsoAcceptKeypad0", "Numpad 0 da kabul"), ("ShowBinocularOverlay", "Dürbün kaplaması"), ("Hotkeys|ToggleFreeStaminaKey", "Sınırsız stamina"));

		internal static bool TryGetAlias(string lang, string modName, out string alias)
		{
			alias = "";
			if (string.IsNullOrEmpty(lang) || string.IsNullOrEmpty(modName))
			{
				return false;
			}
			if (!Aliases.TryGetValue(lang, out Dictionary<string, string> value) || value == null)
			{
				return false;
			}
			if (value.TryGetValue(modName, out alias))
			{
				return !string.IsNullOrWhiteSpace(alias);
			}
			return false;
		}

		internal static bool TryGetSection(string lang, string section, out string label)
		{
			label = "";
			if (string.IsNullOrEmpty(lang) || string.IsNullOrEmpty(section))
			{
				return false;
			}
			if (!Sections.TryGetValue(lang, out Dictionary<string, string> value) || value == null)
			{
				return false;
			}
			if (value.TryGetValue(section, out label))
			{
				return !string.IsNullOrWhiteSpace(label);
			}
			return false;
		}

		internal static bool TryGetEntry(string lang, string entryKey, out string label)
		{
			label = "";
			if (string.IsNullOrEmpty(lang) || string.IsNullOrEmpty(entryKey))
			{
				return false;
			}
			if (Entries.TryGetValue(lang, out Dictionary<string, string> value) && value != null)
			{
				if (value.TryGetValue(entryKey, out label) && !string.IsNullOrWhiteSpace(label))
				{
					return true;
				}
				int num = entryKey.IndexOf('|');
				if (num >= 0)
				{
					string key = entryKey.Substring(num + 1);
					if (value.TryGetValue(key, out label) && !string.IsNullOrWhiteSpace(label))
					{
						return true;
					}
				}
			}
			return false;
		}

		private static Dictionary<string, string> CloneAliases(params (string k, string v)[] pairs)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
			for (int i = 0; i < pairs.Length; i++)
			{
				(string k, string v) tuple = pairs[i];
				string item = tuple.k;
				string item2 = tuple.v;
				dictionary[item] = item2;
			}
			return dictionary;
		}

		private static Dictionary<string, string> Sec(params (string k, string v)[] pairs)
		{
			return CloneAliases(pairs);
		}

		private static Dictionary<string, string> Ent(params (string k, string v)[] pairs)
		{
			return CloneAliases(pairs);
		}
	}
	internal static class ChineseLocalization
	{
		private sealed class LocMod
		{
			public string Alias = "";

			public Dictionary<string, string> Sections = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

			public Dictionary<string, string> Entries = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
		}

		private const string FilePrefix = "youxia173.ModSettings.";

		private const string LegacyFilePrefix = "youxia173.PeakModSettings.";

		private static readonly Dictionary<string, LocMod> Mods = new Dictionary<string, LocMod>(StringComparer.OrdinalIgnoreCase);

		private static ManualLogSource? _log;

		private static string _activeLangCode = "en";

		private static string? _activePath;

		private static bool _hooksBound;

		private static readonly Dictionary<string, string> DefaultSectionsZh = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
		{
			["General"] = "通用",
			["Controls"] = "操作",
			["Hotkeys"] = "快捷键",
			["Keybinds"] = "按键",
			["Display"] = "显示",
			["UI"] = "界面",
			["Debug"] = "调试",
			["Camera"] = "镜头",
			["Network"] = "网络",
			["Graph"] = "图表",
			["Stats"] = "统计",
			["Experimental"] = "实验性",
			["Extra"] = "额外",
			["Fog"] = "迷雾",
			["Lava"] = "岩浆",
			["Gloom"] = "幽暗",
			["Safety"] = "安全",
			["HealRates"] = "恢复速率",
			["HealToggles"] = "恢复开关",
			["StaminaCost"] = "体力消耗",
			["StaminaInfo"] = "体力信息",
			["Zoom"] = "缩放",
			["Custom Color"] = "自定义颜色",
			["Timing"] = "时机",
			["Teleport"] = "传送",
			["Teleport-Mitigation"] = "传送缓解",
			["Wake-Up"] = "醒来",
			["Pause-Menu"] = "暂停菜单",
			["Internal"] = "内部",
			["ItemBrowser"] = "物品浏览器",
			["ItemInfoDisplay"] = "物品信息",
			["ModAliases"] = "模组显示别名",
			["总开关"] = "总开关",
			["显示"] = "显示",
			["快捷键"] = "快捷键"
		};

		internal static string ActiveLangCode => _activeLangCode;

		private static Dictionary<string, string> DefaultModAliasesZh => GameInstalledZhPresets.ModAliases;

		private static Dictionary<string, Dictionary<string, string>> DefaultEntriesZh => GameInstalledZhPresets.Entries;

		internal static void Init(ManualLogSource log)
		{
			_log = log;
			EnsureLanguageHooks();
			SwitchToGameLanguage(forceReload: true);
		}

		private static void EnsureLanguageHooks()
		{
			if (_hooksBound)
			{
				return;
			}
			_hooksBound = true;
			try
			{
				LocalizedText.OnLangugageChanged = (Action)Delegate.Combine(LocalizedText.OnLangugageChanged, (Action)delegate
				{
					SwitchToGameLanguage(forceReload: true);
					ManualLogSource? log2 = _log;
					if (log2 != null)
					{
						log2.LogInfo((object)("Mod Settings localization switched to '" + _activeLangCode + "'"));
					}
					try
					{
						ModConfigPlugin.OnLocalizationLanguageChanged();
					}
					catch (Exception ex2)
					{
						ManualLogSource? log3 = _log;
						if (log3 != null)
						{
							log3.LogWarning((object)("Failed to refresh UI after language change: " + ex2.Message));
						}
					}
				});
			}
			catch (Exception ex)
			{
				ManualLogSource? log = _log;
				if (log != null)
				{
					log.LogDebug((object)("Could not subscribe OnLangugageChanged: " + ex.Message));
				}
			}
		}

		internal static bool PreferChinese()
		{
			return UsesLocalization();
		}

		internal static bool UsesLocalization()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Invalid comparison between Unknown and I4
			try
			{
				return (int)LocalizedText.CURRENT_LANGUAGE > 0;
			}
			catch
			{
				return false;
			}
		}

		internal static string GetModDisplayName(string modName)
		{
			if (string.IsNullOrEmpty(modName))
			{
				return modName;
			}
			if (IsSelfModName(modName))
			{
				return ResolveModSettingsTitle();
			}
			if (!UsesLocalization())
			{
				return modName;
			}
			if (Mods.TryGetValue(modName, out LocMod value) && !string.IsNullOrWhiteSpace(value.Alias))
			{
				return value.Alias.Trim();
			}
			if (BuiltInTranslations.TryGetAlias(_activeLangCode, modName, out string alias))
			{
				return alias;
			}
			return modName;
		}

		internal static bool IsSelfModName(string modName)
		{
			if (string.IsNullOrWhiteSpace(modName))
			{
				return false;
			}
			if (!modName.Equals("PEAKLib.ModConfig", StringComparison.OrdinalIgnoreCase) && !modName.Equals("Peak Mod Settings", StringComparison.OrdinalIgnoreCase) && !modName.Equals("PeakModSettings", StringComparison.OrdinalIgnoreCase) && !modName.Equals("ModSettingsLocalization", StringComparison.OrdinalIgnoreCase) && !modName.Equals("Mod Settings Localization", StringComparison.OrdinalIgnoreCase) && !modName.Equals("Mod Settings", StringComparison.OrdinalIgnoreCase) && !modName.Equals("MOD SETTINGS", StringComparison.OrdinalIgnoreCase) && !modName.Equals("Mod Config", StringComparison.OrdinalIgnoreCase) && modName.IndexOf("PEAKLib.ModConfig", StringComparison.OrdinalIgnoreCase) < 0 && modName.IndexOf("PeakModSettings", StringComparison.OrdinalIgnoreCase) < 0 && modName.IndexOf("ModSettingsLocalization", StringComparison.OrdinalIgnoreCase) < 0)
			{
				return modName.IndexOf("Mod Settings Localization", StringComparison.OrdinalIgnoreCase) >= 0;
			}
			return true;
		}

		private static string ResolveModSettingsTitle()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected I4, but got Unknown
			try
			{
				string text = LocalizedText.GetText("MOD SETTINGS", false);
				if (!string.IsNullOrWhiteSpace(text) && !text.StartsWith("LOC:", StringComparison.OrdinalIgnoreCase))
				{
					return text;
				}
			}
			catch
			{
			}
			try
			{
				Language cURRENT_LANGUAGE = LocalizedText.CURRENT_LANGUAGE;
				return (cURRENT_LANGUAGE - 1) switch
				{
					8 => "模组设置", 
					9 => "模組設定", 
					10 => "MOD設定", 
					11 => "모드 설정", 
					0 => "PARAMÈTRES DU MOD", 
					2 => "MOD-EINSTELLUNGEN", 
					1 => "IMPOSTAZIONI MOD", 
					3 => "AJUSTES DEL MOD", 
					4 => "CONFIGURACIONES DEL MOD", 
					5 => "CONFIGURAÇÕES DE MOD", 
					6 => "НАСТРОЙКИ МОДА", 
					7 => "НАЛАШТУВАННЯ МОДА", 
					12 => "USTAWIENIA MODÓW", 
					_ => "Mod Settings", 
				};
			}
			catch
			{
				return "Mod Settings";
			}
		}

		internal static string GetSectionDisplayName(string modName, string section)
		{
			if (string.IsNullOrEmpty(section))
			{
				return section;
			}
			string text = section;
			if (UsesLocalization())
			{
				string label;
				string value3;
				if (Mods.TryGetValue(modName, out LocMod value) && value.Sections.TryGetValue(section, out string value2) && !string.IsNullOrWhiteSpace(value2))
				{
					text = value2.Trim();
				}
				else if (BuiltInTranslations.TryGetSection(_activeLangCode, section, out label))
				{
					text = label;
				}
				else if (IsChineseLang(_activeLangCode) && DefaultSectionsZh.TryGetValue(section, out value3))
				{
					text = value3;
				}
			}
			return BilingualConfigText.Pick(text, PreferChineseUi());
		}

		internal static string GetEntryDisplayName(string modName, ConfigEntryBase entry)
		{
			string key = entry.Definition.Key;
			string text = key;
			if (UsesLocalization())
			{
				string text2 = MakeEntryKey(entry.Definition.Section, key);
				string label;
				if (Mods.TryGetValue(modName, out LocMod value) && value.Entries.TryGetValue(text2, out string value2) && !string.IsNullOrWhiteSpace(value2))
				{
					text = value2.Trim();
				}
				else if (BuiltInTranslations.TryGetEntry(_activeLangCode, text2, out label))
				{
					text = label;
				}
			}
			return BilingualConfigText.Pick(text, PreferChineseUi());
		}

		internal static string GetEntryDescription(ConfigEntryBase entry)
		{
			object obj;
			if (entry == null)
			{
				obj = null;
			}
			else
			{
				ConfigDescription description = entry.Description;
				obj = ((description != null) ? description.Description : null);
			}
			if (obj == null)
			{
				obj = string.Empty;
			}
			return BilingualConfigText.Pick((string?)obj, PreferChineseUi());
		}

		private static bool PreferChineseUi()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return IsChineseLang(LangCode(GetGameLanguage()));
		}

		internal static string GetAliasRaw(string modName)
		{
			if (!Mods.TryGetValue(modName, out LocMod value))
			{
				return "";
			}
			return value.Alias ?? "";
		}

		internal static void SetModAlias(string modName, string? alias)
		{
			SwitchToGameLanguage(forceReload: false);
			EnsureMod(modName).Alias = (string.IsNullOrWhiteSpace(alias) ? modName : alias.Trim());
			SaveActive();
		}

		internal static void SyncDiscoveredMods(IEnumerable<(string ModName, IReadOnlyList<ConfigEntryBase> Entries)> mods)
		{
			SwitchToGameLanguage(forceReload: false);
			if (UsesLocalization())
			{
				List<(string, IReadOnlyList<ConfigEntryBase>)> list = mods?.ToList() ?? new List<(string, IReadOnlyList<ConfigEntryBase>)>();
				if (SyncIntoCatalog(list) | PruneToDiscoveredMods(list.Select<(string, IReadOnlyList<ConfigEntryBase>), string>(((string ModName, IReadOnlyList<ConfigEntryBase> Entries) m) => m.ModName)))
				{
					SaveActive();
				}
			}
		}

		private static bool PruneToDiscoveredMods(IEnumerable<string> discoveredNames)
		{
			HashSet<string> hashSet = new HashSet<string>(discoveredNames ?? Array.Empty<string>(), StringComparer.OrdinalIgnoreCase);
			if (hashSet.Count == 0)
			{
				return false;
			}
			bool result = false;
			foreach (string item in Mods.Keys.ToList())
			{
				if (!hashSet.Contains(item))
				{
					Mods.Remove(item);
					result = true;
				}
			}
			return result;
		}

		private static void SwitchToGameLanguage(bool forceReload)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			string text = LangCode(GetGameLanguage());
			if (!forceReload && string.Equals(text, _activeLangCode, StringComparison.OrdinalIgnoreCase) && Mods.Count > 0)
			{
				return;
			}
			_activeLangCode = text;
			_activePath = Path.Combine(Paths.ConfigPath, "youxia173.ModSettings." + text + ".txt");
			Mods.Clear();
			if (text == "en")
			{
				return;
			}
			TryMigrateLegacyConfigFiles();
			if (text == "zh-cn")
			{
				string text2 = Path.Combine(Paths.ConfigPath, "youxia173.PeakModSettings.zh.txt");
				string text3 = Path.Combine(Paths.ConfigPath, "youxia173.PeakModSettings.zh-cn.txt");
				if (!File.Exists(_activePath))
				{
					if (File.Exists(text3))
					{
						try
						{
							File.Copy(text3, _activePath);
						}
						catch
						{
						}
					}
					else if (File.Exists(text2))
					{
						try
						{
							File.Copy(text2, _activePath);
						}
						catch
						{
						}
					}
				}
			}
			if (File.Exists(_activePath))
			{
				try
				{
					ParseFile(File.ReadAllLines(_activePath, Encoding.UTF8));
				}
				catch (Exception ex)
				{
					ManualLogSource? log = _log;
					if (log != null)
					{
						log.LogWarning((object)("Failed to read " + _activePath + ": " + ex.Message));
					}
					Mods.Clear();
				}
			}
			MergeBuiltInSeeds();
		}

		private static void TryMigrateLegacyConfigFiles()
		{
			try
			{
				if (!Directory.Exists(Paths.ConfigPath))
				{
					return;
				}
				foreach (string item in Directory.EnumerateFiles(Paths.ConfigPath, "youxia173.PeakModSettings.*.txt"))
				{
					string fileName = Path.GetFileName(item);
					if (!fileName.StartsWith("youxia173.PeakModSettings.", StringComparison.OrdinalIgnoreCase))
					{
						continue;
					}
					string text = fileName.Substring("youxia173.PeakModSettings.".Length);
					string text2 = Path.Combine(Paths.ConfigPath, "youxia173.ModSettings." + text);
					if (!File.Exists(text2))
					{
						try
						{
							File.Copy(item, text2);
						}
						catch
						{
						}
					}
				}
			}
			catch
			{
			}
		}

		private static void MergeBuiltInSeeds()
		{
			if (string.Equals(_activeLangCode, "en", StringComparison.OrdinalIgnoreCase))
			{
				return;
			}
			if (IsChineseLang(_activeLangCode))
			{
				MergeChineseSeeds();
			}
			foreach (KeyValuePair<string, string> item in DefaultModAliasesZh)
			{
				if (Mods.TryGetValue(item.Key, out LocMod value) && value != null && BuiltInTranslations.TryGetAlias(_activeLangCode, item.Key, out string alias) && (string.IsNullOrWhiteSpace(value.Alias) || string.Equals(value.Alias, item.Key, StringComparison.Ordinal)))
				{
					value.Alias = alias;
				}
			}
			if (IsChineseLang(_activeLangCode))
			{
				return;
			}
			foreach (KeyValuePair<string, Dictionary<string, string>> item2 in DefaultEntriesZh)
			{
				item2.Deconstruct(out var key, out var value2);
				string key2 = key;
				Dictionary<string, string> dictionary = value2;
				if (!Mods.TryGetValue(key2, out LocMod value3) || value3 == null)
				{
					continue;
				}
				foreach (KeyValuePair<string, string> item3 in dictionary)
				{
					item3.Deconstruct(out key, out var _);
					string text = key;
					if (BuiltInTranslations.TryGetEntry(_activeLangCode, text, out string label) && (!value3.Entries.ContainsKey(text) || string.IsNullOrWhiteSpace(value3.Entries[text]) || EntryLooksUntranslated(value3.Entries[text], text)))
					{
						value3.Entries[text] = label;
					}
					int num = text.IndexOf('|');
					if (num > 0)
					{
						string text2 = text.Substring(0, num);
						if (BuiltInTranslations.TryGetSection(_activeLangCode, text2, out string label2) && (!value3.Sections.ContainsKey(text2) || string.IsNullOrWhiteSpace(value3.Sections[text2]) || string.Equals(value3.Sections[text2], text2, StringComparison.Ordinal)))
						{
							value3.Sections[text2] = label2;
						}
					}
				}
			}
		}

		private static bool EntryLooksUntranslated(string value, string entryKey)
		{
			if (BilingualConfigText.LooksBilingual(value))
			{
				return true;
			}
			string b = entryKey;
			int num = entryKey.IndexOf('|');
			if (num >= 0)
			{
				b = entryKey.Substring(num + 1);
			}
			if (!string.Equals(value, b, StringComparison.Ordinal))
			{
				return string.Equals(value, entryKey, StringComparison.Ordinal);
			}
			return true;
		}

		private static bool SectionLooksUntranslated(string value, string section)
		{
			if (!string.IsNullOrWhiteSpace(value) && !string.Equals(value, section, StringComparison.Ordinal))
			{
				return BilingualConfigText.LooksBilingual(value);
			}
			return true;
		}

		private static bool SyncIntoCatalog(List<(string ModName, IReadOnlyList<ConfigEntryBase> Entries)> mods)
		{
			bool result = false;
			foreach (var mod in mods)
			{
				string item = mod.ModName;
				IReadOnlyList<ConfigEntryBase> item2 = mod.Entries;
				LocMod locMod = EnsureMod(item);
				string alias2;
				string value2;
				if (string.IsNullOrWhiteSpace(locMod.Alias))
				{
					string value;
					if (BuiltInTranslations.TryGetAlias(_activeLangCode, item, out string alias))
					{
						locMod.Alias = alias;
					}
					else if (IsChineseLang(_activeLangCode) && DefaultModAliasesZh.TryGetValue(item, out value))
					{
						locMod.Alias = value;
					}
					else
					{
						locMod.Alias = item;
					}
					result = true;
				}
				else if (string.Equals(locMod.Alias, item, StringComparison.Ordinal) && BuiltInTranslations.TryGetAlias(_activeLangCode, item, out alias2))
				{
					locMod.Alias = alias2;
					result = true;
				}
				else if (IsChineseLang(_activeLangCode) && string.Equals(locMod.Alias, item, StringComparison.Ordinal) && DefaultModAliasesZh.TryGetValue(item, out value2))
				{
					locMod.Alias = value2;
					result = true;
				}
				foreach (ConfigEntryBase item3 in item2)
				{
					string section = item3.Definition.Section;
					string key = item3.Definition.Key;
					string text = MakeEntryKey(section, key);
					if (!locMod.Sections.ContainsKey(section))
					{
						locMod.Sections[section] = SeedSection(section);
						result = true;
					}
					else if (SectionLooksUntranslated(locMod.Sections[section], section))
					{
						string value3 = SeedSection(section);
						if (!SectionLooksUntranslated(value3, section) || string.IsNullOrWhiteSpace(locMod.Sections[section]) || BilingualConfigText.LooksBilingual(locMod.Sections[section]))
						{
							locMod.Sections[section] = value3;
							result = true;
						}
					}
					if (!locMod.Entries.ContainsKey(text))
					{
						locMod.Entries[text] = SeedEntry(item, section, key);
						result = true;
					}
					else if (string.IsNullOrWhiteSpace(locMod.Entries[text]) || EntryLooksUntranslated(locMod.Entries[text], text))
					{
						string value4 = SeedEntry(item, section, key);
						if (!EntryLooksUntranslated(value4, text) || string.IsNullOrWhiteSpace(locMod.Entries[text]))
						{
							locMod.Entries[text] = value4;
							result = true;
						}
					}
				}
			}
			return result;
		}

		private static string SeedSection(string section)
		{
			if (BuiltInTranslations.TryGetSection(_activeLangCode, section, out string label))
			{
				return label;
			}
			if (IsChineseLang(_activeLangCode) && DefaultSectionsZh.TryGetValue(section, out string value))
			{
				return value;
			}
			return BilingualConfigText.Pick(section, PreferChineseUi());
		}

		private static string SeedEntry(string modName, string section, string key)
		{
			string text = MakeEntryKey(section, key);
			if (IsChineseLang(_activeLangCode) && DefaultEntriesZh.TryGetValue(modName, out Dictionary<string, string> value) && value.TryGetValue(text, out var value2) && !string.IsNullOrWhiteSpace(value2))
			{
				return value2;
			}
			if (BuiltInTranslations.TryGetEntry(_activeLangCode, text, out string label))
			{
				return label;
			}
			return BilingualConfigText.Pick(key, PreferChineseUi());
		}

		private static void SaveActive()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(_activePath) || _activeLangCode == "en")
			{
				return;
			}
			try
			{
				Directory.CreateDirectory(Path.GetDirectoryName(_activePath));
				StringBuilder stringBuilder = new StringBuilder(8192);
				stringBuilder.AppendLine("# Mod Settings localization");
				stringBuilder.AppendLine("# Language: " + _activeLangCode + " (" + ((object)GetGameLanguage()/*cast due to .constrained prefix*/).ToString() + ")");
				stringBuilder.AppendLine("# Active when game language matches this file.");
				stringBuilder.AppendLine("# Untranslated items are pre-filled with English originals — edit freely.");
				stringBuilder.AppendLine("#");
				stringBuilder.AppendLine("# Format:");
				stringBuilder.AppendLine("#   [Mod English Tab Name]");
				stringBuilder.AppendLine("#   alias=Display name for mod tab");
				stringBuilder.AppendLine("#   section.SectionName=Display name");
				stringBuilder.AppendLine("#   entry.SectionName|ConfigKey=Display name");
				stringBuilder.AppendLine("#");
				stringBuilder.AppendLine("# Only mods currently discovered by BepInEx are listed (open Mod Settings to refresh).");
				stringBuilder.AppendLine("# Built-in alternate English names are lookup-only and are not written as extra sections.");
				stringBuilder.AppendLine();
				foreach (string item in Mods.Keys.OrderBy<string, string>((string k) => k, StringComparer.OrdinalIgnoreCase))
				{
					LocMod locMod = Mods[item];
					stringBuilder.Append('[').Append(item).AppendLine("]");
					stringBuilder.Append("alias=").AppendLine(locMod.Alias ?? item);
					foreach (KeyValuePair<string, string> item2 in locMod.Sections.OrderBy<KeyValuePair<string, string>, string>((KeyValuePair<string, string> kv) => kv.Key, StringComparer.OrdinalIgnoreCase))
					{
						stringBuilder.Append("section.").Append(item2.Key).Append('=')
							.AppendLine(string.IsNullOrWhiteSpace(item2.Value) ? item2.Key : item2.Value);
					}
					foreach (KeyValuePair<string, string> item3 in locMod.Entries.OrderBy<KeyValuePair<string, string>, string>((KeyValuePair<string, string> kv) => kv.Key, StringComparer.OrdinalIgnoreCase))
					{
						string text = (item3.Key.Contains("|") ? item3.Key.Substring(item3.Key.IndexOf('|') + 1) : item3.Key);
						stringBuilder.Append("entry.").Append(item3.Key).Append('=')
							.AppendLine(string.IsNullOrWhiteSpace(item3.Value) ? text : item3.Value);
					}
					stringBuilder.AppendLine();
				}
				File.WriteAllText(_activePath, stringBuilder.ToString(), new UTF8Encoding(encoderShouldEmitUTF8Identifier: true));
				ManualLogSource? log = _log;
				if (log != null)
				{
					log.LogInfo((object)$"Localization saved: {_activePath} ({Mods.Count} mods)");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource? log2 = _log;
				if (log2 != null)
				{
					log2.LogWarning((object)("Failed to save localization: " + ex.Message));
				}
			}
		}

		private static void ParseFile(string[] lines)
		{
			Mods.Clear();
			LocMod locMod = null;
			for (int i = 0; i < lines.Length; i++)
			{
				string text = lines[i].Trim();
				if (text.Length == 0 || text.StartsWith("#", StringComparison.Ordinal))
				{
					continue;
				}
				if (text.StartsWith("[", StringComparison.Ordinal) && text.EndsWith("]", StringComparison.Ordinal))
				{
					locMod = EnsureMod(text.Substring(1, text.Length - 2).Trim());
				}
				else
				{
					if (locMod == null)
					{
						continue;
					}
					int num = text.IndexOf('=');
					if (num > 0)
					{
						string text2 = text.Substring(0, num).Trim();
						string text3 = text.Substring(num + 1).Trim();
						if (text2.Equals("alias", StringComparison.OrdinalIgnoreCase))
						{
							locMod.Alias = text3;
						}
						else if (text2.StartsWith("section.", StringComparison.OrdinalIgnoreCase))
						{
							locMod.Sections[text2.Substring("section.".Length)] = text3;
						}
						else if (text2.StartsWith("entry.", StringComparison.OrdinalIgnoreCase))
						{
							locMod.Entries[text2.Substring("entry.".Length)] = text3;
						}
					}
				}
			}
		}

		private static LocMod EnsureMod(string modName)
		{
			if (!Mods.TryGetValue(modName, out LocMod value) || value == null)
			{
				value = new LocMod();
				Mods[modName] = value;
			}
			return value;
		}

		private static string MakeEntryKey(string section, string key)
		{
			return section + "|" + key;
		}

		private static Language GetGameLanguage()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				return LocalizedText.CURRENT_LANGUAGE;
			}
			catch
			{
				return (Language)0;
			}
		}

		private static string LangCode(Language lang)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected I4, but got Unknown
			return (int)lang switch
			{
				0 => "en", 
				1 => "fr", 
				2 => "it", 
				3 => "de", 
				4 => "es-es", 
				5 => "es-latam", 
				6 => "pt-br", 
				7 => "ru", 
				8 => "uk", 
				9 => "zh-cn", 
				10 => "zh-tw", 
				11 => "ja", 
				12 => "ko", 
				13 => "pl", 
				14 => "tr", 
				_ => "en", 
			};
		}

		private static bool IsChineseLang(string code)
		{
			if (!code.Equals("zh-cn", StringComparison.OrdinalIgnoreCase))
			{
				return code.Equals("zh-tw", StringComparison.OrdinalIgnoreCase);
			}
			return true;
		}

		private static void MergeChineseSeeds()
		{
			foreach (KeyValuePair<string, string> item in DefaultModAliasesZh)
			{
				if (Mods.TryGetValue(item.Key, out LocMod value) && value != null && (string.IsNullOrWhiteSpace(value.Alias) || string.Equals(value.Alias, item.Key, StringComparison.Ordinal)))
				{
					value.Alias = item.Value;
				}
			}
			foreach (KeyValuePair<string, Dictionary<string, string>> item2 in DefaultEntriesZh)
			{
				item2.Deconstruct(out var key, out var value2);
				string key2 = key;
				Dictionary<string, string> dictionary = value2;
				if (!Mods.TryGetValue(key2, out LocMod value3) || value3 == null)
				{
					continue;
				}
				foreach (KeyValuePair<string, string> item3 in dictionary)
				{
					item3.Deconstruct(out key, out var value4);
					string text = key;
					string value5 = value4;
					int num = text.IndexOf('|');
					string b = ((num >= 0) ? text.Substring(num + 1) : text);
					if (!value3.Entries.ContainsKey(text) || string.IsNullOrWhiteSpace(value3.Entries[text]) || string.Equals(value3.Entries[text], b, StringComparison.Ordinal))
					{
						value3.Entries[text] = value5;
					}
					if (num > 0)
					{
						string text2 = text.Substring(0, num);
						if (!value3.Sections.ContainsKey(text2) || string.IsNullOrWhiteSpace(value3.Sections[text2]) || string.Equals(value3.Sections[text2], text2, StringComparison.Ordinal))
						{
							value3.Sections[text2] = (DefaultSectionsZh.TryGetValue(text2, out string value6) ? value6 : text2);
						}
					}
				}
			}
		}
	}
	internal static class GameInstalledZhPresets
	{
		internal static readonly Dictionary<string, string> ModAliases = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
		{
			["BagsForEveryone"] = "开局给所有人背包",
			["CampfireFaerieAura"] = "篝火治愈光环",
			["CampfireTeleport"] = "营火传送",
			["CarryRescueBarRegen"] = "被背着就恢复救援条",
			["Catch Players"] = "抓住坠落队友",
			["EaglesEye"] = "望远镜C键",
			["EasyBackpackHold"] = "长按B打开背包",
			["FogRiseSpeedTweaks"] = "迷雾升起速度",
			["GhostHats"] = "幽灵帽子",
			["ItemBrowser"] = "物品浏览生成器",
			["ItemInfoDisplay"] = "物品信息显示(中文)",
			["LuggageDistanceMarkers"] = "未开行李箱距离",
			["ModSettingsLocalization"] = "模组设置",
			["MyPrevision"] = "投掷轨迹计算",
			["No Revive Penalty"] = "复活无诅咒",
			["Overhead Stamina"] = "队友头顶体力条",
			["Peak Convenient Backpacks"] = "减少背包负重",
			["Peak Late Join"] = "中途加入PeakLateJoin",
			["PEAK Quick Resume"] = "营火存档F7读档",
			["PEAKFastStartup"] = "跳过启动动画",
			["PeakLevelSelect"] = "选择地图LevelSelect",
			["PEAKLib.Core"] = "Lib核心前置",
			["PEAKLib.UI"] = "依赖库界面UI",
			["PeakStatsEx"] = "队友状态统计",
			["PEAKTrails"] = "按U玩家轨迹追踪",
			["PEAKUnlimited"] = "额外联机人数20",
			["Photon Ping GUI"] = "左下角显示延迟",
			["Piggyback"] = "长按E背队友",
			["Rescue Claw Crosshair Mod"] = "救援爪准星变色",
			["Revive_n_Loot"] = "童子雕像复活且掉道具",
			["SimpleUnlocker"] = "解锁全部外观",
			["SmoreSkinColors"] = "扩展皮肤颜色",
			["SoftDependencyFix"] = "软依赖修复",
			["StaminaCostTweaks"] = "体力消耗倍率",
			["SymbioticGhost"] = "共生幽灵",
			["ThirdPersonToggle"] = "按V第三人称视角",
			["Too Many Hats"] = "更多自定义帽",
			["Bags For Everyone"] = "开局给所有人背包",
			["Campfire Faerie Aura"] = "篝火治愈光环",
			["Campfire Teleport"] = "营火传送",
			["Carry Rescue Bar Regen"] = "被背着就恢复救援条",
			["Catch_Players"] = "抓住坠落队友",
			["Eagles Eye"] = "望远镜C键",
			["Easy Backpack Hold"] = "长按B打开背包",
			["Fog Rise Speed Tweaks"] = "迷雾升起速度",
			["Ghost Hats"] = "幽灵帽子",
			["Item Browser"] = "物品浏览生成器",
			["Item Info Display"] = "物品信息显示(中文)",
			["Luggage Distance Markers"] = "未开行李箱距离",
			["Mod Settings Localization"] = "模组设置",
			["Mod Settings"] = "模组设置",
			["PeakModSettings"] = "模组设置",
			["PEAKLib.ModConfig"] = "模组设置",
			["My Prevision"] = "投掷轨迹计算",
			["No_Revive_Penalty"] = "复活无诅咒",
			["OverheadStamina"] = "队友头顶体力条",
			["PeakConvenientBackpacks"] = "减少背包负重",
			["Peak LateJoin"] = "中途加入PeakLateJoin",
			["PeakLateJoin"] = "中途加入PeakLateJoin",
			["PEAK_Quick_Resume"] = "营火存档F7读档",
			["PEAK Fast Startup"] = "跳过启动动画",
			["Peak Level Select"] = "选择地图LevelSelect",
			["PEAK Lib Core"] = "Lib核心前置",
			["PEAKLib Core"] = "Lib核心前置",
			["PEAK Lib UI"] = "依赖库界面UI",
			["PEAKLib UI"] = "依赖库界面UI",
			["Peak Stats Ex"] = "队友状态统计",
			["PEAK Trails"] = "按U玩家轨迹追踪",
			["PEAK Unlimited"] = "额外联机人数20",
			["PhotonPingGUI"] = "左下角显示延迟",
			["Peak Rescue Claw Mod"] = "救援爪准星变色",
			["Blue Claw Crosshair Mod"] = "救援爪准星变色",
			["Revive-n-Loot"] = "童子雕像复活且掉道具",
			["Revive n Loot"] = "童子雕像复活且掉道具",
			["Simple Unlocker"] = "解锁全部外观",
			["Smore Skin Colors"] = "扩展皮肤颜色",
			["Soft Dependency Fix"] = "软依赖修复",
			["Stamina Cost Tweaks"] = "体力消耗倍率",
			["Symbiotic Ghost"] = "共生幽灵",
			["Third Person Toggle"] = "按V第三人称视角",
			["Too_Many_Hats"] = "更多自定义帽"
		};

		internal static readonly Dictionary<string, Dictionary<string, string>> Entries = new Dictionary<string, Dictionary<string, string>>(StringComparer.OrdinalIgnoreCase)
		{
			["FogRiseSpeedTweaks"] = E(("General|EnableMod", "启用模组"), ("Fog|UseAbsoluteSpeed", "使用绝对速度"), ("Fog|RiseSpeed", "升起速度(绝对)"), ("Fog|RiseSpeedPercent", "升起速度百分比"), ("Lava|RiseSpeedPercent", "岩浆上升速度%"), ("Gloom|RiseSpeedPercent", "幽暗升起速度%"), ("Gloom|DrowsyPerSecondPercent", "昏睡累积速度%"), ("UI|FogUiEnabled", "显示右侧状态栏"), ("UI|CampfireLocatorUiEnabled", "显示篝火定位条"), ("UI|FogUiX", "状态栏距右缩进"), ("UI|FogUiY", "状态栏上下偏移"), ("UI|FogUiScale", "状态栏缩放")),
			["CampfireFaerieAura"] = E(("General|Enabled", "启用"), ("General|AffectTeammatesAsHost", "主机时影响队友"), ("General|EnablePortableStove", "启用便携炉"), ("General|PortableStoveBuffDuration", "便携炉增益时长"), ("HealRates|HotPerSecond", "过热/秒"), ("HealRates|ColdPerSecond", "寒冷/秒"), ("HealRates|PoisonPerSecond", "中毒/秒"), ("HealRates|DrowsyPerSecond", "昏睡/秒"), ("HealRates|InjuryPerSecond", "受伤/秒"), ("HealRates|SporesPerSecond", "孢子/秒"), ("HealRates|HungerPerSecond", "饥饿/秒"), ("HealRates|PetrifyPerSecond", "石化/秒"), ("HealRates|CursePerSecond", "诅咒/秒"), ("HealRates|ExtraStaminaPerSecond", "额外体力/秒"), ("HealRates|ExtraStaminaCap", "额外体力上限"), ("HealToggles|HealHot", "恢复过热"), ("HealToggles|HealCold", "恢复寒冷"), ("HealToggles|HealPoison", "恢复中毒"), ("HealToggles|HealDrowsy", "恢复昏睡"), ("HealToggles|HealInjury", "恢复受伤"), ("HealToggles|HealSpores", "恢复孢子"), ("HealToggles|HealHunger", "恢复饥饿"), ("HealToggles|HealPetrify", "恢复石化"), ("HealToggles|HealCurse", "恢复诅咒"), ("HealToggles|RestoreExtraStamina", "恢复额外体力"), ("HealToggles|ShowCampfireIconOnStove", "炉上显示营火图标")),
			["CampfireTeleport"] = E(("General|Enabled", "启用"), ("Controls|TeleportKey", "传送按键"), ("Controls|AlsoAcceptKeypad0", "小键盘0也可用"), ("Safety|InvincibilitySeconds", "无敌秒数"), ("Safety|HeightOffset", "高度偏移"), ("Safety|CooldownSeconds", "冷却秒数")),
			["CarryRescueBarRegen"] = E(("General|Enabled", "启用"), ("General|RegenMultiplier", "恢复倍率")),
			["EasyBackpackHold"] = E(("Keybinds|BackpackKey", "背包键"), ("Keybinds|AlternativeBackpackKey", "备用背包键")),
			["StaminaCostTweaks"] = E(("Hotkeys|ToggleFreeStaminaKey", "无限体力切换键"), ("StaminaCost|SprintCostPercent", "冲刺消耗%"), ("StaminaCost|ClimbCostPercent", "攀爬消耗%"), ("StaminaCost|ClimbJumpCostPercent", "攀爬跳跃消耗%"), ("StaminaCost|ClimbGrabCostPercent", "攀爬抓取消耗%"), ("StaminaCost|JumpCostPercent", "跳跃消耗%"), ("StaminaCost|VineIdleCostPercent", "藤蔓待机消耗%"), ("StaminaCost|GliderCostPercent", "滑翔消耗%"), ("StaminaCost|StaminaRegenPercent", "体力回复%"), ("StaminaCost|StaminaRegenDelayPercent", "回复延迟%"), ("StaminaCost|ExtremeClimbEnabled", "极限攀爬"), ("StaminaCost|ExtremeClimbCostPercent", "极限攀爬消耗%"), ("StaminaCost|ExtremeClimbBelowPercent", "极限攀爬体力阈值%"), ("StaminaCost|ClimbSpeedPercent", "攀爬速度%")),
			["LuggageDistanceMarkers"] = E(("总开关|启用模组", "启用模组"), ("显示|最大距离米", "最大距离(米)"), ("显示|高度偏移", "高度偏移"), ("显示|字号", "字号"), ("显示|排除雕像棺材", "排除雕像棺材"), ("显示|显示距离", "显示距离"), ("显示|显示类型前缀", "显示类型前缀"), ("快捷键|切换显示", "切换显示"), ("快捷键|显示模式", "显示模式"), ("快捷键|限时秒数", "限时秒数"), ("快捷键|开局默认显示", "开局默认显示")),
			["Peak Convenient Backpacks"] = E(("General|BackpackWeightReductionPercentage", "背包减重%"), ("General|CarriedPlayerWeight", "背人重量")),
			["PEAKFastStartup"] = E(("General|SkipSplashScreens", "跳过开场"), ("General|LoadIslandOnStart", "启动直接进岛")),
			["BagsForEveryone"] = E(("General|ModEnabled", "启用模组")),
			["ThirdPersonToggle"] = E(("Camera|ToggleKey", "切换键")),
			["EaglesEye"] = E(("Zoom|MinZoomFOV", "最小FOV"), ("Zoom|ScrollSpeed", "滚轮速度"), ("Zoom|HoldKey", "按住键"), ("Zoom|ShowBinocularOverlay", "显示望远镜遮罩")),
			["SimpleUnlocker"] = E(("General|Unlock Cosmetics", "解锁外观"), ("General|Unlock Ascents", "解锁攀登难度")),
			["ItemBrowser"] = E(("ItemBrowser|Toggle Key", "开关按键"), ("ItemBrowser|Allow Online Spawn", "允许联机生成"), ("ItemBrowser|Verbose Logs", "详细日志"), ("ItemBrowser|Ghost Send To Observed", "幽灵发给观察目标")),
			["ItemInfoDisplay"] = E(("ItemInfoDisplay|Font Size", "字号"), ("ItemInfoDisplay|Outline Width", "描边宽度"), ("ItemInfoDisplay|Line Spacing", "行距"), ("ItemInfoDisplay|Size Delta X", "宽度增量"), ("ItemInfoDisplay|Force Update Time", "强制刷新间隔"), ("ItemInfoDisplay|Enable Test Mode", "测试模式")),
			["Catch Players"] = E(("General|PullStrength", "拉力强度")),
			["Revive_n_Loot"] = E(("General|Loot threshold", "掉落阈值"), ("General|Enable statue loot", "雕像掉落")),
			["MyPrevision"] = E(("General|Enable Throw Trajectory", "投掷轨迹"), ("General|Enable Impact Point", "落点"), ("General|Hide Item In Hand", "隐藏手持物"), ("General|Enable Prediction Vine", "预测藤蔓"), ("General|Enable Actual Vine", "实际藤蔓")),
			["Rescue Claw Crosshair Mod"] = E(("General|ColorMode", "颜色模式"), ("General|StaticColor", "固定颜色"), ("Custom Color|R", "红"), ("Custom Color|G", "绿"), ("Custom Color|B", "蓝")),
			["Overhead Stamina"] = E(("General|MaxDistance", "最大距离"), ("General|BarScale", "条缩放"), ("General|DistanceOverlayKeyboardKey", "距离叠加快捷键")),
			["PeakStatsEx"] = E(("General|Display Teammate Stamina Bars", "显示队友体力条"), ("General|Teammate Stamina Bar Proximity", "队友体力条距离"), ("General|Teammate Stamina Bar Limit", "队友体力条数量上限"), ("General|Teammate Stamina Bar Scale (Default: 0.72)", "队友体力条缩放"), ("General|Show InventorySlots", "显示物品栏"), ("General|Show Inventory Slots", "显示物品栏"), ("General|Show Stamina Info", "显示体力信息"), ("StaminaInfo|Bar Font Size", "条文字字号"), ("StaminaInfo|Bar Outline Width", "条描边宽度"), ("StaminaInfo|Round Stamina Bars", "体力条取整"), ("StaminaInfo|Round Affliction Bars", "状态条取整"), ("StaminaInfo|Show Affliction Countdown", "显示状态倒计时"), ("StaminaInfo|Show Hunger Countdown", "显示饥饿倒计时"), ("StaminaInfo|Show Teammate Extra Stamina Outside Bar", "条外显示额外体力"), ("Stats|Display Timer", "显示计时"), ("Stats|Display Height", "显示高度"), ("Stats|Display Level", "显示关卡"), ("Stats|Display Biomes", "显示生物群系"), ("Stats|Display Day Night Countdown", "显示昼夜倒计时"), ("Stats|Display Fog Stats", "显示迷雾统计"), ("Stats|Display Lava Stats", "显示岩浆统计"), ("Stats|Display Terrain Randomiser Seed", "显示地形随机种子"), ("Stats|Display Terrain Customiser Seed", "显示地形自定义种子"), ("Debug|Display Self Stamina Bar", "显示自己体力条"), ("Debug|Self Stamina Bar Count", "自己体力条数量")),
			["PeakLevelSelect"] = E(("General|SelectedLevel", "选择关卡"), ("General|SelectedAscent", "选择难度")),
			["PEAKUnlimited"] = E(("General|MaxPlayers", "最大人数"), ("General|LockKiosk", "锁定售票亭"), ("General|LobbyDetails", "大厅详情"), ("General|ExtraMarshmallows", "额外棉花糖"), ("General|HotDogChance", "热狗概率"), ("General|ExtraBackpacks", "额外背包"), ("General|VisibleLogTypes", "可见日志类型"), ("General|LateJoinMarshmallows", "中途加入棉花糖"), ("Experimental|VoiceFix", "语音修复"), ("Experimental|AllScoutsInHelicopter", "直升机全员")),
			["Photon Ping GUI"] = E(("Display|Corner", "角落"), ("Display|ShowMs", "显示毫秒"), ("Display|FontSize", "字号"), ("Display|FontColor", "字体颜色"), ("Display|ShowGraph", "显示图表"), ("Display|ShowMax", "显示最大值"), ("Graph|MaxSamples", "采样数"), ("Graph|Width", "宽度"), ("Graph|Height", "高度")),
			["Piggyback"] = E(("General|EnablePiggyback", "启用背人"), ("General|AllowPiggybackByOthers", "允许被别人背"), ("General|SpectateView", "观战视角"), ("General|HoldToCarryTime", "长按背起时间"), ("General|SwapBackpack", "交换背包"), ("General|AccurateWeight", "精确负重"), ("Controls|GamepadDropKeybind", "手柄放下键")),
			["PEAKTrails"] = E(("Controls|ToggleKey", "开关按键"), ("General|Enabled", "启用"))
		};

		private static Dictionary<string, string> E(params (string k, string v)[] pairs)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
			for (int i = 0; i < pairs.Length; i++)
			{
				(string k, string v) tuple = pairs[i];
				string item = tuple.k;
				string item2 = tuple.v;
				dictionary[item] = item2;
			}
			return dictionary;
		}
	}
	internal interface IBepInExProperty
	{
		internal ConfigEntryBase ConfigBase { get; }

		internal void RefreshValueFromConfig();
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.github.PEAKModding.PEAKLib.ModConfig", "ModSettingsLocalization", "1.8.8")]
	public class ModConfigPlugin : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__17_2;

			public static Func<KeyValuePair<string, ConfigEntryBase[]>, (string Key, IReadOnlyList<ConfigEntryBase>)> <>9__20_0;

			public static Func<PluginInfo, int> <>9__23_0;

			public static Func<PluginInfo, string> <>9__23_1;

			public static Func<KeyValuePair<ConfigDefinition, ConfigEntryBase>, ConfigEntryBase> <>9__23_2;

			public static Func<KeyValuePair<string, ConfigEntryBase[]>, (string Key, IReadOnlyList<ConfigEntryBase>)> <>9__26_0;

			public static Func<KeyValuePair<string, ConfigEntryBase[]>, (string Key, IReadOnlyList<ConfigEntryBase>)> <>9__27_0;

			internal void <Start>b__17_2()
			{
				ProcessModEntries();
				RefreshOpenModTabLabels();
			}

			internal (string Key, IReadOnlyList<ConfigEntryBase>) <ProcessModEntries>b__20_0(KeyValuePair<string, ConfigEntryBase[]> kv)
			{
				return (Key: kv.Key, kv.Value);
			}

			internal int <GetModConfigEntries>b__23_0(PluginInfo p)
			{
				return (!IsSelfPlugin(p)) ? 1 : 0;
			}

			internal string <GetModConfigEntries>b__23_1(PluginInfo p)
			{
				return p.Metadata.Name;
			}

			internal ConfigEntryBase <GetModConfigEntries>b__23_2(KeyValuePair<ConfigDefinition, ConfigEntryBase> configEntry)
			{
				return configEntry.Value;
			}

			internal (string Key, IReadOnlyList<ConfigEntryBase>) <SyncChineseCatalogAndAliases>b__26_0(KeyValuePair<string, ConfigEntryBase[]> kv)
			{
				return (Key: kv.Key, kv.Value);
			}

			internal (string Key, IReadOnlyList<ConfigEntryBase>) <OnLocalizationLanguageChanged>b__27_0(KeyValuePair<string, ConfigEntryBase[]> kv)
			{
				return (Key: kv.Key, kv.Value);
			}
		}

		internal static ModConfigPlugin instance = null;

		private static readonly Dictionary<string, ConfigEntry<string>> AliasConfigEntries = new Dictionary<string, ConfigEntry<string>>(StringComparer.OrdinalIgnoreCase);

		private static List<string> _validPaths = new List<string>();

		private static bool modSettingsLoaded = false;

		public const string Id = "com.github.PEAKModding.PEAKLib.ModConfig";

		internal static ManualLogSource Log { get; } = Logger.CreateLogSource(Name);

		private static List<ConfigEntryBase> EntriesProcessed { get; set; } = new List<ConfigEntryBase>();

		internal static List<ModKeyToName> ModdedKeys { get; set; } = new List<ModKeyToName>();

		private static List<string> GetValidKeyPaths
		{
			get
			{
				if (_validPaths.Count < 1)
				{
					_validPaths = GenerateValidKeyPaths();
				}
				return _validPaths;
			}
		}

		public static string Name => "ModSettingsLocalization";

		public static string Version => "1.8.8";

		private void Awake()
		{
			instance = this;
			ChineseLocalization.Init(Log);
			MonoDetourManager.InvokeHookInitializers(typeof(ModConfigPlugin).Assembly);
			Log.LogInfo((object)("Plugin " + Name + " is loaded! (ModSettingsLocalization)"));
		}

		private void Start()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Expected O, but got Unknown
			try
			{
				LoadModSettings();
				SyncChineseCatalogAndAliases();
			}
			catch (Exception ex)
			{
				Log.LogError((object)("ModSettingsLocalization init failed (UI builders will still register): " + ex));
			}
			MenuAPI.AddToSettingsMenu(new BuilderDelegate(builderDelegate));
			MenuAPI.AddToControlsMenu(new BuilderDelegate(controlsBuilder));
			static void builderDelegate(Transform parent)
			{
				//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0835: Unknown result type (might be due to invalid IL or missing references)
				//IL_084d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0857: Expected O, but got Unknown
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b6: Expected O, but got Unknown
				//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_0201: Unknown result type (might be due to invalid IL or missing references)
				//IL_0294: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_0302: Unknown result type (might be due to invalid IL or missing references)
				//IL_0316: Unknown result type (might be due to invalid IL or missing references)
				//IL_032a: Unknown result type (might be due to invalid IL or missing references)
				//IL_033e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Expected O, but got Unknown
				//IL_0877: Unknown result type (might be due to invalid IL or missing references)
				//IL_04be: Unknown result type (might be due to invalid IL or missing references)
				//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0563: Unknown result type (might be due to invalid IL or missing references)
				//IL_0573: Unknown result type (might be due to invalid IL or missing references)
				//IL_0583: Expected O, but got Unknown
				//IL_0596: Unknown result type (might be due to invalid IL or missing references)
				//IL_05cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e8: Expected O, but got Unknown
				//IL_0601: Unknown result type (might be due to invalid IL or missing references)
				//IL_0616: Unknown result type (might be due to invalid IL or missing references)
				//IL_062b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0636: Unknown result type (might be due to invalid IL or missing references)
				//IL_064b: Unknown result type (might be due to invalid IL or missing references)
				//IL_065f: Unknown result type (might be due to invalid IL or missing references)
				//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0396: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_03db: Expected O, but got Unknown
				Log.LogDebug((object)"builderDelegate");
				MainMenuPageHandler mainMenuHandler = ((Component)parent).GetComponentInParent<MainMenuPageHandler>();
				PauseMenuHandler pauseMenuHandler = ((Component)parent).GetComponentInParent<PauseMenuHandler>();
				if ((Object)(object)mainMenuHandler == (Object)null && (Object)(object)pauseMenuHandler == (Object)null)
				{
					throw new Exception("Failed to get a UIPageHandler");
				}
				MainMenuPageHandler obj = mainMenuHandler;
				object obj2 = ((obj != null) ? ((UIPageHandler)obj).GetPage<MainMenuSettingsPage>() : null);
				if (obj2 == null)
				{
					PauseMenuHandler obj3 = pauseMenuHandler;
					obj2 = ((obj3 != null) ? ((UIPageHandler)obj3).GetPage<PauseMenuSettingsMenuPage>() : null);
				}
				UIPage val = (UIPage)obj2;
				if ((Object)(object)val == (Object)null)
				{
					throw new Exception("Failed to get the parent page");
				}
				PeakChildPage modSettingsPage = MenuAPI.CreateChildPage("ModSettings", val);
				modSettingsPage.CreateBackground((Color?)new Color(0f, 0f, 0f, 0.92f));
				PeakChildPage obj4 = modSettingsPage;
				object obj5 = <>c.<>9__17_2;
				if (obj5 == null)
				{
					UnityAction val2 = delegate
					{
						ProcessModEntries();
						RefreshOpenModTabLabels();
					};
					<>c.<>9__17_2 = val2;
					obj5 = (object)val2;
				}
				obj4.SetOnOpen((UnityAction)obj5);
				TranslationKey val3 = MenuAPI.CreateLocalization("MOD SETTINGS").AddLocalization("MOD SETTINGS", (Language)0).AddLocalization("PARAMÈTRES DU MOD", (Language)1)
					.AddLocalization("IMPOSTAZIONI MOD", (Language)2)
					.AddLocalization("MOD-EINSTELLUNGEN", (Language)3)
					.AddLocalization("AJUSTES DEL MOD", (Language)4)
					.AddLocalization("CONFIGURACIONES DEL MOD", (Language)5)
					.AddLocalization("CONFIGURAÇÕES DE MOD", (Language)6)
					.AddLocalization("НАСТРОЙКИ МОДА", (Language)7)
					.AddLocalization("НАЛАШТУВАННЯ МОДА", (Language)8)
					.AddLocalization("模组设置", (Language)9)
					.AddLocalization("模組設定", (Language)10)
					.AddLocalization("MOD設定", (Language)11)
					.AddLocalization("모드 설정", (Language)12)
					.AddLocalization("USTAWIENIA MODÓW", (Language)13);
				PeakElement val4 = ElementExtensions.SetSize<PeakElement>(ElementExtensions.SetPivot<PeakElement>(ElementExtensions.SetPosition<PeakElement>(ElementExtensions.SetAnchorMinMax<PeakElement>(ElementExtensions.ParentTo(new GameObject("Header"), (Component)(object)modSettingsPage).AddComponent<PeakElement>(), new Vector2(0f, 1f)), new Vector2(40f, -40f)), new Vector2(0f, 1f)), new Vector2(360f, 100f));
				PeakText obj6 = ElementExtensions.SetLocalizationIndex<PeakText>(ElementExtensions.ExpandToParent<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Mod Settings", "HeaderText").SetFontSize(48f), (Component)(object)val4)), val3);
				((PeakLocalizableElement)obj6).Text.fontSizeMax = 48f;
				((PeakLocalizableElement)obj6).Text.fontSizeMin = 24f;
				((PeakLocalizableElement)obj6).Text.enableAutoSizing = true;
				((PeakLocalizableElement)obj6).Text.alignment = (TextAlignmentOptions)514;
				PeakMenuButton val5 = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(ElementExtensions.SetLocalizationIndex<PeakMenuButton>(MenuAPI.CreateMenuButton("Back"), "BACK").SetColor(new Color(0.5189f, 0.1297f, 0.1718f), true), (Component)(object)modSettingsPage), new Vector2(120f, -160f)).SetWidth(120f);
				PeakElement val6 = ElementExtensions.SetSize<PeakElement>(ElementExtensions.SetPosition<PeakElement>(ElementExtensions.SetAnchorMax<PeakElement>(ElementExtensions.SetAnchorMin<PeakElement>(ElementExtensions.SetPivot<PeakElement>(ElementExtensions.ParentTo<PeakElement>(new GameObject("Content").AddComponent<PeakElement>(), (Component)(object)modSettingsPage), new Vector2(0f, 1f)), new Vector2(0f, 1f)), new Vector2(0f, 1f)), new Vector2(428f, -70f)), new Vector2(1360f, 980f));
				ModdedSettingsMenu moddedSettingsMenu = ((Component)val6).gameObject.AddComponent<ModdedSettingsMenu>();
				moddedSettingsMenu.MainPage = modSettingsPage;
				if ((Object)(object)pauseMenuHandler != (Object)null)
				{
					ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(ElementExtensions.SetLocalizationIndex<PeakMenuButton>(MenuAPI.CreateMenuButton("MOD CONTROLS"), EnsureModControlsLocalization()).SetColor(new Color(0.185f, 0.394f, 0.6226f), true), (Component)(object)modSettingsPage), new Vector2(285f, -160f)).SetWidth(200f).OnClick((UnityAction)delegate
					{
						//IL_0010: Unknown result type (might be due to invalid IL or missing references)
						//IL_001a: Expected O, but got Unknown
						((UIPageHandler)pauseMenuHandler).TransistionToPage((UIPage)(object)ModdedControlsMenu.Instance.MainPage, (PageTransistion)new SetActivePageTransistion());
					});
				}
				TranslationKey val7 = CreateChromeLocalization("PEAKMOD_SEARCH", "Search", "搜索", "搜尋", "Recherche", "Suche", "検索", "검색");
				TranslationKey key = CreateChromeLocalization("PEAKMOD_SEARCH_HERE", "Search here", "在此搜索", "在此搜尋", "Rechercher…", "Hier suchen", "検索…", "검색…");
				TranslationKey val8 = CreateChromeLocalization("PEAKMOD_MODS", "MODS", "模组", "模組", "MODS", "MODS", "MOD", "모드");
				TranslationKey val9 = CreateChromeLocalization("PEAKMOD_SECTIONS", "SECTIONS", "分区", "分區", "SECTIONS", "ABSCHNITTE", "セクション", "섹션");
				ElementExtensions.SetPosition<PeakText>(ElementExtensions.ParentTo<PeakText>(ElementExtensions.SetLocalizationIndex<PeakText>(MenuAPI.CreateText("Search"), val7), (Component)(object)modSettingsPage), new Vector2(65f, -190f));
				ElementExtensions.SetPosition<PeakTextInput>(ElementExtensions.SetSize<PeakTextInput>(ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("SearchInput"), (Component)(object)modSettingsPage), new Vector2(300f, 70f)), new Vector2(215f, -275f)).SetPlaceholder(ResolveLocalized(key, "Search here")).OnValueChanged((UnityAction<string>)moddedSettingsMenu.SetSearch);
				modSettingsPage.SetBackButton(((Component)val5).GetComponent<Button>());
				ElementExtensions.SetPosition<PeakText>(ElementExtensions.ParentTo<PeakText>(ElementExtensions.SetLocalizationIndex<PeakText>(MenuAPI.CreateText("MODS"), val8), (Component)(object)modSettingsPage), new Vector2(65f, -325f));
				PeakHorizontalTabs val10 = ElementExtensions.ParentTo(new GameObject("TABS"), (Component)(object)modSettingsPage).AddComponent<PeakHorizontalTabs>();
				PlaceVerticalModList(val10, new Vector2(55f, -390f), 320f, 600f);
				ElementExtensions.SetPosition<PeakText>(ElementExtensions.ParentTo<PeakText>(ElementExtensions.SetLocalizationIndex<PeakText>(MenuAPI.CreateText("SECTIONS"), val9), (Component)(object)val6), new Vector2(8f, 8f));
				PeakHorizontalTabs val11 = El