Skip to content

Conversation

@GGBOUNDBOY
Copy link

@GGBOUNDBOY GGBOUNDBOY commented Oct 20, 2025

Purpose of the pull request

#196 增加导入导出表头国际化

What's changed?

  1. 增加全局配置 MessageSource,用于表头信息保存与表头信息转换,默认为空,即保持不转换表头,如设置此配置项,当注解ExcelProperty的value值与词条code对应时转换成相应表头,如不匹配,则保持原表头。使用方可自行实现MessageSource接口,实现基于自身项目的国际化功能。

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@psxjoy psxjoy self-requested a review October 20, 2025 09:16
Copy link
Member

@psxjoy psxjoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No proposal,No issue ,all unit-test failed.
-1

@GGBOUNDBOY GGBOUNDBOY closed this Oct 21, 2025
@GGBOUNDBOY GGBOUNDBOY reopened this Oct 21, 2025
@GGBOUNDBOY
Copy link
Author

GGBOUNDBOY commented Oct 21, 2025

No proposal,No issue ,all unit-test failed. -1

已调整代码结构。去掉版本不一致的引入

@GGBOUNDBOY GGBOUNDBOY requested a review from psxjoy October 21, 2025 02:11
@psxjoy psxjoy requested a review from Copilot October 21, 2025 02:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds internationalization (i18n) support for Excel column headers by introducing a new ExcelMessageSource interface and configuration. When configured, the system translates header codes (specified in @ExcelProperty annotations) into localized text based on the current locale. If no translation is found or no message source is configured, headers remain unchanged.

Key Changes:

  • Introduced ExcelMessageSource interface for header translation with resolveCode() and addMessage() methods
  • Added messageSource configuration field to GlobalConfiguration, BasicParameter, and related classes
  • Modified ClassUtils.declaredOneField() to translate headers using the configured message source

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
ClassUtils.java Implements header translation logic via new getIl8nHeads() method
GlobalConfiguration.java Adds messageSource field for global i18n configuration
BasicParameter.java Adds messageSource field to parameter configuration
AbstractParameterBuilder.java Adds messageResource() builder method for configuring message source
AbstractHolder.java Propagates message source to global configuration
ReadWorkbook.java Adds messageSource field to read workbook metadata
ReadWorkbookHolder.java Propagates message source from workbook to holder
ExcelMessageSource.java Defines interface for header internationalization
WriteTest.java Adds test case demonstrating i18n header writing
ReadTest.java Adds test cases for reading i18n headers in different locales
Il8nZhHeadDemoData.java Test data class with i18n-ready header codes
Il8nHeadDemoDataListener.java Listener for i18n header read tests
AutoMessageSource.java Sample implementation of ExcelMessageSource

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

GGBOUNDBOY and others added 9 commits October 21, 2025 14:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…urce.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/WriteTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r/ReadWorkbookHolder.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/WriteTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…AutoMessageSource.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…iguration.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@delei delei marked this pull request as draft October 21, 2025 06:23
@GGBOUNDBOY GGBOUNDBOY marked this pull request as ready for review October 21, 2025 06:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@delei
Copy link
Member

delei commented Oct 21, 2025

Hi, @GGBOUNDBOY
Welcome, I recommend that you first read or refer to our Contributor Guide.

Especially regarding the code style, please execute mvn spotless:apply in your local development environment to automatically format the code.

@delei
Copy link
Member

delei commented Oct 21, 2025

I have converted this PR to a draft. Please continue to optimize the code and wait for all the CI tests to pass before request the review.

@delei delei marked this pull request as draft October 21, 2025 06:45
@psxjoy
Copy link
Member

psxjoy commented Oct 21, 2025

Let me be more explicit: I won't merge this PR at this time.

  1. The issue hasn't been claimed;
  2. The proposed changes weren't discussed beforehand;
  3. Basic formatting wasn't done according to the contribution guidelines (though this isn't critical—we can assist with that);
  4. Last but not least: none of the test cases passed.

We welcome all contributors, but submitting large amounts of code without prior discussion makes code review extremely difficult.

我更直白的表达一下:我目前不会合并改PR。

  1. 没有在issue 认领;
  2. 修改的方案并没有进行简单的前期沟通;
  3. 没有按照贡献指南进行简单的处理(当然这个不重要,我们可以协助修改)
  4. 最后:所有的测试用例都没有通过。

我们欢迎所有的贡献者,但是没有经过前期沟通,提交太多的代码会让code-review 变得困难。

@GGBOUNDBOY GGBOUNDBOY marked this pull request as ready for review October 21, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants