Uploaded image for project: 'Click'
  1. Click
  2. CLK-79

click.util.Format does not use the request's locale

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      Hi,

      Format is a great helper but I think Format has the problem that it does not use the client's locale.

      I'd like to give the current client-locale to Format. I was thinking that Page.getFormat() can be changed to:

      getFormat() {
      if(format == null)

      { format = new Format(getContext().getRequest().getLocale()); }

      return format;
      }

      The problem here is that getFormat() is called before the context is set. Maybe the setting of the Format by click-servlet could be removed at all (including the click-xml entry).

      The configuration of format would than happen through overriding getFormat(). I think with the current trend to no xml this
      would look better. Would make the the whole thing just easier to understand and is also faster than looking up the format in ClickApp and newInstance(). Is there a use-case for having the format specified in click-xml?

      Thanks,
      Christian

        Attachments

          Activity

            People

            • Assignee:
              medgar Malcolm Edgar
              Reporter:
              click_christian Christian Essl
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: