WEB-INF.cftags.component coldbox.system.FrameworkSupertype coldbox.system.Plugin coldbox.system.plugins.ResourceBundle
Reads and parses java resource bundles with a nice integration for replacement and MVC usage
Constructor Summary | |
---|---|
init(any controller)
Constructor. |
Method Summary | |
---|---|
string
|
formatRBString(string rbString, any substituteValues)
performs messageFormat like operation on compound rb string. |
struct
|
getBundles()
Reference to loaded bundles. |
string
|
getDefaultLocale()
Reference to the default application locale. |
string
|
getDefaultResourceBundle()
Reference to the default application resource bundle location. |
array
|
getLoadedBundles()
Get a list of all loaded bundles. |
array
|
getRBKeys(any rbFile, [any rbLocale=''])
Returns an array of keys from a specific resource bundle. |
any
|
getRBString(any rbFile, any rbKey, [any rbLocale='en_US'], [any default])
Returns a given key from a specific resource bundle file and locale. |
any
|
getResource(any resource, [any default], [any locale='[runtime expression]'], [any values], [any bundle='default'])
Get a resource from a specific loaded bundle and locale. |
struct
|
getResourceBundle(any rbFile, [any rbLocale='en_US'])
Reads,parses and returns a resource bundle in struct format. |
string
|
getUnknownTranslation()
Reference to the default application unknown translation string. |
struct
|
getVersion()
Returns version of this CFC and java library it uses. |
any
|
loadBundle(string rbFile, [string rbLocale='en_US'], [boolean force='false'], [string rbAlias='default'])
Tries to load a resource bundle into ColdBox memory if not loaded already. |
string
|
messageFormat(string thisPattern, any args, [any thisLocale=''])
performs messageFormat on compound rb string. |
boolean
|
verifyPattern(string pattern)
Performs verification on MessageFormat pattern. |
Methods inherited from class WEB-INF.cftags.component |
---|
None |
Constructor Detail |
---|
Constructor
controller
Method Detail |
---|
performs messageFormat like operation on compound rb string. So if you have a string with {1} it will replace it. You can also have multiple and send in an array to do replacements.
rbString
substituteValues
- Array, Struct or single value to format.Reference to loaded bundles
Reference to the default application locale
Reference to the default application resource bundle location
Get a list of all loaded bundles
Returns an array of keys from a specific resource bundle
rbFile
- This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.rbLocale
- The locale to use, if not passed, defaults to default locale.Returns a given key from a specific resource bundle file and locale. NOT FROM MEMORY
rbFile
- This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.rbKey
- The key to retrieverbLocale
- The locale of the bundle. Default is en_USdefault
- A default value to send back if resource not foundGet a resource from a specific loaded bundle and locale
getResource
in class
FrameworkSupertype
resource
- The resource (key) to retrieve from the main loaded bundle.default
- A default value to send back if the resource (key) not foundlocale
- Pass in which locale to take the resource from. By default it uses the user's current set localevalues
- An array, struct or simple string of value replacements to use on the resource stringbundle
- The bundle alias to use to get the resource from when using multiple resource bundles. By default the bundle name used is 'default'Reads,parses and returns a resource bundle in struct format
rbFile
- This must be the path + filename UP to but NOT including the locale. We auto-add the local and .properties to the end.rbLocale
- The locale of the resource bundleReference to the default application unknown translation string
Returns version of this CFC and java library it uses.
Tries to load a resource bundle into ColdBox memory if not loaded already
rbFile
- This must be the path + filename UP to but NOT including the locale. We auto-add .properties to the end alongside the localerbLocale
- The locale of the bundle to loadforce
- Forces the loading of the bundle even if its in memoryrbAlias
- The unique alias name used to store this resource bundle in memory. The default name is the name of the rbFile passed if not passed.performs messageFormat on compound rb string
thisPattern
- pattern to use in formattingargs
- substitution values, simple or arraythisLocale
- locale to use in formatting, defaults to en_USPerforms verification on MessageFormat pattern
pattern
- format pattern to test