[TYPO3-dev] record localization

Nikolas Hagelstein hagelstein at shr.cc
Wed Jun 28 12:19:46 CEST 2006


Hi there,

I am interessted in sharing knowledge regarding localization.

Let me provide a small example to discuss about:

Lets assum i got a table of localized records "products" e.g
A product consist of the following fields (simplified):

number
short description
long  description

The localization relevant field are short and long description the
other ones need to be eighter: a.copied from the l18n_parent or b.
inherited
from the l18n_parent.

Beware: monospace font required ;)

a. Would result in something like:
------------------------------------------------------------------------
----
|UID|number|short description|long
description|sys_language_uid|l18n_parent|
------------------------------------------------------------------------
----
| 1 |000001|good book        | very good book |0               |0
|
| 2 |000001|gutens buch      | sehr gutes Buch|1               |1
|
------------------------------------------------------------------------
----


b. Would result in something like:
------------------------------------------------------------------------
----
|UID|number|short description|long
description|sys_language_uid|l18n_parent|
------------------------------------------------------------------------
----
| 1 |000001|good book        | very good book |0               |0
|
| 2 |      |gutens buch      | sehr gutes Buch|1               |1
|
------------------------------------------------------------------------
----


I personally prefer b, because:
1.less redundancy causes less potentials of inconsistency ;).
2.assembling the complete records has to be done by combining both 
records (parent and child) in both cases any way.
Even if it does not look  the part for case a. But if relation come into
play
the parent record is needed definitely. 
(unless relation is done for every language but this sounds a little
ugly to me).

So there a few points i would like to hear your opinion about:

What would be an elegant way to fetch the "combined" record for
syslang!=0 and syslang=0
except using 2 different querys?

If i would like  empty localized fields being overlayed by the the
default language, 
things will become even more complicated. Any "elegant" hints on that?

Are there any API functions making it easier to deal with this problem?

Did i miss something in general?

Cheers,
          Nikolas









 




More information about the TYPO3-dev mailing list