[Seaside] logic + templates + ... resources
Julian Fitzell
julian@beta4.com
Sat, 13 Apr 2002 11:15:59 -0700
Kamil Kukura wrote:
> Simply, have a template:
>
> <p>Status: [statusText]</p>
>
> and of course there's implicit or explicit binding of statusText to
> something that results into say one of: 'Okay'. 'Pending'. 'Error'. The
> beauty just works.
> Now I feel that separation of logic and content is half-baked. I'm doing
> something that should be multilingual and now I have in the code those
> strings of possible status. I have helped myself by creating new special
> element which has use like this:
>
> <local sea:id="ok">Okay</local>
> <local sea:id="pnd">Pending</local>
> <local sea:id="err">Error</local>
>
> These are at the end of template and it's sort of simple resource. In my
> own IAComponent I have in the binding block also the part that loads
> local texts to the class side of the component. And of course this
> element is silent on its output.
>
> So, is it good way to think that along with templates we need also
> something for storing resources? So far I have in each template's end
> the resource section but I feel the need for shared resources as well.
Maybe I'm misunderstanding what you're saying here, but it looks like
you're trying to define internationalization resource strings within the
template. I don't quite understand this since the template is supposed
to be a layout template. It seems that the code should be looking up
the appropriate language and returning the right string when a component
asks for it.
Now my guess is just that you don't want to have to hardcode the strings
into the code and so are putting it in the template because it seems
more external. I would have thought that Squeak had some level of
internationalization support built in but I can't find it. How do
people do this for other applications?
This doesn't feel like something that Seaside should need to support
directly. Since you should be able to write a seaside app almost like
any other app, you should be able to use whatever internationalization
system you would use with any other app. I can see having classes that
have methods that return the right string and you could have a class for
each language or something but there has to be a better way.
Thoughts anyone?
Julian
--
julian@beta4.com
Beta4 Productions (http://www.beta4.com)