I18n через jsonb-поля
This commit is contained in:
@@ -5,6 +5,7 @@ using Pf2eModel;
|
||||
using Pf2eModel.Model;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using System.ComponentModel;
|
||||
|
||||
@@ -70,11 +71,11 @@ internal class EntityConverter : JsonConverter
|
||||
|
||||
private void ProcessTrait(Dictionary<string, object?> dictionary, Trait trait)
|
||||
{
|
||||
string name = trait.Entity?.Name ?? _context.Entities.Where(e => e.Id == trait.Id).Select(e => e.Name).FirstOrDefault()!;
|
||||
LocaleString name = trait.Entity?.Name ?? _context.Entities.Where(e => e.Id == trait.Id).Select(e => e.Name).FirstOrDefault()!;
|
||||
|
||||
dictionary.Remove("Entity");
|
||||
dictionary.Remove("Entities");
|
||||
dictionary.Add("Name", name);
|
||||
dictionary.Add("Name", name.ToString());
|
||||
}
|
||||
|
||||
private void ProcessEntity(Dictionary<string, object?> dictionary, Entity entity)
|
||||
|
||||
@@ -296,7 +296,7 @@ public partial class MainViewForm : Form
|
||||
private class EntityGridRow(Entity e)
|
||||
{
|
||||
public int Id { get; set; } = e.Id;
|
||||
public string Name { get; set; } = e.Name;
|
||||
public string Name { get; set; } = e.Name.ToString();
|
||||
public EntityRarity Rarity { get; set; } = e.Rarity;
|
||||
|
||||
private readonly Entity _e = e;
|
||||
|
||||
Reference in New Issue
Block a user