Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Locating locale specifiv resources

Reply
Thread Tools

Locating locale specifiv resources

 
 
Simon
Guest
Posts: n/a
 
      07-27-2009
Hi,

ResourceBundle#getBundle() [1] has a very nice strategy to lookup files
based on a locale. Is there a way to get similar functionality that just
returns a list of resources, e.g. as URLs, but leaves the loading and
the chaining to the parents to the caller?

In my case, these are XML localized documentation files, but I can
imagine that this is also useful for other applications like localized
Icons, etc.

Cheers,
Simon


[1]
http://java.sun.com/javase/6/docs/ap...ng.ClassLoader)
 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      07-27-2009
In article <>,
Simon <> wrote:

> ResourceBundle#getBundle() [1] has a very nice strategy to lookup
> files based on a locale. Is there a way to get similar functionality
> that just returns a list of resources, e.g. as URLs, but leaves the
> loading and the chaining to the parents to the caller?
>
> In my case, these are XML localized documentation files, but I can
> imagine that this is also useful for other applications like
> localized Icons, etc.
>
> [1]<http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.html>


Would extending ResourceBundle.Control [2] be of use in this? I see it
has an XML example:

[2]<http://java.sun.com/javase/6/docs/api/java/util/
ResourceBundle.Control.html>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
 
Reply With Quote
 
 
 
 
Simon
Guest
Posts: n/a
 
      07-27-2009
> Would extending ResourceBundle.Control [2] be of use in this?

Yes, that's perfect. I didn't know the class, although it is documented
very prominently in ResourceBundle. I must have missed it when 1.6 was
released.

Thanks a lot!

Cheers,
Simon
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-27-2009
On Mon, 27 Jul 2009 17:41:22 +0200, Simon <>
wrote, quoted or indirectly quoted someone who said :

>ResourceBundle#getBundle() [1] has a very nice strategy to lookup files
>based on a locale. Is there a way to get similar functionality that just
>returns a list of resources, e.g. as URLs, but leaves the loading and
>the chaining to the parents to the caller?
>
>In my case, these are XML localized documentation files, but I can
>imagine that this is also useful for other applications like localized
>Icons, etc.


A way to solve this problem if you can't do it with the docs is to
look in src.zip for the source code of getBundle. You can then see if
they have neatly partitioned the find and load logic.
--
Roedy Green Canadian Mind Products
http://mindprod.com

The USA and Iraq are as mismatched combatants as Mike Tyson and a bag lady. Americans make themselves look ridiculous when they justify invading and occupying Iraq in self defence.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
the relation between C++ locale and C locale zade C++ 1 03-05-2010 06:04 PM
Re: List of locale values for locale.setlocale() under Windows Gabriel Genellina Python 0 02-18-2009 12:00 AM
Create C++ std::locale without changing C locale dertopper@web.de C++ 4 08-26-2008 01:15 PM
i18n problem, involving Locale.getDisplayLanguage and Locale.getDisplayCountry Maurice Hulsman Java 1 07-25-2004 06:11 PM
locale.nl_langinfo(RADIXCHAR) vs locale.localeconv()['decimal_point'] Jeff Epler Python 2 08-31-2003 02:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57