[TYPO3-dev] record localization

Simon Tuck e-mailNO at SPAMeyejet.com
Wed Jun 28 13:41:44 CEST 2006


Nikolas Hagelstein wrote:
> 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
> 

Hello Nikolas,
Version b is preferred over a, because it's easier to inherit the values rather than copy them every time you change something 
in the original language. You can define which fields are inherited in the table TCA using the column property 'exclude'. 
There is a lcalization API available and I recommend you have a look at the tt_news extension to see how it works.
Cheers,
Simon




More information about the TYPO3-dev mailing list