openpreserve / jhove

File validation and characterisation.
http://jhove.openpreservation.org
Other
171 stars 79 forks source link

How to switch languageCode to English? #742

Closed asciim0 closed 2 years ago

asciim0 commented 2 years ago

1.26 RC contains the feat to switch the language code using the config file. My system's default setting is German. I've managed to successfully switch the jhove output to French using

fr

in jhove.config However, I can't figure out how to switch it to English (which is what i wanted to do from the start). I've tried en, english, ENGLISH, en-US, default as input values. What's the correct parameter to enter?

carlwilson commented 2 years ago

Hi, @asciim0 I've tested and reproduced this. In theory, the Java function takes ITEF BCP 47 language tags and en is definitely valid. If I set my Linux session locale to de_DE.UTF8 I can also use fr to get french messages but en yields german error messages. I suspect that the answer is in the mapping done when loading the internationalisation resources here for the PDF module. Note that the English defaults are simply called: ErrorMessages.properties and that no ErrorMessages_en.properties exists. I think that I'll need a copy (or better still a symlink) that creates that file. I'll try to add a fix quickly as it simply adds a resource file and doesn't involve code changes.

carlwilson commented 2 years ago

I've now tested a fix based on the above idea and it works. I'll wait another day or two to see if there are any other issues to fix but will get a third RC out this week with this fix in at least.

carlwilson commented 2 years ago

fixed in v1.26