private string getLocalizedName(global::JetKarmaBot.Models.AwardType awardType, Locale loc) { if (loc.ContainsKey($"jetkarmabot.awardtypes.accusative.{awardType.CommandName}")) { return(loc[$"jetkarmabot.awardtypes.accusative.{awardType.CommandName}"]); } else { return(awardType.Name); } }
private string getLocalizedCMDDesc(IChatCommand cmd, Locale loc) { if (loc.ContainsKey(cmd.DescriptionID)) { return(loc[cmd.DescriptionID]); } else { return(cmd.Description); } }
private string getLocalizedCMDArgDesc(ChatCommandArgument arg, Locale loc) { if (loc.ContainsKey(arg.DescriptionID)) { return(loc[arg.DescriptionID]); } else { return(arg.Description); } }
public Grid AddLocale(string key, string value) { if (Locale.ContainsKey(key)) { Locale[key] = value; } else { Locale.Add(key, value); } return(this); }
public override bool Validate(FieldInfo fieldInfo, object fieldValue, Type configType, object configValue, string name, ConfigFieldInfo[] confFieldInfos) { var key = fieldValue as string; if (string.IsNullOrEmpty(key)) { using (var block = new ConsoleOutputErrorBlock()) { Console.WriteLine("{0}.xml elementId {1} 发现不存在的locale", name, TypeUtil.FindConfigKeyValue(configType, configValue)); } } if (!Locale.ContainsKey(key)) { using (var block = new ConsoleOutputErrorBlock()) { Console.WriteLine("{0}.xml elementId {1} 发现不存在的locale {2}", name, TypeUtil.FindConfigKeyValue(configType, configValue), fieldValue); } } return(true); }