Hi Kristian, Thanks for the super fast reply, it's surprised me! alias service looks the T5 way to go for that, but kind of advanced topic, u did give me some directions, let me study those areas first before asking more questions. A.C.
kristian.marinkovic wrote: > > you have to put in all the methods into your AppModule class... > they should work as is. > > die Alias Service is needed to replace an existing service > with a new service that has the same interface. Tapestry has > the ThreadLocale service that uses the ThreadLocaleImpl > implementation. By contributing to the alias service we tell > the tapestry ioc container to use your ThreadLocale implementation > DomainThreadLocale wherever it is referenced/injected instead > of its own. So whenever to inject the ThreadLocale you will get > your implementation.... > > the ioc container will also inject dependencies that are referenced > by the constructor of your ThreadLocale implementation automatically > if you use the ServiceBinder > > hope this will give you a good start :) > > > > > Angelo Chen <[EMAIL PROTECTED]> > 04.10.2007 15:20 > Bitte antworten an > "Tapestry users" <users@tapestry.apache.org> > > > An > users@tapestry.apache.org > Kopie > > Thema > Re: T5: Domain level localization > > > > > > > > Hi Kristian, > > Thanks for the reply, it's kind of difficult for a Tapestry newbie to > understand that code, will try to research some more on the topic of alias > first and come back later. > A.C. > > > kristian.marinkovic wrote: >> >> you could create your own ThreadLocale object that has >> the request object injected and contribute it to the alias >> service. >> >> i haven't tried it myself but it should look something like that: >> >> public static void bind(ServiceBinder binder) >> { >> binder.bind(ThreadLocale.class, DomainThreadLocale.class).scope( >> IOCConstants.PERTHREAD_SCOPE).withId("domainThreadLocale"); >> ...} >> // create alias >> public static void contributeAliasOverrides( >> @InjectService("domainThreadLocale") ThreadLocale >> threadLocale, >> Configuration<AliasContribution<?>> configuration) { >> >> configuration.add( >> AliasContribution.create( >> ThreadLocale.class, threadLocale)); >> } >> >> >> DomainThreadLocale implements ThreadLocale { >> public DomainThreadLocale (Request request) { >> // check domain and set locale.... >> } >> } >> >> >> >> >> >> "Jérôme BERNARD" <[EMAIL PROTECTED]> >> 04.10.2007 10:30 >> Bitte antworten an >> "Tapestry users" <users@tapestry.apache.org> >> >> >> An >> "Tapestry users" <users@tapestry.apache.org> >> Kopie >> >> Thema >> Re: T5: Domain level localization >> >> >> >> >> >> >> Maybe a servlet filter? >> >> >> Jérôme. >> >> On 10/4/07, Angelo Chen <[EMAIL PROTECTED]> wrote: >>> >>> Hi, >>> >>> I'm not so sure if this Tapestry related, my T5 app can switch locales >>> between English and Chinese using >>> persistentLocaleService.set(Locale.SIMPLIFIED_CHINESE); >>> >>> Now I like the localization also in the domain level, let's say, I have > >> two >>> domains, namely mydomain.com and mydomain.com.cn, if user goes to >>> mydomain.com it show the English locale, if he goes to mydomain.com.cn >> it >>> will choose Chinese locale, it looks different sites but actually all >> goes >>> to the same IP, possible? any tips on this, thanks. >>> A.C. >>> -- >>> View this message in context: >> > http://www.nabble.com/T5%3A-Domain-level-localization-tf4565942.html#a13032958 > >> >>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >> >> >> -- >> Jérôme BERNARD, >> Kalixia, SARL. >> http://weblog.kalixia.com >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > > -- > View this message in context: > http://www.nabble.com/T5%3A-Domain-level-localization-tf4565942.html#a13039727 > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/T5%3A-Domain-level-localization-tf4565942.html#a13040108 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]