JackieTien97 opened a new pull request, #17716:
URL: https://github.com/apache/iotdb/pull/17716

   ## Summary
   
   TsFile [PR #820](https://github.com/apache/tsfile/pull/820) adds runtime 
i18n for log/exception messages, selected at JVM startup via 
`-Dtsfile.locale=zh` (or `Locale.getDefault()`). The PR description explicitly 
asks IoTDB's Chinese build to pass that option from the startup scripts.
   
   This change wires the `with-zh-locale` Maven profile to do exactly that — 
packaged Chinese builds now also get Chinese messages from tsfile, with no 
change required on the user's side.
   
   ## Mechanism
   
   A single small file `conf/iotdb-locale.{sh,bat}` holds the JVM option behind 
a Maven placeholder:
   
   ```sh
   TSFILE_LOCALE_JVM_OPT=\"@tsfile.locale.opt@\"
   ```
   
   - Default build: filtered to `\"\"` → no JVM option appended.
   - `with-zh-locale` build: filtered to `\"-Dtsfile.locale=zh\"` → appended to 
`IOTDB_JMX_OPTS` / `CONFIGNODE_JMX_OPTS`.
   
   The existing complex `datanode-env.{sh,bat}` and `confignode-env.{sh,bat}` 
are copied unchanged; they each `source` / `CALL` the locale file on startup 
and append `\$TSFILE_LOCALE_JVM_OPT` only when non-empty. Filtering is isolated 
to the tiny new file so the existing scripts' `\${item_arr[@]}` and `@REM` 
patterns can't be misinterpreted by the Maven filter.
   
   ## Files changed
   
   - `pom.xml` — new property `tsfile.locale.opt` (empty by default; 
`-Dtsfile.locale=zh` under `with-zh-locale`)
   - `scripts/conf/iotdb-locale.sh` (new) + 
`scripts/conf/windows/iotdb-locale.bat` (new)
   - `scripts/conf/datanode-env.sh`, `scripts/conf/confignode-env.sh`, and the 
Windows `.bat` counterparts — source the locale file
   - 6 assembly XMLs add a filtered fileSet for `iotdb-locale.*`: 
`iotdb-core/datanode/src/assembly/server.xml`, 
`iotdb-core/confignode/src/assembly/confignode.xml`, 
`distribution/src/assembly/{datanode,confignode,all}.xml`, 
`integration-test/src/assembly/mpp-test.xml`
   
   ## Test plan
   
   - [x] Built `iotdb-core/datanode` with default profile — packaged 
`conf/iotdb-locale.sh` resolves to `TSFILE_LOCALE_JVM_OPT=\"\"`
   - [x] Built `iotdb-core/datanode` with `-P with-zh-locale` — packaged 
`conf/iotdb-locale.sh` resolves to 
`TSFILE_LOCALE_JVM_OPT=\"-Dtsfile.locale=zh\"`; same result for the `.bat`
   - [x] Repeated for `iotdb-core/confignode` — both `.sh` and `.bat` filter 
correctly
   - [x] Verified `datanode-env.sh` is copied unchanged (filter is scoped to 
`iotdb-locale.*` only) and that the new \"Apply tsfile locale\" block appears 
in the packaged file
   
   ## Scope note
   
   Covers DataNode and ConfigNode, the heavy tsfile users called out in the 
tsfile PR. CLI (`start-cli.sh`) and `scripts/tools/*.sh` don't currently source 
these env files; can be extended separately if needed.
   
   Pairs with apache/tsfile#820 — no coordinated release required, since the 
tsfile JAR ships a single artifact and tsfile falls back to English when the 
option is absent.


-- 
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]

Reply via email to