Package hudson.plugins.locale
Class PluginImpl
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
hudson.plugins.locale.PluginImpl
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,Loadable
,OnMaster
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject jsonObject) Retrieves a ListBoxModel containing the available system locales.static PluginImpl
get()
protected XmlFile
static void
init()
boolean
void
load()
static Locale
Parses a string like "ja_JP" into aLocale
object.void
setIgnoreAcceptLanguage
(boolean ignoreAcceptLanguage) Sets whether the plugin should take user preferences into account.void
setSystemLocale
(String systemLocale) Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPage
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Field Details
-
USE_BROWSER_LOCALE
- See Also:
-
-
Constructor Details
-
PluginImpl
public PluginImpl()
-
-
Method Details
-
get
-
getConfigFile
- Overrides:
getConfigFile
in classDescriptor<GlobalConfiguration>
-
init
- Throws:
Exception
-
load
public void load()- Specified by:
load
in interfaceLoadable
- Overrides:
load
in classDescriptor<GlobalConfiguration>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject jsonObject) throws Descriptor.FormException - Overrides:
configure
in classGlobalConfiguration
- Throws:
Descriptor.FormException
-
isIgnoreAcceptLanguage
public boolean isIgnoreAcceptLanguage() -
getSystemLocale
-
setSystemLocale
-
getUseBrowserLocale
-
setIgnoreAcceptLanguage
public void setIgnoreAcceptLanguage(boolean ignoreAcceptLanguage) Sets whether the plugin should take user preferences into account.- Parameters:
ignoreAcceptLanguage
- Iftrue
, Ignore browser preference and force this language to all users- Since:
- 1.3
-
parse
Parses a string like "ja_JP" into aLocale
object.- Parameters:
s
- the locale string using underscores as delimiters- Returns:
- the Locale object
-
getCategory
- Overrides:
getCategory
in classDescriptor<GlobalConfiguration>
-
doFillSystemLocaleItems
Retrieves a ListBoxModel containing the available system locales. This method populates a ListBoxModel with the available system locales, sorted lexicographically by their string representations. Each locale's display name and string representation are added as options to the model.- Returns:
- A ListBoxModel containing the available system locales.
-