Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to overwrite a resource bundle property

Is it possible to overwrite a String property from a resource bundle that is located in a jar ?

I've been given a bunch of jars to develop an multi language application but the jars only include a single resource file, so when I set the Locale to, say, German, only the resouece file I have provided a german version for are translated of course ; the user facing strings coming from the jars are still in english.

so I was thinking I would need to duplicate and then overwrite (not great, but that's all I can think of) the property in one of the resource file in my code, so it can be translated in the other resource files that I also provide.

Is that even possible ?

Does it perhaps depends on the sequence in which the various resource bundles are loaded ?

Many thanks for your help

like image 933
dm76 Avatar asked Mar 19 '26 05:03

dm76


1 Answers

You will have to provide additional resource file per localization (de,it,fr...) requirement. Do not overwrite anything in the JAR. Go through the JARs and figure out each resource bundle file name and provide (in classpath) a localized version of it with your application.

like image 60
ring bearer Avatar answered Mar 21 '26 17:03

ring bearer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!