public class CachingI18nFactory extends Object implements I18nHelper.BeanFactory, InitializingComponent, Startable
I18nHelper
.
With the advent of Plugins-2 we need to iterate through all enabled plugins and get their i18n resources when an
I18nHelper
is required.
Constructor and Description |
---|
CachingI18nFactory(JiraLocaleUtils jiraLocaleUtils,
com.atlassian.event.api.EventPublisher eventPublisher,
BackingI18nFactory i18nBackingFactory,
UserLocaleStore userLocaleStore,
ComponentLocator locator,
ResourceBundleCacheCleaner resourceBundleCacheCleaner) |
Modifier and Type | Method and Description |
---|---|
void |
afterInstantiation() |
I18nHelper |
getInstance(ApplicationUser user)
Returns an
I18nHelper instance associated with the provided User 's locale preference. |
I18nHelper |
getInstance(Locale locale)
Returns an
I18nHelper instance associated with the provided Locale . |
String |
getStateHashCode()
An opaque string that changes whenever the underlying i18n bundles change (e.g.
|
void |
pluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event) |
void |
pluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event) |
void |
pluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event) |
void |
pluginRefreshed(com.atlassian.plugin.event.events.PluginRefreshedEvent event) |
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
public CachingI18nFactory(JiraLocaleUtils jiraLocaleUtils, com.atlassian.event.api.EventPublisher eventPublisher, BackingI18nFactory i18nBackingFactory, UserLocaleStore userLocaleStore, ComponentLocator locator, ResourceBundleCacheCleaner resourceBundleCacheCleaner)
public void start()
Startable
public void afterInstantiation()
afterInstantiation
in interface InitializingComponent
@EventListener public void pluginEnabled(com.atlassian.plugin.event.events.PluginEnabledEvent event)
@EventListener public void pluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
@EventListener public void pluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
@EventListener public void pluginRefreshed(com.atlassian.plugin.event.events.PluginRefreshedEvent event)
public I18nHelper getInstance(Locale locale)
I18nHelper.BeanFactory
I18nHelper
instance associated with the provided Locale
. Note that since JIRA 6.0
you can have an I18nHelper
injected directly into your class, and it will be specific to the
currently logged in user.getInstance
in interface I18nHelper.BeanFactory
locale
- the locale in playI18nHelper
instance associated with the provided Locale
I18nHelper
public I18nHelper getInstance(ApplicationUser user)
I18nHelper.BeanFactory
I18nHelper
instance associated with the provided User
's locale preference. Note
that since JIRA 6.0 you can have an I18nHelper
injected directly into your class, and it will be
specific to the currently logged in user.getInstance
in interface I18nHelper.BeanFactory
user
- the user in playI18nHelper
instance associated with the provided User
's locale preferenceI18nHelper
public String getStateHashCode()
Copyright © 2002-2017 Atlassian. All Rights Reserved.