You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Neal Haggard <Ne...@sas.com> on 2005/03/25 00:09:58 UTC

Request for suggestions on Resource Bundle keys?

I noticed in JSF In Action (Mann) that he had all his resource bundle keys that he was going to use in his JSF views defined more like standard variables than standard resource bundle keys.  For example:

PathNotFound=Path {0} not found.

Internally, we have tools which will do internationalization for us, but they rely on suffixes on resource bundle keys (namely .txt if it's something that should be translated automatically).  So I would have to have:

PathNotFound.txt=Path {0} not found.

Obviously, I can't use this in a value binding expression (i.e. #{myBundle.PathNotFound.txt}) as it will be looking for a .txt attribute off the PathNotFound object.  

I was hoping that maybe I could get away with treating the bundle as a map, like:  #{myBundle['PathNotFound.txt']}, however no dice, I'm getting a 'Missing' error for keys that are defined that way.

As a note, I wrote in a test key using the syntax that is prescribed, and it will appear properly, so it's not that my resource bundle isn't being loaded.

Any ideas on how to get around this?

Thanks,

Neal