[Seaside] [Fix] Seaside-LangConfigPatch

Masashi UMEZAWA masashi.umezawa at gmail.com
Thu Jul 6 10:32:38 UTC 2006


Hi,

2006/7/6, Bany, Michel <mbany at cincom.com>:
>
>
> > So, you are saying that we should subclass WASession each
> > time for each language?
>
> I am not saying that. You can provide any computed value
> for xml:lang in your #updateRoot: method. It does not
> need to be a hard-coded constant.

OK. I see your point.

> As a matter of fact I was answering your initial question :
> Yes, Seaside does allow you to change xml:lang and, more generally,
> any attribute in the html element. The mechanism for that is to
> subclass WASession and implement #updateRoot:

Generally, yes. However, I think xml:lang is so special. Suppose that
someone wrote Seaside app (Wiki, Blog, etc) in English, and one
Japanese would like to run it for Japanese users.

Basically, he would like to do just 2 steps:
-provide a new Japanese message catalog for the app
-set the app's locale to Japanese

If he is a good-skilled Smalltalker, it would be easy to do an extra
step - subclass WASession and override #updateRoot:. But, if he is
not, he might give up.

Moreover, if the app already uses WASession subclasses for switching
databases (Magma, GOODS, etc). We need to subclass them all, (and need
to override #updateRoot: redundantly).

More badly, if the app is commercial and he cannot access to the
source code, it would be impossible to localize. Currently, most
applications allow us to localize without accessing source code. So,
it is not so cool.

> > I can not understand why subclassing is better...
>
> With a configuration value, you simply assign a hard-coded value
> to your application and you would probably need to define one
> application for each language. IMO subclassing gives you more
> flexibility.

Yes. But, in most cases, just setting one default lang would be OK.
Suppose Wiki or Blog again. The users typically write contents in
their mother tongue. The application is universal, but in deployment,
the contents are localized. Of course, by subclassing WASession, we
can dynamically change the xml:lang by each session basis. But it
seems to be over-engineered for localized sites. Balancing the
flexibility and handiness, I prefer the config approach.

Cheers,
-- 
[:masashi | ^umezawa]


More information about the Seaside mailing list