hudson.plugins.translation
Class L10nDecorator

java.lang.Object
  extended by hudson.model.Descriptor<hudson.model.PageDecorator>
      extended by hudson.model.PageDecorator
          extended by hudson.plugins.translation.L10nDecorator
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.model.PageDecorator>, hudson.model.Saveable

@Extension
public class L10nDecorator
extends hudson.model.PageDecorator

PageDecorator that adds the translation dialog.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class L10nDecorator.SubmissionEntry
           
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 ContributedL10nStore store
           
 
Fields inherited from class hudson.model.PageDecorator
ALL
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
L10nDecorator()
           
 
Method Summary
 List<Msg> decode(org.kohsuke.stapler.StaplerRequest request)
          Does the opposite of encodeRecording(StaplerRequest).
 void doSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String locale)
          Handles the submission from the browser.
 String encodeRecording(org.kohsuke.stapler.StaplerRequest request)
           
 String getPrimaryTranslationLocale(org.kohsuke.stapler.StaplerRequest req)
          Looks at Accept-Language header manually and decide which locale this user is likely capable of translating.
 Collection<Msg> getRecording(org.kohsuke.stapler.StaplerRequest request)
           
 List<Locales.Entry> listLocales()
           
 void startRecording(org.kohsuke.stapler.StaplerRequest request)
          Activate the recording of the localized resources.
 
Methods inherited from class hudson.model.PageDecorator
all, getDescriptor, getDisplayName, getUrl
 
Methods inherited from class hudson.model.Descriptor
calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigFile, getConfigPage, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getPropertyType, getPropertyType, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

public final ContributedL10nStore store
Constructor Detail

L10nDecorator

public L10nDecorator()
Method Detail

listLocales

public List<Locales.Entry> listLocales()

startRecording

public void startRecording(org.kohsuke.stapler.StaplerRequest request)
Activate the recording of the localized resources.


getRecording

public Collection<Msg> getRecording(org.kohsuke.stapler.StaplerRequest request)

encodeRecording

public String encodeRecording(org.kohsuke.stapler.StaplerRequest request)
                       throws IOException
Throws:
IOException

decode

public List<Msg> decode(org.kohsuke.stapler.StaplerRequest request)
                 throws IOException,
                        org.apache.commons.codec.DecoderException
Does the opposite of encodeRecording(StaplerRequest).

Throws:
IOException
org.apache.commons.codec.DecoderException

getPrimaryTranslationLocale

public String getPrimaryTranslationLocale(org.kohsuke.stapler.StaplerRequest req)
Looks at Accept-Language header manually and decide which locale this user is likely capable of translating.


doSubmit

public void doSubmit(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp,
                     @QueryParameter
                     String locale)
              throws IOException,
                     javax.servlet.ServletException
Handles the submission from the browser.

Throws:
IOException
javax.servlet.ServletException


Copyright © 2004-2012 Hudson. All Rights Reserved.