JackieTien97 opened a new pull request, #18110:
URL: https://github.com/apache/iotdb/pull/18110
## Motivation
Finish the Chinese (`zh`) locale i18n effort so that every
user/log/exception-facing message flows through a `MessagesClass` constant and
renders correctly under the zh build, and add CI to keep the zh locale from
regressing.
`iotdb` uses compile-time i18n: each participating module has twin EN / ZH
`Messages` classes swapped by the `i18n.locale` property (profile
`with-zh-locale`). The default CI only compiled the EN locale, so leftover raw
English string literals and zh-key/en-key drift could slip in untested.
## Changes
**Convert leftover raw literals → i18n constants.** 185 call-sites across
all i18n-enabled modules (datanode, confignode, node-commons, consensus,
calc-commons, client libs, library-udf, api) that set a response message, threw
an exception, or logged via `LOGGER.x(...)` with a hard-coded English literal
now reference a `*Messages` constant. Includes leading-literal conversions
(162), trailing-fragment merges into single full-message constants, and missed
siblings — e.g.
`DataNodeInternalRPCServiceImpl.getDataPartitionTableGeneratorProgress`,
`AstBuilder` "Supported formats", `WriteBackSink`.
**Exhaustive zh translation review.** Reviewed all 9258 EN/ZH constant pairs
(37 file pairs) and fixed ~1100 entries: untranslated prose (`zh == en`),
garbled/mixed-language log messages (e.g. `"任务 finishes 成功, time cost 是{} s"`),
a real output bug (`UtilMessages` doubled backslash), `",,"` double-comma
typos, and a broken-Chinese `"为 不"` typo. Terms of art (TsFile, DataRegion,
Consensus, SQL keywords, snake_case config keys, class/method names) are
intentionally kept in English; format specifiers (`%s`/`%d`/`{}`) are preserved
exactly.
**Add zh-locale CI.** New `.github/workflows/zh-locale-compile.yml` runs
`mvn clean test-compile -P with-zh-locale -DskipTests` on push/PR to
`master`/`rel/*`/`rc/*` — catches EN/ZH key-parity regressions and zh
`Messages` class compile errors the EN-only CI misses.
**Bug fix.** `ConfigurationFileUtils.acquireTargetFileLock` logged
`WAITING_TO_ACQUIRE_CONFIG_FILE_LOCK` (already the full message) concatenated
with two fragment constants that duplicated its middle/last sentences,
producing doubled output and an unbound trailing `{}`. Simplified to the single
constant; removed the now-orphaned fragments from EN + ZH.
## Verification
- `mvn test-compile -DskipTests` — **BUILD SUCCESS** (EN)
- `mvn test-compile -DskipTests -P with-zh-locale` — **BUILD SUCCESS** (ZH)
- EN/ZH parity: **9258 pairs, 0 missing / 0 extra / 0 format-specifier
mismatches**
- A targeted grep for the original literal-in-message-call pattern returns
**0** leftover slip-throughs across i18n-enabled modules
- `spotless:check` clean
🤖 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]