Click
  1. Click
  2. CLK-655

Provide a pluggable ResourceBundle service

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-M1
    • Component/s: core
    • Labels:
      None

      Description

      Provide feature to plug custom ResourceBundle implementations into Click.

        Activity

        Bob Schellink created issue -
        Bob Schellink made changes -
        Field Original Value New Value
        Fix Version/s 2.3.0 [ 12314845 ]
        Fix Version/s 2.2.0 [ 12314164 ]
        Hide
        Finn Bock added a comment -

        Hi,

        Attached is my take on the messages map service. The messages map that page & control holds is just a Map<String, String> and my DefaultMessagesMapService return instances of the MessagesMap which is the default implementation of the Map<String, String>.

        Let me know if you had something entirely different in mind.

        Show
        Finn Bock added a comment - Hi, Attached is my take on the messages map service. The messages map that page & control holds is just a Map<String, String> and my DefaultMessagesMapService return instances of the MessagesMap which is the default implementation of the Map<String, String>. Let me know if you had something entirely different in mind.
        Finn Bock made changes -
        Attachment messagesMapService.patch [ 12447594 ]
        Hide
        Bob Schellink added a comment -

        This looks great, exactly what I had in mind. Just to expand a little on the use cases where a custom messages map is useful:

        • Plug in a MessageMap that conditionally caches properties
        • Use an alternative algorithm to load property files. For example at work we have a central code base that is customized for different clients. While each client uses English property files some clients want alternative labels for fields. Currently we use a hacked MessagesMap to provide "context sensitive" lookups, but with this service we could simply plug in our custom version.

        I'm not sure MessageMapService is the right name but can't think of something better at the moment. We can refactor it at a later stage so feel free to commit.

        Kind regards

        Bob

        Show
        Bob Schellink added a comment - This looks great, exactly what I had in mind. Just to expand a little on the use cases where a custom messages map is useful: Plug in a MessageMap that conditionally caches properties Use an alternative algorithm to load property files. For example at work we have a central code base that is customized for different clients. While each client uses English property files some clients want alternative labels for fields. Currently we use a hacked MessagesMap to provide "context sensitive" lookups, but with this service we could simply plug in our custom version. I'm not sure MessageMapService is the right name but can't think of something better at the moment. We can refactor it at a later stage so feel free to commit. Kind regards Bob
        Hide
        Finn Bock added a comment -

        Applied.

        Show
        Finn Bock added a comment - Applied.
        Finn Bock made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Bob Schellink [ sabob ] Finn Bock [ bckfnn ]
        Resolution Fixed [ 1 ]
        Hide
        Adrian A. added a comment -

        > I'm not sure MessageMapService is the right name but can't think of something better at the moment.
        In the DTD, there's:
        log-service, resource-service, template-service
        So to be consistent, maybe to name it simply "message-service" ?

        Show
        Adrian A. added a comment - > I'm not sure MessageMapService is the right name but can't think of something better at the moment. In the DTD, there's: log-service, resource-service, template-service So to be consistent, maybe to name it simply "message-service" ?
        Hide
        Bob Schellink added a comment -

        I think we should call this ResourceBundleService. "MessageMap" doesn't provide enough context as a service name. It sounds as if it has something to do with messaging (JMS) rather than localization. ResourceBundle on the other hand, is quite obvious.

        Of course we still create a MessagesMap instance.

        Show
        Bob Schellink added a comment - I think we should call this ResourceBundleService. "MessageMap" doesn't provide enough context as a service name. It sounds as if it has something to do with messaging (JMS) rather than localization. ResourceBundle on the other hand, is quite obvious. Of course we still create a MessagesMap instance.
        Bob Schellink made changes -
        Summary Provide a pluggable MessagesMap service Provide a pluggable ResourceBundle service
        Description Provide feature to plug custom MessageMap implementations into Click. Provide feature to plug custom ResourceBundle implementations into Click.
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        69d 11h 46m 1 Finn Bock 21/Jun/10 22:17

          People

          • Assignee:
            Finn Bock
            Reporter:
            Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development