Language fields

New in version 13.0

Changed in version 13.3

This field type displays all languages available in the current site context. Outside of the site context it displays all languages available in the installation.

A special language All languages is automatically added.

The according database field is generated automatically.

Table of contents:

Introduction

The main purpose of the TCA language configuration is to simplify the TCA language configuration. It therefore supersedes the special=languages option of TCA columns with type=select.

Formerly foreign_table relations to the table sys_language had also been used. This became deprecated with the introduction of site configurations with TYPO3 v9.

This field type decouples the actually available site languages from the sys_language table.

This TCA type automatically displays all available languages for the current context (the corresponding site configuration) and also automatically adds the special -1 language (meaning all languages) for all record types, except pages.

In records on root level (pid=0) or on a page, outside of a site context, all languages from all site configurations are displayed in the new field.

Example: Simple language field

EXT:myExtension/Configuration/Overrides/someTable.php
<?php

$GLOBALS['TCA'][$someTable]['columns'][$someLanguageField] = [
    'label' => 'Some language field',
    'config' => [
        'type' => 'language',
    ],
];
Copied!

Language field properties

Since the TCA type language is mostly based on the type=select internally, most of the associated TCA and TSconfig options can still be applied. This includes for example the selectIcons field wizard, as well as the keepItems and removeItems page TSconfig options.