private LocalizedTypeTS GetLocalizedType(LocalizedTypeChanges t, CultureInfo ci, bool isTarget) { var tc = t.TypeConflict?.TryGetC(ci); return(new LocalizedTypeTS { culture = ci.Name, typeDescription = t.TypeConflict == null || (tc == null && !isTarget) ? null : /*Message, Symbol, etc...*/ new LocalizedDescriptionTS { description = tc?.Original.Description ?? (isTarget && t.TypeConflict.Count >= 2 ? t.TypeConflict.Select(a => a.Value.Translated).Distinct().Only() : null), pluralDescription = tc?.Original.PluralDescription, gender = tc?.Original.Gender?.ToString(), translatedDescription = tc?.Translated, }, members = t.MemberConflicts.EmptyIfNull().Where(kvp => kvp.Value.ContainsKey(ci) || isTarget).Select(kvp => new LocalizedMemberTS { name = kvp.Key, description = kvp.Value.TryGetC(ci)?.Original ?? (isTarget && kvp.Value.Count >= 2 ? kvp.Value.Select(a => a.Value.Translated).Distinct().Only() : null), translatedDescription = kvp.Value.TryGetC(ci)?.Translated }).ToDictionary(a => a.name), }); }
private LocalizedTypeTS GetLocalizedType(LocalizedTypeChanges t, CultureInfo c, bool isTarget) { var tc = t.TypeConflict?.TryGetC(c); return new LocalizedTypeTS { culture = c.Name, typeDescription = t.TypeConflict == null ? null : new LocalizedDescriptionTS { description = tc?.Original.Description ?? (isTarget && t.TypeConflict.Count > 3 ? t.TypeConflict.Select(a => a.Value.Translated).Distinct().Only() : null), pluralDescription = tc?.Original.PluralDescription, gender = tc?.Original.Gender?.ToString(), translatedDescription = tc?.Translated, }, members = t.MemberConflicts.EmptyIfNull().Select(kvp => new LocalizedMemberTS { name = kvp.Key, description = kvp.Value.TryGetC(c)?.Original ?? (isTarget && kvp.Value.Count > 3 ? kvp.Value.Select(a => a.Value.Translated).Distinct().Only() : null), translatedDescription = kvp.Value.TryGetC(c)?.Translated }).ToDictionary(a => a.name), }; }