Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List all available ResourceBundle Files

i am using ResourceBundle and I want to give the user an option to select a language for the GUI.

i want to get a list of all resource files that are under a specific package.

i don't know what resources I will have since this application is based on plug-ins.

Is there an option to ask from java to search all available resources under a package?

(if no i guess the plug-in should give all available local for it)

thank you all

like image 757
shay Avatar asked Apr 21 '10 19:04

shay


People also ask

How do I use ResourceBundle getBundle?

getBundle. Gets a resource bundle using the specified base name, locale, and class loader. This method behaves the same as calling getBundle(String, Locale, ClassLoader, Control) passing a default instance of ResourceBundle.

What is the ResourceBundle class?

ResourceBundle class is used to store text and objects which are locale sensitive. Generally we use property files to store locale specific text and then represent them using ResourceBundle object. Following are the steps to use locale specific properties file in a java based application.

How do I create a ResourceBundle?

Create a new resource bundleFrom the main menu, select File | New | Resource Bundle, or press Alt+Insert and click Resource Bundle. In the dialog that opens, specify the base name of the resource bundle. If necessary, select the Use XML-based properties files.


1 Answers

The files may reside on a web server. There is no standard way of listing files (pages) on a web server. So, in general, what you need to do is remember which locales you have resources for (perhaps create a list as part of your build process).

like image 75
Tom Hawtin - tackline Avatar answered Oct 13 '22 16:10

Tom Hawtin - tackline