MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

Allow text Localization

Open fborto opened this issue 2 years ago • 0 comments

Excel Type

  • [x] XLSX
  • [ ] XLSM
  • [X] CSV
  • [ ] OTHER

Please add column name localization; actually I overrided the DisplayNameAttribute class:

    public sealed class ExcelColumnNameLocalize : DisplayNameAttribute
    {
        private ResourceManager? _resourceManager;
        private Type? _resourceType;

        public ExcelColumnNameLocalize(string displayName)
            : base(displayName)
        {
        }

        public Type? ResourceType
        {
            get => _resourceType;
            set
            {
                if (_resourceType != value)
                {
                    _resourceType = value;
                    if (value is not null)
                    {
                        _resourceManager = new ResourceManager(value);
                    }
                }
            }
        }

        public override string DisplayName => _resourceManager?.GetString(DisplayNameValue) ?? DisplayNameValue;

    }

but I prefer an integrated solution.

Thanks.

fborto avatar Mar 30 '23 10:03 fborto