using AibisDream.Framework; namespace AibisDream.Kit { public class Param { public string Key { get; set; } public string Cn { get; set; } public string En { get; set; } public string Ja { get; set; } public string LocalizeByKind(LocaleKind kind) { switch (kind) { case LocaleKind.En: return string.IsNullOrWhiteSpace(En) ? Key : En; case LocaleKind.Ja: if (!string.IsNullOrWhiteSpace(Ja)) return Ja; return string.IsNullOrWhiteSpace(Cn) ? Key : Cn; case LocaleKind.Cn: default: return string.IsNullOrWhiteSpace(Cn) ? Key : Cn; } } } }