You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "michael-o (via GitHub)" <gi...@apache.org> on 2026/03/01 19:23:32 UTC

[PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

michael-o opened a new pull request, #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623

   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
   - [ ] Your pull request should address just one issue, without pulling in other changes.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
     Note that commits might be squashed by a maintainer on merge.
   - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
     This may not always be possible but is a best-practice.
   - [ ] Run `mvn verify` to make sure basic checks pass.
     A more thorough check will be performed on your pull request automatically.
   - [ ] You have run the integration tests successfully (`mvn -Prun-its verify`).
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
   - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2873882238


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   Two reasons:
   * I have designed identically to Java's system properties for that
   * I didn't use the mentioned method because I didn't want to be inconsistent how to accept the locale string, namely reverse `#toString()`.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2874767208


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   > I know, but to me the `user` infix is still not very reasonable. I would rather deviate from the JVM naming here
   
   Yep, had the same feeling. It was worth a try. Will worth on a better draft end of week.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2873899788


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   I can merge into one properly and pull up the parse method into the interface as a static method.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#issuecomment-5327923410

   > Summary of where this stands, since the threads are spread across two days in March and the PR has been quiet since.
   > 
   > **The change:** `SiteTool.DEFAULT_LOCALE` becomes configurable from system properties instead of being fixed at `Locale.ROOT`, using three properties mirroring the JVM's own `user.language` / `user.country` / `user.variant`.
   > 
   > **Two review points, both from @kwin, neither yet resolved in the code:**
   > 
   >     1. _Three properties or one._ @kwin asked for a single property parsed with `Locale#forLanguageTag`. @michael-o's reasons for three were consistency with the JVM and with the reverse of `Locale#toString()`, then offered: _"I can merge into one propert[y] and pull up the parse method into the interface as a static method."_ Agreed in principle, not yet done.
   > 
   >     2. _The `user` infix._ @kwin: _"the `user` infix is still not very reasonable, I would rather deviate from the JVM naming here."_ @michael-o: _"Yep, had the same feeling. It was worth a try. Will work on a better draft end of week."_ Also agreed, also not yet done.
   > 
   > 
   > So both open points already have agreement on direction — this is waiting on a redraft, not on a decision. The last exchange (17 March) then moved to release timing and concluded this has no Doxia release implications.
   > 
   > Two things worth noting for whoever picks it up: `new Locale(...)` is deprecated for direct construction in newer JDKs in favour of `Locale.of` or `forLanguageTag`, which points the same way as review point 1; and the current form silently yields `Locale.ROOT` when the properties are unset, which is the existing behaviour and worth keeping explicit in whatever replaces it.
   > 
   > _This comment was created with AI assistance._
   
   This is reasonable, but since the code revolves around `Locale#toString()` format so should the parser be. I'd like ot have a single JVM property for this as long as a static method will properly parse the string into a locale object.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2874691554


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   I know, but to me the `user` infix is still not very reasonable. I would rather deviate from the JVM naming here



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "slachiewicz (via GitHub) via issues" <is...@maven.apache.org>.
slachiewicz closed pull request #623: Make default locale configurable on JVM level
URL: https://github.com/apache/maven-doxia-sitetools/pull/623


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2874047500


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   > Two reasons:
   > 
   > * I have designed identically to Java's system properties for that
   > * I didn't use the mentioned method because I didn't want to be inconsistent how to accept the locale string, namely reverse `#toString()`.
   
   I don't particularly like the choice of JVM: https://www.oracle.com/technical-resources/articles/javase/locale.html#using. Since Locale.forLanguage(...) was introduced only with 1.7 is probably the reason why they split it up. Also the `user` infix is really weird, as this is not at all bound to a specific user.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "slachiewicz (via GitHub) via issues" <is...@maven.apache.org>.
slachiewicz commented on PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#issuecomment-6635856924

   Carried in #732, with your commit kept as authored and the review points settled in commits on top (a single `maven.doxiaSitetools.defaultLocale` property, plus a fix for the parent descriptor fallback). Closing this in favour of #732.
   


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2873708120


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   Why do we need three different properties, let us use https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#forLanguageTag-java.lang.String- and get the language tag from a single property.
   Also regarding the property name I find `user` in it confusing. I would propose just `maven.doxia.sitetools.default.locale`.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#discussion_r2874583032


##########
doxia-integration-tools/src/main/java/org/apache/maven/doxia/tools/SiteTool.java:
##########
@@ -43,7 +43,10 @@ public interface SiteTool {
      *
      * @see Locale#ROOT
      */
-    Locale DEFAULT_LOCALE = Locale.ROOT;
+    Locale DEFAULT_LOCALE = new Locale(

Review Comment:
   `user` is again from the JVM.  I sticked to well-known property names.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Make default locale configurable on JVM level [maven-doxia-sitetools]

Posted by "slachiewicz (via GitHub)" <gi...@apache.org>.
slachiewicz commented on PR #623:
URL: https://github.com/apache/maven-doxia-sitetools/pull/623#issuecomment-5326556448

   Summary of where this stands, since the threads are spread across two days in March and the PR has been quiet since.
   
   **The change:** `SiteTool.DEFAULT_LOCALE` becomes configurable from system properties instead of being fixed at `Locale.ROOT`, using three properties mirroring the JVM's own `user.language` / `user.country` / `user.variant`.
   
   **Two review points, both from @kwin, neither yet resolved in the code:**
   
   1. *Three properties or one.* @kwin asked for a single property parsed with `Locale#forLanguageTag`. @michael-o's reasons for three were consistency with the JVM and with the reverse of `Locale#toString()`, then offered: *"I can merge into one propert[y] and pull up the parse method into the interface as a static method."* Agreed in principle, not yet done.
   
   2. *The `user` infix.* @kwin: *"the `user` infix is still not very reasonable, I would rather deviate from the JVM naming here."* @michael-o: *"Yep, had the same feeling. It was worth a try. Will work on a better draft end of week."* Also agreed, also not yet done.
   
   So both open points already have agreement on direction — this is waiting on a redraft, not on a decision. The last exchange (17 March) then moved to release timing and concluded this has no Doxia release implications.
   
   Two things worth noting for whoever picks it up: `new Locale(...)` is deprecated for direct construction in newer JDKs in favour of `Locale.of` or `forLanguageTag`, which points the same way as review point 1; and the current form silently yields `Locale.ROOT` when the properties are unset, which is the existing behaviour and worth keeping explicit in whatever replaces it.
   
   *This comment was created with AI assistance.*


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org