PHPackages                             braunstetter/translated-forms - 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. braunstetter/translated-forms

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

braunstetter/translated-forms
=============================

Translate your forms. Simple and easy.

v0.1.3(3y ago)0286MITPHPPHP ^8.0

Since Apr 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Braunstetter/translated-forms)[ Packagist](https://packagist.org/packages/braunstetter/translated-forms)[ RSS](/packages/braunstetter-translated-forms/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (4)Dependencies (11)Versions (5)Used By (0)

Translated (Symfony) Forms
==========================

[](#translated-symfony-forms)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b514c42d69db48fe187bd9bbd075460a5fa638955604bd20911f13d00643b0dd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f427261756e737465747465722f7472616e736c617465642d666f726d732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/Braunstetter/menu-bundle/?branch=main)[![Build Status](https://camo.githubusercontent.com/6f2be2bc2b90d13167aa8881f4889b98f207797a51e3da4dbeca48f8f56fa68d/68747470733a2f2f6170702e7472617669732d63692e636f6d2f427261756e737465747465722f7472616e736c617465642d666f726d732e7376673f6272616e63683d6d61696e)](https://app.travis-ci.com/Braunstetter/menu-bundle)[![License](https://camo.githubusercontent.com/472c29eafa9d360274640ded16f43223d55150fca16064b9d68842d56f2a8e8a/687474703a2f2f706f7365722e707567782e6f72672f627261756e737465747465722f7472616e736c617465642d666f726d732f6c6963656e7365)](https://packagist.org/packages/braunstetter/translated-forms)

This bundle gives you a `translated` option for your Symfony forms. So when you switch languages your forms are translated and work just fine.

It is assumed that you are using the [KNP Doctrine Behaviours](https://github.com/KnpLabs/DoctrineBehaviors/blob/master/docs/translatable.md) for your translations.

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

[](#installation)

`composer require braunstetter/translated-forms`

Usage
-----

[](#usage)

Once installed this bundle lets you set an option inside your form parameter array:

```
public function configureOptions(OptionsResolver $resolver): void
{
    $resolver->setDefaults([
        'translated' => true
    ]);
}
```

When this is set to true your form will react to the current locale inside your request object.

> It is important to use [Proxy Translations](https://github.com/KnpLabs/DoctrineBehaviors/blob/master/docs/translatable.md#proxy-translations) to allow this bundle to read data by a magic method.

Why should you use this bundle?
-------------------------------

[](#why-should-you-use-this-bundle)

There is the popular [a2lix/translation-form-bundle](https://github.com/a2lix/TranslationFormBundle). It is actively maintained and if you like it - you can stick to it.

But to use `a2lix/translation-form-bundle` there is some CSS and Javascript required. Also, it comes with a dedicated FormType. So you have to wrap every field inside this FormType. It provides these clickable tabs for every single translated field, which is not so handy, when you just want to translate your whole form.

`braunstetter/translated-forms` will just work fine with all your Symfony forms. No extra CSS no Javascript no extra FormType to implement. Your forms stay the same. Just switch the languages and even nested forms are translated.

Custom Traits
-------------

[](#custom-traits)

Knp Doctrine Behaviours brings some Traits to your translatable Entities and your translations.

By default, it assumes you put the translation Entity into the same folder as the translatable. This gets quite messy, as soon as you translate a lot.

So `braunstetter/translated-forms` bundle delivers two traits. [TranslatableTrait](src/Entity/Trait/TranslatableTrait.php) and [TranslationTrait](src/Entity/Trait/TranslationTrait.php).

They work just the same way as the default one's form KNP (in fact they use it under the hood), but they put translations into a `Translation` folder - and they implement the magic `__call` method which is required for this bundle to translate your forms.

How does this magic happen?
---------------------------

[](#how-does-this-magic-happen)

### Reading the data (mapDataToForms)

[](#reading-the-data-mapdatatoforms)

If enabled this bundle sets a new data mapper to your forms.

The default data mapper of the Symfony form component does not work with magic properties - the data mapper of this bundle does.

### Writing the data (mapFormsToData)

[](#writing-the-data-mapformstodata)

When data of a form is going to be saved - this data mapper tries to save it the normal way.

If the field of the base entity is not writeable directly it is going to pick the current translation and is writing it into it.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

4

Last Release

1307d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0e9d8fa33ff9927391698d8e3cf51c22ec31b396196c1f50614e5a6fe02dd07?d=identicon)[Slowwie](/maintainers/Slowwie)

---

Top Contributors

[![MichaelBrauner](https://avatars.githubusercontent.com/u/4937572?v=4)](https://github.com/MichaelBrauner "MichaelBrauner (11 commits)")

---

Tags

formphpsymfonytranslationtranslationstranslateform

### Embed Badge

![Health badge](/badges/braunstetter-translated-forms/health.svg)

```
[![Health](https://phpackages.com/badges/braunstetter-translated-forms/health.svg)](https://phpackages.com/packages/braunstetter-translated-forms)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)[sylius/sylius

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

8.5k5.9M735](/packages/sylius-sylius)[prestashop/prestashop

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

9.1k17.8k](/packages/prestashop-prestashop)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)

PHPackages © 2026

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