Java resource bundle: Difference between revisions

Content deleted Content added
Undid revision 418755744 by 59.93.83.249 (talk) due to vandalism
Tag: section blanking
Line 1:
A resource bundle is a [[Java (software platform)|Java]] [[.properties]] file that contains [[locale]]-specific data.<ref>[http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/ O'Conner, B. ''Java Internationalization: Localization with ResourceBundles'', Sun Developer Network.]</ref> It is a way of internationalising a Java application by making the code locale-independent.
 
== Naming a resource bundle ==
Resource bundles have a naming convention to identify them when they deal with different languages. The file name is followed by an underscore and a two-letter language code ([[ISO 639-2]] code) that specifies the language that the resource bundle deals with. So, for example, an application that supports Spanish and French can have these resource bundles, respectively:
 
resbund_es.properties
resbund_fr.properties
 
This can also be followed by another underscore and a two-letter country code ([[ISO 3166-1]]). In this case, an application that supports British English and US English respectively will have the following files:
 
resbund_en_GB.properties
resbund_en_US.properties
 
== Content of a resource bundle ==