PHPackages                             koff/i18n-form-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. koff/i18n-form-bundle

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

koff/i18n-form-bundle
=====================

Translate your doctrine objects easily with some helps

v4.0.7(8y ago)714.7k1[1 issues](https://github.com/sadikoff/i18n-form-bundle/issues)MITPHPPHP ^7.0.8

Since Dec 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/sadikoff/i18n-form-bundle)[ Packagist](https://packagist.org/packages/koff/i18n-form-bundle)[ Docs](https://github.com/sadikoff/i18n-form-bundle)[ RSS](/packages/koff-i18n-form-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (11)Versions (9)Used By (0)

koff/i18n-form-bundle
=====================

[](#koffi18n-form-bundle)

[![Build Status](https://camo.githubusercontent.com/76e4a983ea56a7349f1dd23edd503070dacbfe0034bea30a10bf75672599c109/68747470733a2f2f7472617669732d63692e6f72672f736164696b6f66662f6931386e2d666f726d2d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sadikoff/i18n-form-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/d38caa6356b3a1eaab534a66c8a28eaa3605087fbad5816f99ea054dcce8c72b/687474703a2f2f706f7365722e707567782e6f72672f6b6f66662f6931386e2d666f726d2d62756e646c652f76)](https://packagist.org/packages/koff/i18n-form-bundle)[![Total Downloads](https://camo.githubusercontent.com/5d0db7eb88512e392781c3a923edb96ab1eb283bc6fdcaac16caaaaefb0419a1/687474703a2f2f706f7365722e707567782e6f72672f6b6f66662f6931386e2d666f726d2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/koff/i18n-form-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/37b12b6754f08ad461eb6789f97064b0c83eacfb2322ad5a4bdea585c9ec5e9f/687474703a2f2f706f7365722e707567782e6f72672f6b6f66662f6931386e2d666f726d2d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/koff/i18n-form-bundle)[![License](https://camo.githubusercontent.com/a7d88e6559135b585473a9a23b18ba4ead4c610e4ff06c08c17acae6164573b7/687474703a2f2f706f7365722e707567782e6f72672f6b6f66662f6931386e2d666f726d2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/koff/i18n-form-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/478158b804fd90bfdaa0bf9e4f9b3429454ae79deb94c078c03087823b8c2dca/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736164696b6f66662f6931386e2d666f726d2d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sadikoff/i18n-form-bundle/?branch=master)[![StyleCI](https://camo.githubusercontent.com/972efbe7a2cc9103833b53ab875ed2f93b369aecbd9a33ca0c9385d3bb10fcb2/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131343239323436362f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/114292466)[![Coverage Status](https://camo.githubusercontent.com/2e28ea4e45ebc3db804631c595cde6a1ad18b6623dd5248873647230b56d63b4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f736164696b6f66662f6931386e2d666f726d2d62756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sadikoff/i18n-form-bundle?branch=master)

> This bundle is fork of [a2lix/TranslationFormBundle](https://github.com/a2lix/TranslationFormBundle), reorganized and optimized to work with symfony flex

Requirements
------------

[](#requirements)

- Symfony flex with Symfony 3.4|4.0
- i18n Doctrine strategy of your choice
    - [KnpLabs/DoctrineBehaviors](https://github.com/KnpLabs/DoctrineBehaviors#translatable) with `knplabs/doctrine-behaviors`
    - [Atlantic18/DoctrineExtensions](https://github.com/Atlantic18/DoctrineExtensions/blob/v2.4.x/doc/translatable.md) with `stof/doctrine-extensions-bundle`

Installation
------------

[](#installation)

```
composer req koff/i18n-form-bundle

```

Configuration
-------------

[](#configuration)

Full configuration example

```
# config/packages/i18n_form.yaml
i18n_form:
    locales: [en, fr, es, de]
    required_locales: [fr]
    excluded_fields: ['id', 'locale', 'translatable']
    form_theme: 'bootstrap_3' # you can use 'bootstrap_3' or 'bootstrap_4' form template
```

Usage
-----

[](#usage)

Basic example

```
use Koff\Bundle\I18nFormBundle\Form\Type\TranslationsType;
//...
$builder->add('translations', TranslationsType::class);
```

Advanced example

```
use Koff\Bundle\I18nFormBundle\Form\Type\TranslationsType;
//...
$builder->add('translations', TranslationsType::class, [
    'locales' => ['en', 'fr', 'es', 'de'],          // [1]
    'default_locale' => ['en']                      // [1]
    'required_locales' => ['fr'],                   // [1]
    'fields' => [                                   // [2]
        'description' => [                          // [3.a]
            'field_type' => 'textarea',             // [4]
            'label' => 'descript.',                 // [4]
            'locale_options' => [                   // [3.b]
                'es' => ['label' => 'descripción']  // [4]
                'fr' => ['display' => false]        // [4]
            ]
        ]
    ],
    'excluded_fields' => ['details']                // [2]
]);
```

- \[1\] Optionnal. If set, override the default value from config.yml
- \[2\] Optionnal. If set, override the default value from config.yml
- \[3\] Optionnal. If set, override the auto configuration of fields
- \[3.a\] Optionnal. - For a field, applied to all locales
- \[3.b\] Optionnal. - For a specific locale of a field
- \[4\] Optionnal. Common options of symfony forms (max\_length, required, trim, read\_only, constraints, ...), which was added 'field\_type' and 'display'

Additional
----------

[](#additional)

#### TranslationsFormsType

[](#translationsformstype)

A different approach for entities which don't share fields untranslated. No strategy used here, only a locale field in your entity.

```
use Koff\Bundle\I18nFormBundle\Form\Type\TranslationsFormsType;
//...
$builder->add('translations', TranslationsFormsType::class, [
    'locales' => ['en', 'fr', 'es', 'de'],   // [1]
    'default_locale' => ['en']               // [1]
    'required_locales' => ['fr'],            // [1]
    'form_type' => ProductMediaType::class,  // [2 - Mandatory]
    'form_options' => [                      // [2bis]
        'context' => 'pdf'
    ]
]);
```

- \[1\] Optionnal. If set, override the default value from config.yml
- \[2 - Mandatory\]. A real form type that you have to do
- \[2bis\] Optionnal. - An array of options that you can set to your form

#### TranslatedEntityType

[](#translatedentitytype)

Modified version of the native 'entity' symfony2 form type to translate the label in the current locale by reading translations

```
use Koff\Bundle\I18nFormBundle\Form\Type\TranslatedEntityType;
//...
$builder->add('medias', TranslatedEntityType::class, [
    'class' => 'App\Entity\Media',      // [1 - Mandatory]
    'translation_property' => 'text',   // [2 - Mandatory]
    'multiple' => true,                 // [3]
]);
```

- \[1\] Path of the translatable class
- \[2\] Property/Method of the translatable class that will be display
- \[3\] Common options of the 'entity' symfony2 form type (multiple, ...)

Credits
=======

[](#credits)

All credits goes to [David ALLIX](https://github.com/a2lix) and his [a2lix/TranslationFormBundle](https://github.com/a2lix/TranslationFormBundle)

License
=======

[](#license)

This package is available under the MIT license.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~3 days

Total

8

Last Release

3040d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75b6c3acf8688774bcabd333a8af13a862e2438dae9405c503e49f40124b38ab?d=identicon)[sadikoff](/maintainers/sadikoff)

---

Top Contributors

[![webda2l](https://avatars.githubusercontent.com/u/517753?v=4)](https://github.com/webda2l "webda2l (91 commits)")[![sadikoff](https://avatars.githubusercontent.com/u/213810?v=4)](https://github.com/sadikoff "sadikoff (83 commits)")[![tristanbes](https://avatars.githubusercontent.com/u/346010?v=4)](https://github.com/tristanbes "tristanbes (5 commits)")[![craue](https://avatars.githubusercontent.com/u/800119?v=4)](https://github.com/craue "craue (3 commits)")[![rvanlaak](https://avatars.githubusercontent.com/u/2707563?v=4)](https://github.com/rvanlaak "rvanlaak (3 commits)")[![mablae](https://avatars.githubusercontent.com/u/389360?v=4)](https://github.com/mablae "mablae (2 commits)")[![lemoinem](https://avatars.githubusercontent.com/u/234992?v=4)](https://github.com/lemoinem "lemoinem (2 commits)")[![garak](https://avatars.githubusercontent.com/u/179866?v=4)](https://github.com/garak "garak (2 commits)")[![scheb](https://avatars.githubusercontent.com/u/1259952?v=4)](https://github.com/scheb "scheb (2 commits)")[![krixer](https://avatars.githubusercontent.com/u/1197537?v=4)](https://github.com/krixer "krixer (1 commits)")[![adamelso](https://avatars.githubusercontent.com/u/5972864?v=4)](https://github.com/adamelso "adamelso (1 commits)")[![mickaelandrieu](https://avatars.githubusercontent.com/u/1247388?v=4)](https://github.com/mickaelandrieu "mickaelandrieu (1 commits)")[![mmoreram](https://avatars.githubusercontent.com/u/521409?v=4)](https://github.com/mmoreram "mmoreram (1 commits)")[![montabou](https://avatars.githubusercontent.com/u/792812?v=4)](https://github.com/montabou "montabou (1 commits)")[![mweimerskirch](https://avatars.githubusercontent.com/u/362092?v=4)](https://github.com/mweimerskirch "mweimerskirch (1 commits)")[![raziel057](https://avatars.githubusercontent.com/u/652505?v=4)](https://github.com/raziel057 "raziel057 (1 commits)")[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (1 commits)")[![tobias-93](https://avatars.githubusercontent.com/u/3901745?v=4)](https://github.com/tobias-93 "tobias-93 (1 commits)")[![Videl](https://avatars.githubusercontent.com/u/123554?v=4)](https://github.com/Videl "Videl (1 commits)")[![markitosgv](https://avatars.githubusercontent.com/u/1706470?v=4)](https://github.com/markitosgv "markitosgv (1 commits)")

---

Tags

internationalizationlocalizationsymfony-bundlesymfony-formssymfony4knplabsinternationalizationi18ntranslationSymfony2translatabledoctrine2form

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/koff-i18n-form-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/koff-i18n-form-bundle/health.svg)](https://phpackages.com/packages/koff-i18n-form-bundle)
```

###  Alternatives

[a2lix/translation-form-bundle

Translate your doctrine objects easily with some helpers

3376.9M38](/packages/a2lix-translation-form-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M650](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M309](/packages/easycorp-easyadmin-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[lexik/translation-bundle

This bundle allows to import translation files content into the database and provide a GUI to edit translations.

4362.7M19](/packages/lexik-translation-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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