@Immutable public interface ResourceBundleLoader
ResourceBundles of the correct type and locale
and loads them into a map for consumption in JIRA. This search will iterate through language packs
(which are plugins), general plugins and JIRA's own static resources to find all the ResourceBundles
and merge them into one.
The search must be limited to a particular Locale and resource type. JIRA currently supports
the following resource types:
The only safe way to obtain ResourceBundleLoader is to inject it. Initially, this instance will be
configured to search for language resources using JIRA's default Locale. These settings cannot be changed
once the object is created, however, it is easy to create new instances with the correct settings using the
locale(java.util.Locale), helpText() and i18n(). For example:
@Inject
private ResourceBundleLoader initial;
public void doSomething() {
//Search for the HelpPath resources associated with the US locale.
LoadResult result = initial.locale(Locale.US).helpPath().load();
}
This object is immutable and may safely be cached and/or shared between threads.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ResourceBundleLoader.LoadResult
Result of the load operation.
|
| Modifier and Type | Method and Description |
|---|---|
ResourceBundleLoader |
helpText()
Returns a loader that will search for resources associated with
HelpUrls. |
ResourceBundleLoader |
i18n()
Returns a loader that will search for resources associated with a
I18nHelper. |
ResourceBundleLoader.LoadResult |
load()
Perform a search and load all the configured resources.
|
ResourceBundleLoader |
locale(Locale locale)
Returns a loader that will search for resources associated with the passed
Locale. |
ResourceBundleLoader locale(Locale locale)
Locale. This method will not
mutate this and as such the caller must use the returned loader to search against the passed Locale.locale - the locale.Locale. The type of search
remains unchanged.ResourceBundleLoader helpText()
HelpUrls.
The Locale used by the search remains unchanged. This method will not mutate this and as such
the caller must use the returned loader to find the right type of resources.HelpUrls. The Locale used by
the search remains unchanged.ResourceBundleLoader i18n()
I18nHelper.
The Locale used by the search remains unchanged. This method will not mutate this and as such
the caller must use the returned loader to find the right type of resources.I18nHelper. The Locale used by
the search remains unchanged.ResourceBundleLoader.LoadResult load()
Copyright © 2002-2015 Atlassian. All Rights Reserved.