Class PoResourceBundle
ResourceBundle.
All texts of autumo-ui and of the running application are gettext PO
catalogues, lang/messages.<lang>.po below a base resource path. This bundle
merges the catalogues of the given base resource paths in the order they are passed
— the first catalogue wins — so an application only has to ship the PO files of its
own texts and everything else comes from the autumo-ui framework
(/ch/autumo/ui/lang/messages.<lang>.po). An application may nevertheless
override any framework text by defining its key.
The PO files are parsed once per instance; autumo-ui caches the bundle per base
resource path and language (Helper.getMessageBundle(String)) and clears the
cache on a language change (Helper.setLanguage(String)). Because
handleGetObject(String) returns null for an unknown key, callers can
apply their own fallback (see
Helper.getText(ch.autumo.ui.fx.BaseApp, String, String)) or simply show the
message id.
-
Nested Class Summary
Nested classes/interfaces inherited from class ResourceBundle
ResourceBundle.Control -
Field Summary
Fields inherited from class ResourceBundle
parent -
Constructor Summary
ConstructorsConstructorDescriptionPoResourceBundle(String lang, String... baseResourcePaths) Creates a bundle from the PO catalogues of the given base resource paths. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) getKeys()protected ObjecthandleGetObject(String key) Methods inherited from class ResourceBundle
clearCache, clearCache, getBaseBundleName, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getBundle, getLocale, getObject, getString, getStringArray, handleKeySet, keySet, setParent
-
Constructor Details
-
PoResourceBundle
-
-
Method Details
-
handleGetObject
Returns
nullwhen no merged catalogue defines the key.- Specified by:
handleGetObjectin classResourceBundle
-
getKeys
- Specified by:
getKeysin classResourceBundle
-
containsKey
- Overrides:
containsKeyin classResourceBundle
-