PHPackages                             heimrichhannot/contao-multilingual-fields-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. heimrichhannot/contao-multilingual-fields-bundle

ActiveContao-bundle[Localization &amp; i18n](/categories/localization)

heimrichhannot/contao-multilingual-fields-bundle
================================================

This utility bundle offers functionality for backend editor's to translate arbitrary fields of any table-driven data container in the Contao CMS.

0.5.2(1y ago)1160[1 PRs](https://github.com/heimrichhannot/contao-multilingual-fields-bundle/pulls)LGPL-3.0-or-laterPHPPHP ^7.4 || ^8.0

Since Apr 16Pushed 9mo ago5 watchersCompare

[ Source](https://github.com/heimrichhannot/contao-multilingual-fields-bundle)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-multilingual-fields-bundle)[ Docs](https://github.com/heimrichhannot/contao-multilingual-fields-bundle)[ RSS](/packages/heimrichhannot-contao-multilingual-fields-bundle/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (11)Versions (23)Used By (0)

Contao Multilingual Fields Bundle
=================================

[](#contao-multilingual-fields-bundle)

This utility bundle offers functionality for backend editor's to translate arbitrary fields of any table-driven data container in the Contao CMS.

Features
--------

[](#features)

- define which fields of which data containers should be translatable
- adds a button to the backend palette for switching into translation mode
- content elements: optionally add a select field to the backend palette in order to display the corresponding content element only for the selected language

Impressions
-----------

[](#impressions)

[![Edit languages button](docs/img/edit-languages-button.png)](docs/img/edit-languages-button.png)The button for editing the languages (right) and the button for showing certain content elements only for the selected language (left, for `tl_content` only)

[![Edit languages](docs/img/edit-languages.png)](docs/img/edit-languages.png)Editors can specify which of the fields should be translated for which languages

Use case
--------

[](#use-case)

The use case for this bundle is to have an automatic and structured process for adding translatable fields to a data container. Also, you get a nice and editor-friendly way to edit translations in the backend ;-)

What doesn't the bundle do?
---------------------------

[](#what-doesnt-the-bundle-do)

Currently for most data containers this bundle is a utility bundle for just bringing a nice and editor-friendly way to edit translations in the backend. It's up to you how to use the fields.

**Besides tl\_content there's no out-of-the-box support for contao's frontend modules!**

But you can of course use the created fields in your templates (if the modules passes the data there).

How does it work?
-----------------

[](#how-does-it-work)

The bundle works quite simply: it looks into your project's `/config/config.yml` and based on that adds the fields defined here as translatable fields.

Example: Imagine the following `config.yml` (position is the field representing the job of the member in the company):

```
huh_multilingual_fields:
  fallback_language: de
  languages:
    - en
  data_containers:
    tl_member:
      fields:
        - { name: position }
```

This would end up in your DCA being automatically modified the following way:

```
// ...
[
    // the original position field is nearly unchanged -> only some meta field links are set in eval
    'position' => [
        'exclude'   => true,
        'search'    => true,
        'inputType' => 'text',
        'eval'      => [
            'maxlength' => 128,
            'tl_class' => 'w50',
            'mandatory' => true,
            'isTranslatedField' => true,
            'translationConfig' => [
                'en' => [
                    'field' => 'en_position',
                    'selector' => 'en_translate_position'
]               ]
            ]
         ],
        'sql'       => "varchar(128) NOT NULL default ''"
    ],
    // automatically created: the selector field and the translation field
    // the selector field (subpalette and selector is also set)
    'en_translate_position' => [
        'label'     => ['Translate (English)', 'Click this option in order to translate the field for the given language.'],
        'exclude'   => true,
        'inputType' => 'checkbox',
        'eval'      => [
            'tl_class' => 'w50',
            'submitOnChange' => true,
            'translationField' => 'en_position',
            'translatedField' => 'position'
        ],
        'sql'       => "char(1) NOT NULL default ''",
    ],
    // the translation field
    'en_position' => [
        'label'     => ['Position (English)', ''], // generated automatically out of the label of the "position" field
        'exclude'   => true,
        'search'    => true,
        'inputType' => 'text',
        'eval'      => [
            'maxlength' => 128,
            'tl_class' => 'w50',
            'mandatory' => true,
            'translatedField' => 'position',
            'translationSelectorField' => 'en_translate_position'
         ],
        'sql'       => "varchar(128) NOT NULL default ''"
    ]
]
```

Installation &amp; configuration
--------------------------------

[](#installation--configuration)

1. Run `composer require heimrichhannot/contao-multilingual-fields-bundle`.
2. Create the file `/config/config.yml` if not already existing and specify your translatable fields: ```
    huh_multilingual_fields:
      fallback_language: de
      content_language_select: # add a select field to content element palettes for displaying elements only for the specified language
        enabled: true # default: false
        types: # if not set, the select field is added to all tl_content types
          - text
      languages:
        - en
      data_containers:
        tl_member:
          sql_condition: tl_member.firstname LIKE ? # optional; activate the functionality only for some entities
          sql_condition_values:
            - "%%john%%" # be careful about escaping; in yaml the reserved character "%" can't be in first place and need to be be escaped
          fields:
            - { name: alias, is_alias_field: true, alias_base_field: lastname }
            - { name: lastname }
            - { name: position }
    ```
3. Clear the project's cache (`/var/cache`).
4. Update the database. The new fields should be created now.

Insert tags
-----------

[](#insert-tags)

The following new insert tags are available. These take into account the translated jumpTo url and alias.

NameExample`{{mf_news_url::::}}``{{mf_news_url::1::de}}``{{mf_event_url::::}}``{{mf_event_url::5::es}}``{{mf_faq_url::::}}``{{mf_faq_url::8::en}}`

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance52

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~341 days

Total

21

Last Release

419d ago

PHP version history (2 changes)0.1.0PHP ^7.2

0.5.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ad3224d8727b622ebd229840eea6b9dbcb83eb0bd609e6ce65b614830ff538?d=identicon)[digitales@heimrich-hannot.de](/maintainers/digitales@heimrich-hannot.de)

---

Top Contributors

[![koertho](https://avatars.githubusercontent.com/u/12064642?v=4)](https://github.com/koertho "koertho (3 commits)")

---

Tags

translationmultilingualcontaofieldfieldsdca

###  Code Quality

Static AnalysisPHPStan, Rector

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/heimrichhannot-contao-multilingual-fields-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/heimrichhannot-contao-multilingual-fields-bundle/health.svg)](https://phpackages.com/packages/heimrichhannot-contao-multilingual-fields-bundle)
```

###  Alternatives

[terminal42/dcawizard

dcaWizard extension for Contao Open Source CMS

10370.7k15](/packages/terminal42-dcawizard)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[terminal42/dc_multilingual

A multilingual DC driver storing the translations in the same table for Contao Open Source CMS

1787.2k14](/packages/terminal42-dc-multilingual)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[terminal42/contao-node

Node bundle for Contao Open Source CMS

3172.5k4](/packages/terminal42-contao-node)[contao-community-alliance/dc-general

Universal data container for Contao

1578.3k86](/packages/contao-community-alliance-dc-general)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
