Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5668

StringResourceModel with custom locale

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.11
    • Fix Version/s: 1.5.12, 7.0.0-M3, 6.17.0
    • Component/s: wicket
    • Labels:
      None

      Description

      Hi.
      I recently ran into problem with usage StringResourceModel class in
      my application logic.

      I need to grab value from StringResourceModel. And that value must be message for diferent locale than stored in session or inserted in component.

      example:
      lets have
      s= new StringResourceModel(key, component, model, args);

      session locale : en
      component locale : en_UK
      I need message for : sk_SK

      i need something like
      s= new StringResourceModel(key, component, model, args);
      s.setLocale(/sk_SK/);

      I propose
      Introduce property "locale" . internally will have top priority in load() function, if is not set, it will pass next rule, witch is component and session.

      if (customLocale != null)
      {
      locale= cusomLocale;
      }
      else
      {
      if (component != null)

      { locale = component.getLocale(); }

      else

      { locale = Session.exists() ? Session.get().getLocale() : Locale.getDefault(); }

      }

      Thank for consideration.

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Tzvetanov Grigorov
              Reporter:
              marek; Marek Martinkovič
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: