public string this[string name, CultureInfo culture] { get { var texts = from phrase in Phrases where phrase.Name == name from translation in phrase.Translations where translation.Culture.Equals(culture) select translation.Text; return(texts.FirstOrDefault()); } set { if (!Cultures.Any(c => c.Equals(culture))) { Cultures.Add(culture); } var phrase = Phrases.FirstOrDefault(p => p.Name == name); if (phrase == null) { phrase = new Phrase { Name = name, }; Phrases.Add(phrase); } phrase.Translations[culture].Text = value; } }
/// <summary> /// Would this eu4 culture map to this group? /// </summary> /// <returns></returns> private bool DoesMap(string eu4Culture) { if (World.V2Mapper.GetV2CultureBase(eu4Culture) == Name) { return(true); } if (Cultures.Any(c => c.Name == World.V2Mapper.GetV2CultureBase(eu4Culture))) { return(true); } if (Eu4Group?.Cultures?.Any(c => c.Name == eu4Culture) ?? false) { return(true); } return(false); }