ClassLoader.getResources vs Module.getResourceAsStream
Alan Bateman
Alan.Bateman at oracle.com
Mon Jul 16 13:49:38 UTC 2018
On 16/07/2018 14:08, Bernard Amade wrote
> after java 8
> the case of internationalisation is the worst case of resource handling:
> - creating diverse resource files (for different cultural contexts) means they might be spread along different jars
> (you receive an app in your country - that uses a strange language- ... then you create a specific deployment jar and add it to the app)
> - since it is impossible to have the same "directory" (oups I mean "package") in different modules/jars it is required to create a special code to find the real directory
> this is super-clumsy!
> please find a simpler approach ! (even if it entails exceptions to some principles)
This sounds like a complaint about ResourceBundle. Best to start a new
thread if you have issues or suggestions for how it can be improved.
Also keep in mind that a huge effort went into getting ResourceBundle to
work with modules and there are several options for deploying
translations in different JAR files or modules (esp. if these
translation are .properties files rather than compiled resources). The
options are detailed in the ResourceBundle javadoc [1].
-Alan
[1]
https://download.java.net/java/early_access/jdk11/docs/api/java.base/java/util/ResourceBundle.html
More information about the jigsaw-dev
mailing list