Search code examples
localizationtypo3tx-news

Localize tx_news - how to make common fields fall back to original language?


When localizing tx_news articles in TYPO3 6.x out of the box, you have to set many values for the translation manually that could be taken from the original language.

For example:

  • A news item's category
  • A news item's category's detail page and list page.
  • A news item's images

How can it be achieved that these fields either completely fall back to the original language - or at least when they are left empty?


Solution

  • The property "l10n_mode" in the field configuration of a TCA is responsible for the localization configuration. The possible values are documented in the TCA reference: http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Index.html

    The categories in tx_news are set to "mergeIfNotBlank". So what you want should be the default value: If you leave the field empty in the alternative language, the categories from the default language should be taken.

    If you want to hide the fields and always take the values from the default language, you can of course override the TCA and set the l10n_mode to exclude, e.g.

    $GLOBALS['TCA']['tx_news_domain_model_news']['columns']['categories']['l10n_mode'] = 'exclude';
    

    (in your extTables.php)