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

StringResourceModel with custom locale

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5.11
    • 1.5.12, 7.0.0-M3, 6.17.0
    • wicket
    • 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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: