JackieTien97 opened a new pull request, #17613:
URL: https://github.com/apache/iotdb/pull/17613
## Summary
- Add Maven-based compile-time i18n infrastructure that switches between
English and Chinese message constants via `-Pwith-zh-locale` profile
- Zero runtime overhead: `public static final String` constants are inlined
by javac into bytecode
- Create 25 message constant classes (en + zh = 50 files) across 7 modules
- Replace 4635 hardcoded log/exception message strings with compile-time
constants
## Build commands
```bash
mvn clean package -DskipTests # English (default)
mvn clean package -DskipTests -Pwith-zh-locale # Chinese
```
## Design
- Each module has `src/main/i18n/en/` and `src/main/i18n/zh/` directories
with same-package same-class message constant files
- `build-helper-maven-plugin` adds `src/main/i18n/${i18n.locale}` as compile
source root
- Log messages use `{}` (SLF4J), exception messages use `%s` (String.format)
or plain strings
- Language determined at **compile time**, not runtime — no ResourceBundle,
no reflection
## Modules covered
| Module | Message classes | Constants |
|--------|----------------|-----------|
| node-commons | 10 | 718 |
| datanode | 5 | 2120 |
| confignode | 3 | 1068 |
| consensus | 4 | 237 |
| session | 1 | 133 |
| cli | 1 | 29 |
| jdbc | 1 | 99 |
## Test plan
- [x] `mvn compile` with default (en) profile — BUILD SUCCESS
- [x] `mvn compile -Pwith-zh-locale` — BUILD SUCCESS
- [x] `javap -c` verification: Chinese strings inlined directly into bytecode
- [ ] Integration test with Chinese build
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]