resource bundle
A set of locale-specific texts, looked up by key, that ResourceBundle.getBundle chooses for a locale.
In more detail
getBundle searches the requested locale's files from most to least specific, then the default locale's, then the base bundle. A key missing from the chosen bundle is looked up in its parents. A key found nowhere throws MissingResourceException.
Example
ResourceBundle.getBundle("Labels", Locale.CANADA_FRENCH).getString("greeting")Related terms
- locale — A java.util object naming a language and optionally a country and variant, used to format text, numbers and dates for that audience.
Taught in
- Locales, Resource Bundles And Formatting — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Sprint: I/O And Localization — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Mock Exam: Sit It, Score It — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep