Am 11.02.25 um 15:22 schrieb Christopher Schultz:
Rainer,

On 2/11/25 9:07 AM, Christopher Schultz wrote:
Rainer,

On 2/11/25 3:18 AM, Rainer Jung wrote:
Hi Chris,

Am 11.02.25 um 00:18 schrieb Christopher Schultz:
Rainer,

On 2/10/25 11:11 AM, Rainer Jung wrote:
Am 10.02.25 um 17:02 schrieb Mark Thomas:
On 10/02/2025 13:55, Christopher Schultz wrote:

Assuming we agree that the official releases of Tomcat should have documentation in English, then I have a further proposal:

+1

  - Add "locale" attribute to the <javadoc> tasks in the build with
    an explicit locale

+1

For release-managers, I will update the pre-release target to include javadoc-locale=en_US (or en_GB or just 'en' if we like).

I don't think it matters. Anything that varies (e.g. date format) we already use an unambiguous form anyway.

In build.properties.default, I will set javadoc-locale to ${user.language}.

I think that is fine since .release takes priority over .default

This should allow anyone downstream to build javadocs in their own language (either via git clone or pulling the source and removing the javadoc-locale in build.properties.release) and also users in non- English default locales to verify a release build.

Now that I've written the above paragraph, it does mean that it's not trivial for a user to build the javadocs in their own language. I'd love to hear some suggestions for how to do that with an official source package. Maybe the "release" target can set the locale somehow. ATM, the <property> tasks that set up all the properties are outside any target and apply before any targets get to run, so they cannot be conditional. We could change that if we want to, though...

build.properties always takes priority so they just need to set a locale in there.

II agree with everything but note that IMHO at least on Linux the environment variable LANG takes precedence. I could not build english javadocs with the javascript locale attribute or user.lang or whatever Java properties when LANG pointed to a german locale.

Thanks for the clarification.

I'm sorry if you've answered this already, but if you add locale="en" to the javadoc task:

<javadoc [stuff]
   locale="en"
   ...
</javadooc>

When I did this with "export LANG=de" on MacOS, I was able to get English-language javadoc UI. But... I was NOT able to get German- language javadoc by setting "export LANG=de" and not-specifying the locale in <javadoc>.

Setting the env var LANG to de_DE.UTF-8 - which is the default on my system - and adding locale="en" to the 7 or so <javadoc> calls in build.xml and rebuilding everything still produces javadoc files with german template text. Example: files package-tree.html contain the word "Klassenhierarchie" (class hierarchy) and "Baum" (tree) etc.

Tested for TC 11 and using Java jdk-23.0.2+7 (Adoptium).

Okay, I'll try to reproduce that. Maybe my naive setting of LANG=de wasn't enough.

Do you have other variables set such as LC_* or anything like that?

When I use LANG=de_DE.UTF-8, I still get English javadoc (!!).

The only way I've been able to get German javadoc is to specify locale="de" in the build.xml file.

Perhaps it's the OS setting that's being picked-up by the JVM and not the environment variable?

I'm really surprised that <javadoc locale="en"> isn't working for you. Javadoc always runs in a forked JVM and so setting the locale on the task should always be working.

I might have to try this in a Linux VM to get better answers.

One more thing: if you run "ant javadoc" and watch for javadoc launches, are you able to verify that you get a command-line like this showing up during the build?

/path/to/bin/javadoc -locale de -d /path/to/tomcat/output/dist/webapps/ docs/api -windowtitle Apache Tomcat 10.1.35 API Documentation -encoding UTF-8 -docencoding UTF-8 -charset UTF-8 [...]

Note the "-locale de" in the command string. With locale="en" I would hope you'd get a "-locale en" on your command-line.

If I add en locale to javadoc in build.xml the javadoc command is executed with -locale en but still uses german text.

It can be seen already when called with "--help". Setting the locale does not change the language of the help output.

After reading

https://bugs.openjdk.org/browse/JDK-8222793?focusedId=14315060&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel

I added

-J-Duser.language=en -J-Duser.country=US

and then the help text switches to en. Not sure whether we can add that to build.xml.

I've just committed a simple patch to main where build.properties.default (or build.properties, if you have one) can specify javadoc.locale. It's set to "en" by default.

Does that change anything at all for you?

I did not yet try but in the light of the above, setting the locale is not enough.

Best regards,

Rainer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to