[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    RE: Separate language file for each customer
From:       "James Carman" <james () carmanconsulting ! com>
Date:       2006-04-28 10:00:03
Message-ID: 4851.192.168.1.1.1146218403.squirrel () www ! carmanconsulting ! com
[Download RAW message or body]

That would be the way to go.

> I think overriding the service
>   "tapestry.ComponentMessagesSource"
> especially its getMessages() method may be a good point to start.
> You'll have to inject some Application-State into your version of it
> to get your company-id.
>
>> -----Original Message-----
>> From: Inge Solvoll [mailto:inge.tapestry@gmail.com]
>> Sent: Friday, April 28, 2006 10:54 AM
>> To: Tapestry users
>> Subject: Re: Separate language file for each customer
>>
>>
>> Yes, that's what I'm talking about. I've done this for the
>> Struts part of
>> the application, it was a lot of work an involved a great
>> deal of hacking,
>> but it works (hopefully).
>>
>> I believe the same solution for Tapestry is easier, because of the
>> configuration possibilities in Hivemind. But for now, I
>> haven't managed to
>> find the hook, or if it exists.
>>
>> On 4/28/06, Sam Gendler <sgendler@ideasculptor.com> wrote:
>> >
>> > Sorry, I don't have an answer for you.  Kludging up a solution using
>> > unlikely locale's could work, but not if you need to do number
>> > formatting and such.  Perhaps there is a way, via Hivemind,
>> to replace
>> > the default message lookup mechanism with one of your own
>> > construction?
>> >
>> > --sam
>> >
>> >
>> > On 4/28/06, Inge Solvoll <inge.tapestry@gmail.com> wrote:
>> > > Thanks Sam, but I don't think I've managed to make myself
>> clear about
>> > the
>> > > real problem here.
>> > >
>> > > What I would like to do is this:
>> > >
>> > > Company 1 has this language file:
>> > >
>> > > label.hello=Hello
>> > > label.bye=See ya
>> > >
>> > > Company 2 has this language file:
>> > >
>> > > label.hello=Hi, all
>> > > label.bye=Bye bye
>> > >
>> > > The logged in user has a reference to the id of company 1
>> or 2. I need
>> > to
>> > > pick the correct properties file for this user, based on
>> his company id.
>> > Any
>> > > ideas?
>> > >
>> > >
>> > > On 4/26/06, Sam Gendler <sgendler@ideasculptor.com> wrote:
>> > > >
>> > > > Tapestry has a built-in mechanism for overriding the
>> browser language
>> > > > settings with a cookie value.  If you set the cookie
>> with the language
>> > > > preference, then you don't need to override anything in
>> tapestry.
>> > > > Just make sure to set the cookie whenever they log in,
>> based on a
>> > > > property you have stored with the user info.
>> Unfortunately, I don't
>> > > > have demo code at hand, as I haven't used this feature,
>> but it is
>> > > > documented on the site/wiki or in Enjoy Web Development
>> with Tapestry.
>> > > >
>> > > > --sam
>> > > >
>> > > > On 4/25/06, Inge Solvoll <inge.tapestry@gmail.com> wrote:
>> > > > > I would like to introduce separate language files for
>> each customer
>> > in
>> > > > my
>> > > > > application. This means overriding the way tapestry handles "
>> > > > > org.apache.tapestry.global-properties". I need to
>> hook into that
>> > > > mechanism
>> > > > > to supply a company id for looking up that company's
>> properties
>> > files. I
>> > > > > guess each company will have a separate folder containing its
>> > properties
>> > > > > files.
>> > > > >
>> > > > > I'm also working on this for the struts part of the
>> application,
>> > > > involving
>> > > > > the ApplicationServlet, MessageResources and the
>> bean:message custom
>> > > > tag.
>> > > > >
>> > > > > Any tips on where to look to change the tapestry behaviour for
>> > looking
>> > > > up
>> > > > > language properties files?
>> > > > >
>> > > > > Thanks,
>> > > > >
>> > > > > Inge
>> > > > >
>> > > > >
>> > > >
>> > > >
>> ---------------------------------------------------------------------
>> > > > To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>> > > > For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>> >
>> >
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


James Carman, President
Carman Consulting, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic