Resource Bundles in different packages
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Bates
Posted On:   Tuesday, June 17, 2003 06:11 AM

I've written an framework which has a number of packages: - framework + locale - generic - uk - fr The idea being that you may write specific components for your country in a separate package. What I then wanted to do would be to have a property resource file in each subpackage detailing the language mappings: [ERR1] = "You have entered an incorrect user ID" [ERR2] = "You have entered an incorrect password" ... However, it appears that ResourceBundle and its derivations do not work like this, demanding that all ResourceBundles be within the same package! This seems strange (.NET doesn't work like this). The only w   More>>

I've written an framework which has a number of packages:

			
- framework
+ locale
- generic
- uk
- fr

The idea being that you may write specific components for your country in a separate package. What I then wanted to do would be to have a property resource file in each subpackage detailing the language mappings:
			
[ERR1] = "You have entered an incorrect user ID"
[ERR2] = "You have entered an incorrect password"
...

However, it appears that ResourceBundle and its derivations do not work like this, demanding that all ResourceBundles be within the same package! This seems strange (.NET doesn't work like this).



The only way I can think of getting round this is to use a custom class loader which searches the language packages.



Any ideas?



Cheers,



David.    <<Less

Re: Resource Bundles in different packages

Posted By:   Zac_Jacobson  
Posted On:   Tuesday, June 17, 2003 12:24 PM

It's not so strange.. and not all ResourseBundles have to be within the same package, but all locales for the same ResourceBundle do. Maybe thinking about it like this will let you make a different logical rearrangement - group your language stuff by error messages, information messages, widget values.. something like that instead of by language.
About | Sitemap | Contact