PHPackages                             nercury/translation-editor-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. nercury/translation-editor-bundle

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

nercury/translation-editor-bundle
=================================

Translation editor form. Defines a form type to edit localized object translations.

v0.1.4(10y ago)12.7k33ApachePHPPHP &gt;=5.3.2

Since Jan 31Pushed 10y ago3 watchersCompare

[ Source](https://github.com/evispa/TranslationEditorBundle)[ Packagist](https://packagist.org/packages/nercury/translation-editor-bundle)[ Docs](https://github.com/Nercury/TranslationEditorBundle)[ RSS](/packages/nercury-translation-editor-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (3)

What it is
==========

[](#what-it-is)

It is a translation editor form.

[![Translation editor example](https://github.com/Nercury/TranslationEditorBundle/raw/master/Resources/public/images/translations-preview.jpg?raw=true)](https://github.com/Nercury/TranslationEditorBundle/blob/master/Resources/public/images/translations-preview.jpg?raw=true)

Using it with array
===================

[](#using-it-with-array)

Example data:

```
$data = array(
    'translations' => array(
        array(
            'lang' => 'lt',
            'name' => 'Produktas',
            'description' => 'Produkto aprašymas'
        ),
        array(
            'lang' => 'en',
            'name' => 'Product',
            'description' => 'Product description',
        ),
    ),
);
```

Form requires that you create a form type for inner item, in this case it is named "TestType":

```
class TestType extends \Symfony\Component\Form\AbstractType
{
    public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options)
    {
        $builder->add('name');
        $builder->add('description');
    }

    public function getName()
    {
        return 'translation_item_form';
    }
}
```

Form type is implemented in similar fassion as a collection. Use "type" to specify inner type form. Use "locale\_field\_name" to override locale field name (default is "lang").

```
$formBuilder = $this->createFormBuilder($data);
$formBuilder->add('translations', 'translations', array(
    'type' => new TestType(),
    'locale_field_name' => '[lang]',
    'locales' => array('lt', 'en', 'ru'),
));
```

Using it with a collection and entities
=======================================

[](#using-it-with-a-collection-and-entities)

Form type also works with database translations defined in this or smilar table structure:

```

| product    |        | product_translation |
| id         | ------ | product_id          |
                      | lang                |
                      | name (localised)    |

```

It follows the same style the old Doctrine1 behaviours used to do it.

Main Product entity must have a doctrine collection of translations, and "getTranslations()" method, and you should build your form using its name.

It will find other stuff in Doctrine class metadata.

Form theme
==========

[](#form-theme)

You can override form theme by overriding "fields.html.twig" file.

Javascript
==========

[](#javascript)

```
@NercuryTranslationEditorBundle/Resources/public/js/translations_form.js

```

Example
=======

[](#example)

Example doctrine entity:

```
namespace Example\AcmeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="acme")
 */
class Acme
{
	/**
     * @var \Doctrine\Common\Collections\ArrayCollection|AcmeTranslation[]
     *
     * @ORM\OneToMany(
     *      targetEntity="Example\AcmeBundle\Entity\AcmeTranslation",
     *      mappedBy="acme",
     *      cascade={"persist", "remove"}
     * )
     */
    private $translations;
}

namespace Example\AcmeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="acme_translations")
 */
class AcmeTranslation
{
	/**
     * @var Acme $acme
     *
     * @ORM\ManyToOne(targetEntity="Example\AcmeBundle\Entity\Acme", inversedBy="translations")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(
     *       name="acme_id",
     *       referencedColumnName="id",
     *       onDelete="CASCADE",
     *       nullable=false
     *   )
     * })
     */
    private $acme;

	/**
     * @var string $lang
     *
     * @ORM\Column(name="lang", type="string", length=31, nullable=false)
     */
    private $lang;

    /**
     * @var string $title
     *
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
     */
    private $title;

    /**
     * @var string $description
     *
     * @ORM\Column(name="description", type="text", nullable=true)
     */
    private $description;
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.7% 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 ~165 days

Total

5

Last Release

3821d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ddfa322db7376aeb74409dfb0d7a1349818e2567b8f3e3010d60d5a187d4ea9?d=identicon)[Tadcka](/maintainers/Tadcka)

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

---

Top Contributors

[![Nercury](https://avatars.githubusercontent.com/u/106180?v=4)](https://github.com/Nercury "Nercury (11 commits)")[![tadcka](https://avatars.githubusercontent.com/u/2020827?v=4)](https://github.com/tadcka "tadcka (5 commits)")[![egils](https://avatars.githubusercontent.com/u/399994?v=4)](https://github.com/egils "egils (1 commits)")

---

Tags

translationstranslationlocales

### Embed Badge

![Health badge](/badges/nercury-translation-editor-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nercury-translation-editor-bundle/health.svg)](https://phpackages.com/packages/nercury-translation-editor-bundle)
```

###  Alternatives

[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)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[laravel-lang/locales

Basic functionality for working with localizations

134.5M12](/packages/laravel-lang-locales)[whitecube/lingua

A PHP language codes converter, from and to the most common formats (ISO, W3C, PHP and human-readable names).

441.2M15](/packages/whitecube-lingua)[om/potrans

Command line tool for translate Gettext with Google Translator API or DeepL API

10515.0k4](/packages/om-potrans)[andrewdwallo/transmatic

Automate and streamline real-time text translations in your Laravel applications

5511.6k](/packages/andrewdwallo-transmatic)

PHPackages © 2026

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