Added resource-based localization for column attributes#967
Conversation
…n and MiniExcelColumnName attributes
There was a problem hiding this comment.
Code Review
This pull request introduces resource-based localization for MiniExcelColumnAttribute and MiniExcelColumnNameAttribute, allowing column names to be resolved dynamically from .NET resource files. The changes include updates to the core attributes, logic adjustments in ColumnMappingsProvider to support localized name resolution, and comprehensive test coverage for multiple cultures. Review feedback highlights an issue where GetColumnName returns an empty string instead of null, which would break the fallback logic in the mapping provider. Additionally, it is recommended to refactor the duplicated ResourceManager initialization logic into a shared base class or helper method to improve maintainability.
There was a problem hiding this comment.
Code Review
This pull request introduces resource-based localization support for MiniExcel attributes, allowing column names to be resolved from .resx files. The review identifies several issues, including a breaking change caused by renaming the public 'ExcelColumnName' property and a bug in the 'Init' method that prevents 'IndexName' from being updated correctly. Other feedback points to flawed 'ResourceManager' resolution logic, inconsistent return values that break naming fallbacks, and potential compatibility concerns regarding the use of the C# 13 'field' keyword.
Introduced resource-based localization for column names by adding
ResourceTypesupport andResourceManagerresolution toMiniExcelColumnAttributeandMiniExcelColumnNameAttribute, added unit tests covering localization for some cultures, and updated README to document the feature usage.Resolves #478