[Typo3-dev] Localisation of own Records in DB
Ismael BIDAU
bidau at ensci.com
Tue Sep 13 09:09:19 CEST 2005
Le Thu, 08 Sep 2005 11:20:31 +0200, Christian Tauscher
<Christian.Tauscher at freenet.de> a écrit:
> Hello my dear developer!
>
> Weeks ago I've already postet die question in the german user-list, but
> unfortunately no one could help me to solve my problem...
>
> But here are the real cracks - aren't you? Would be nice if you can help
> me.
>
> I have written some kind of extention. I create record in the BE, shown
> in the FE finally.
>
> Since the site this EXT is ment for is a multilanguage one, I would like
> to lokalize this records.
>
> Up to now I have studied the tt_news-Ext and the TCA documentations -
> but I failed to solve the Problem. I reached this point:
I did the same job yesterday for my own extension. I had the field in my
own table tx_events_list:
- sys_language_uid
- l18n_parent
In TCA / columns, I had:
'sys_language_uid' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.language',
'config' => Array (
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => Array(
Array('LLL:EXT:lang/locallang_general.php:LGL.allLanguages',-1),
Array('LLL:EXT:lang/locallang_general.php:LGL.default_value',0)
)
)
),
'l18n_parent' => Array (
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.l18n_parent',
'config' => Array (
'type' => 'select',
'items' => Array (
Array('', 0),
),
'foreign_table' => 'tx_events_list',
'foreign_table_where' => 'AND
tx_events_list.uid=###REC_FIELD_l18n_parent### AND
tx_events_list.sys_language_uid IN (-1,0)',
)
),
and some 'l10n_mode' => 'mergeIfNotBlank', or 'l10n_mode' => 'exclude',
for what i wanted to translate.
In ext_tables.php / ctrl:
'transOrigPointerField' => 'l18n_parent',
'languageField' => 'sys_language_uid',
> In list module (localisation view checked) I get the extra columns for
> "Language" wich is filled (showing "standard"). What I am missing now is
> the link "create translation" which is usually shown in this case.
>
> A simple dummy-Extention (creates DB-Record with title, pic, text) can
> be downloaded here: http://tmd.dynalias.net/T3X_user_test.t3x
>
> Maybe you would like to have a look inside the code an tell me waht's
> wrong with my code.
>
> Have a nicy day,
>
> Christian.
I hope it helps.
Ismaël BIDAU
www.ensci.com
More information about the TYPO3-dev
mailing list