Hi, On Mon, Apr 21, 2008 at 5:46 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > --- Pranav <[EMAIL PROTECTED]> wrote: > > No the message displayed by welcome.user would be entirely different. E.g. > > one could say "welcome to the world of Unlimited Skiing", while the other > > one could say "Aren't you supposed to be working?" etc. You get the idea. > > If it was just possible with an args array, it would not be complicated at > > all. > > I don't think this is a particularly good use case for utilizing standard > I18N. I would lean towards a database-backed solution, it strikes me as being > simpler to both implement and maintain.
+1 This is no longer plain i18n. The content depends (so I guess) not only on the place of the message, but differs depending to other parameters. There might be a limited number of messages, which on it's own may be translated using <s:text />, as the "name" attribute is evaluated on the stack. But WHAT message is rendered is decided somewhere else. Cheers, -Ralf > > Dave > > > > On Mon, Apr 21, 2008 at 5:37 AM, Pranav <[EMAIL PROTECTED]> wrote: > > > > I am new to struts 2 and trying to figure out a problem that I am having > > w.r.t. I18n. My application is supposed to serve multiple clients per > > hosted instance of the application and the requirement is to somehow > > support the requirement of display of client specific text for the same > > message resource key based on the logged in user. E.g. so if an end user is > > logging on to the system on behalf of customer 1 the same key > > "welcome.user" should display message different from what another end user > > of customer 2 sees for the same message resource key. Note that the locale > > is still the same i.e. US English. I was thinking about the following > > solution: > > > > > > Solution: I will extend ActionSupport class and all its getText method > > such that each key will be prefixed by something unique to the customer > > like customer_id before the lookup and each messageresouce file will define > > the same key multiple times with the customer_id as prefix as needed. E.g. > > cust1.welcome.user, cust2.welcome.user etc. > > > > > > Now my questions are: > > > 1) If I do the above, do I always have to use the getText way of looking > > up the messages? If I use the key attribute of the UI tags, will the > > overridden getText methods be still called? > > > 2) Also is there any major problem with the approach above to solve the > > particular problem I am having? > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]