-
Notifications
You must be signed in to change notification settings - Fork 439
表头国际化 #653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
表头国际化 #653
Conversation
There was a problem hiding this 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
已调整代码结构。去掉版本不一致的引入 |
There was a problem hiding this 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
ExcelMessageSourceinterface for header translation withresolveCode()andaddMessage()methods - Added
messageSourceconfiguration field toGlobalConfiguration,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.
fesod/src/main/java/org/apache/fesod/excel/util/ClassUtils.java
Outdated
Show resolved
Hide resolved
fesod/src/main/java/org/apache/fesod/excel/il8n/ExcelMessageSource.java
Outdated
Show resolved
Hide resolved
fesod/src/main/java/org/apache/fesod/excel/util/ClassUtils.java
Outdated
Show resolved
Hide resolved
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/WriteTest.java
Outdated
Show resolved
Hide resolved
fesod/src/main/java/org/apache/fesod/excel/read/metadata/holder/ReadWorkbookHolder.java
Outdated
Show resolved
Hide resolved
fesod/src/main/java/org/apache/fesod/excel/metadata/GlobalConfiguration.java
Outdated
Show resolved
Hide resolved
fesod-examples/src/test/java/org/apache/fesod/excel/demo/write/WriteTest.java
Outdated
Show resolved
Hide resolved
fesod-examples/src/test/java/org/apache/fesod/excel/demo/read/AutoMessageSource.java
Outdated
Show resolved
Hide resolved
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>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hi, @GGBOUNDBOY
Especially regarding the code style, please execute |
|
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. |
|
Let me be more explicit: I won't merge this PR at this time.
We welcome all contributors, but submitting large amounts of code without prior discussion makes code review extremely difficult. 我更直白的表达一下:我目前不会合并改PR。
我们欢迎所有的贡献者,但是没有经过前期沟通,提交太多的代码会让code-review 变得困难。 |
Purpose of the pull request
#196 增加导入导出表头国际化
What's changed?
Checklist