klyn.i18n.ResourceBundle.load
method
public static load(notnull baseName as String, notnull locale as Locale = Locale.default, notnull loader as ClassLoader = ClassLoader.system) as ResourceBundle
Description

Loads and caches a resource family from the active class path. Class-based bundles must have a public parameterless constructor and extend ResourceBundle. Properties files use UTF-8, with ISO-8859-1 fallback for malformed UTF-8. Successful loads are cached per loader, family, requested locale and default locale until clearCache; failures are not.

Parameters
ParameterDescription
baseNameDotted family name, without extension or locale suffix.
localeRequested language/country; defaults to Locale.default.
loaderLoader used for classes and resources.
Returns

Best available localized bundle and its parent chain.

Throws
  • MissingResourceException if no candidate exists.
  • ValueException if the family name is invalid or properties malformed.
  • IOException if a resource cannot be read.
  • NullException for null mandatory arguments at runtime.
Example

messages = ResourceBundle.load("messages.Labels", Locale("fr", "CA"))