Forum OpenACS Development: Migrating ecommerce templates to ATS

The ecommerce package uses a package specific templating system akin
to the ACS Templating System (ATS). I'd like to migrate this ecommerce
templating system (ETS) to ATS to bring the ecommerce package in line with
OpenACS.

The main difference between ETS and
ATS is that ETS distinguishes between plain and fancy styles and could
serve language specific templates. If a user has recorded his/her
language preference and a prefered style (plain/fancy) ETS serves a
template called: <pagename>.<style>.<language> instead of the template
<pagename> that ATS would serve.

However, a quick examination of the ecommerce templating system shows
that there is no UI for users to record their preferences. Ergo the
ETS  is reduced to the same functionality as ATS. With no way to
record user preferences ETS always serves plain english templates just
as ATS does.

I'm inclined to migrate ETS to ATS and remove the ability to serve
style and language specific templates rather than preserve it. But
before I do I would like to know what the community thinks. Has anyone
used ETS to offer language specific pages? Should this capability be
preserved?

Collapse
Posted by Don Baccus on
I think you can just migrate your template pages to the ATS and ignore the multilingual hooks in the old ACS 3 templating system (the "ETS" was later used elsewhere in the toolkit).

The ECommerce datamodel doesn't support multilingual product descriptions, etc, right?  So even if you had static translated templates your product descriptions, shopping cart summary, etc would all be in one language.  You could support (say) a French e-commerce site using the ETS but it wouldn't really provide support for a multilingual e-commerce site.

We really do need to attack the multilingual support problem at some point.  acs-lang provides support for multilingual dynamic messages and these can be used to build language-specific pages, but hitting the db for every page segment's not a great idea.

Lars Pind and I are doing some work on Greenpeace International's forthcoming multilingual/multinational website.  The design we've inherited allows for custom national templates organized in the filesystem in a way that's similar in principle (not details) to the ACS 3 method of specifying plain/fancy or specific language templates.

The correct template is found by a slightly modified version of ad_return_template.

Within the national templates messages are translated using a slightly modified versino of acs-lang.  The advantage of taking this approach is that a UI can be provided that allows translators to work in a controlled fashion (rather than have them translate templates with the risk of their messing them up unintentionally).

This work has caused me to think a bit about how it might be generalized.  The change to ad_return_template required to support mapping to different templates based on context (language in your case, national organization in greenpeace's case) is simple for any given case.  Perhaps in the future ad_return_template could support a simple contract-based interface to a "template mapper" that one could customize?

Also it would be nice if we had standardized translations of toolkit templates available and a way to map them set up!  That's a very ambitious idea (there are a lot of template pages) but it would be damned cool to select a language at install time and have the "Congratulations" and "package manager" and other standard packages come up in the language of one's choice!

Collapse
Posted by Don Baccus on
Actually acs-lang translated messages are cached on start-up so there's no additional db hits involved in building pages this way.

Just a point of information ...