Class L10nDecorator

All Implemented Interfaces:
ExtensionPoint, Describable<PageDecorator>, Saveable, Loadable, OnMaster

@Extension public class L10nDecorator extends PageDecorator
PageDecorator that adds the translation dialog.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • L10nDecorator

      public L10nDecorator()
  • Method Details

    • listLocales

      public List<Locales.Entry> listLocales()
    • startRecording

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

      public Collection<Msg> getRecording(org.kohsuke.stapler.StaplerRequest2 request)
    • encodeRecording

      public String encodeRecording(org.kohsuke.stapler.StaplerRequest2 request)
      Encrypts the recorded resource bundle list into an opaque, tamper-proof token that round-trips through the browser.
    • decode

      public List<Msg> decode(org.kohsuke.stapler.StaplerRequest2 request)
      Does the opposite of encodeRecording(StaplerRequest2).
    • getPrimaryTranslationLocale

      public String getPrimaryTranslationLocale(org.kohsuke.stapler.StaplerRequest2 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.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter String locale) throws IOException, jakarta.servlet.ServletException
      Handles the submission from the browser, storing the contributed translations locally on this Jenkins instance.
      Throws:
      IOException
      jakarta.servlet.ServletException