[ic] Use one table for product descriptions in different languages

Kevin Walsh kevin at cursor.biz
Mon Jul 11 12:41:40 EDT 2005


Daniel Davenport [ddavenport at newagedigital.com] wrote:
> lars.tode at bpanet.de wrote:
> > One of our customers thought about translate his shop in different
> > languages. The biggest part of the translation is done by the locale.txt
> > There is just one exception, the title and description of each product.
> > 
> > One possible solution is to use different ProductFile for each language,
> > using the ProductFiles directive in the locale.txt
> > In this solution, I'd to create more than one product table and to
> > update both tables if something changed (data, table structure etc).
> > This idea is not bad, but i search for something different.
> > 
> > Another solution I found today on www.icdevgroup.org, DescriptionField.
> > I think the solution ist not so bad, except if you add more languages.
> > 
> > My idea is just add one more table where every descption for every
> > language and item is stored in.
> > 
> > I thought about following table layout :
> > 
> > item_code
> > ianguage_id
> > title
> > description
> > 
> You'd have a hard time telling IC to look at both the sku and the
> language with a scheme like that. 
> 
> [data table=descriptions field=description key=1
>     foreign.item_code=[scratch sku]
>     foreign.language_id=[scratch current_language]
> ]
> 
> looks like it might grab the data you need, assuming you've [tmp]ed or
> [set] your sku and language. 
> If you want it simpler than that in a page, you'll probably need to write
> a tag....but the tag could just be a wrapper around the data tag above. 
> 
On the other hand, you could take a look at the shadow table facility,
where you can "shadow" some of the columns in a table with another
local-driven table.

If you have a setup based upon Interchange 5.0 or above, take a look
at the Foundation (or Standard) demo's "dbconf/locale" directory.
In there you'll find a setup where the de_DE and nl_NL locales can
automatically map certain columns in the products table using columns
from the products_de_DE, or products_nl_NL, table.

The default setup also shadows other tables.  Feel free to set up other
locales and/or other tables using the same technique.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list