|
ColdBox Platform v3.8.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.FrameworkSupertype
coldbox.system.Plugin
coldbox.system.plugins.ResourceBundle
public class 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 |
---|
public init(any controller)
controller
Method Detail |
---|
public string formatRBString(string rbString, any substituteValues)
rbString
substituteValues
- Array, Struct or single value to format.public struct getBundles()
public string getDefaultLocale()
public string getDefaultResourceBundle()
public array getLoadedBundles()
public array getRBKeys(any rbFile, [any rbLocale=''])
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.public any getRBString(any rbFile, any rbKey, [any rbLocale='en_US'], [any default])
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 foundpublic any getResource(any resource, [any default], [any locale='[runtime expression]'], [any values], [any bundle='default'])
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'public struct getResourceBundle(any rbFile, [any rbLocale='en_US'])
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 bundlepublic string getUnknownTranslation()
public struct getVersion()
public any loadBundle(string rbFile, [string rbLocale='en_US'], [boolean force='false'], [string rbAlias='default'])
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.public string messageFormat(string thisPattern, any args, [any thisLocale=''])
thisPattern
- pattern to use in formattingargs
- substitution values, simple or arraythisLocale
- locale to use in formatting, defaults to en_USpublic boolean verifyPattern(string pattern)
pattern
- format pattern to test
|
ColdBox Platform v3.8.0 | ||||
FRAMES |