PHPackages                             ao/translation-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. [Database &amp; ORM](/categories/database)
4. /
5. ao/translation-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

ao/translation-bundle
=====================

Doctrine as symfony translation provider + a nice gui for editing translations.

1.0.4(11y ago)243.7k3MITPHPPHP &gt;=5.3

Since Mar 7Pushed 11y ago3 watchersCompare

[ Source](https://github.com/adrianolek/AOTranslationBundle)[ Packagist](https://packagist.org/packages/ao/translation-bundle)[ Docs](https://github.com/adrianolek/AOTranslationBundle)[ RSS](/packages/ao-translation-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

AOTranslationBundle Overview
============================

[](#aotranslationbundle-overview)

This bundle provides doctrine as translations storage and a nice web gui accessible from the profiler for easy translation.

[![Build Status](https://camo.githubusercontent.com/1bd1597224fd5b26cd248ac32629e321016b57e97ab801caf64ff7c886cd0838/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f61647269616e6f6c656b2f414f5472616e736c6174696f6e42756e646c652e706e67)](http://travis-ci.org/adrianolek/AOTranslationBundle)

- [Features](#features)
- [Installation](#installation)
    - [Require vendor libraries](#require-vendor-libraries)
    - [Add bundles to your application kernel](#add-bundles-to-your-application-kernel)
    - [Configure translator](#configure-translator)
    - [Configure doctrine extensions bundle](#configure-doctrine-extensions-bundle)
    - [Update your db schema](#update-your-db-schema)
    - [Add routing information](#add-routing-information)
- [Usage](#usage)
    - [Translations panel](#translations-panel)
    - [Translations backend](#translations-backend)
- [Additional features](#additional-features)
    - [Using separate database connection for storing translations](#using-separate-database-connection-for-storing-translations)

Features
========

[](#features)

- All translation messages are automatically saved in the database (no extraction necessary)
- Translation panel available in the Symfony web debug toolbar
- Only messages used in current action are loaded from the database
- Translations management backend available via [SonataAdminBundle](https://github.com/sonata-project/SonataAdminBundle)

Installation
============

[](#installation)

Require vendor libraries
------------------------

[](#require-vendor-libraries)

Require `ao/translation-bundle` &amp; `stof/doctrine-extensions-bundle` in `composer.json`:

```
"require": {
  "symfony/symfony": "2.1.*",
  "_comment": "other packages",
  "stof/doctrine-extensions-bundle": "1.1.*@dev",
  "ao/translation-bundle": "1.0.*@dev"
}

```

Then install or update composer bundles with:

```
php composer.phar install

```

or

```
php composer.phar update

```

Add bundles to your application kernel
--------------------------------------

[](#add-bundles-to-your-application-kernel)

In `app/AppKernel.php` add:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        //...
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
        new AO\TranslationBundle\AOTranslationBundle()
        //...
    );
}

```

Configure translator
--------------------

[](#configure-translator)

```
# app/config/config.yml
# enable translation component
framework:
    translator: ~

# use AOTranslationBundle as translator
parameters:
    translator.class: AO\TranslationBundle\Translation\Translator

# configure locales avaliable for translation
ao_translation:
    locales:
        en: ~
        de:
          label: German
        fr: ~

```

Configure doctrine extensions bundle
------------------------------------

[](#configure-doctrine-extensions-bundle)

Timestampable behavior has to be enabled.

```
# app/config/config.yml
stof_doctrine_extensions:
    orm:
        default:
            timestampable: true

```

Update your db schema
---------------------

[](#update-your-db-schema)

If you use migrations:

```
app/console doctrine:migrations:diff
app/console doctrine:migrations:migrate

```

Otherwise:

```
app/console doctrine:schema:update

```

Add routing information
-----------------------

[](#add-routing-information)

```
# app/config/routing.yml
ao_translation:
    resource: "@AOTranslationBundle/Controller/"
    type:     annotation
    prefix:   /

```

Usage
=====

[](#usage)

Use translation methods like described in [Symfony Translations](http://symfony.com/doc/current/book/translation.html) documentation.

Translations panel
------------------

[](#translations-panel)

You can access translations panel by clicking on Translations in the web debug toolbar.

[![Translations web debug toolbar](https://camo.githubusercontent.com/888d6dcda1b934907292776c8339590f7a10fbfca6c69e11452fc6cdcd98ec60/68747470733a2f2f7261772e6769746875622e636f6d2f61647269616e6f6c656b2f414f5472616e736c6174696f6e42756e646c652f6d61737465722f5265736f75726365732f646f632f696d672f70726f66696c65722e706e67)](https://camo.githubusercontent.com/888d6dcda1b934907292776c8339590f7a10fbfca6c69e11452fc6cdcd98ec60/68747470733a2f2f7261772e6769746875622e636f6d2f61647269616e6f6c656b2f414f5472616e736c6174696f6e42756e646c652f6d61737465722f5265736f75726365732f646f632f696d672f70726f66696c65722e706e67)

Now you can edit all your translation messages. Message parameters can be inserted directly into translation by clicking on the link in `Parameters` (2) column. After you are done click the `Save Translations` button (1).

As the translator needs to know which messages are used in each action, it stores this relation in a cache table. Therefore, when a message is not used anymore it will still be visible in the translations panel. To clear the cached messages use the `Reset action cache` (3) button, which will clear the cache for current action. Alternatively use the `Reset cache` (4) button, which will clear cache for all actions. The cache will be rebuilt with the next execution of an action.

[![Translations panel](https://camo.githubusercontent.com/0af5e30c1f7612b52b71dde17c83d2b8b25de6d2a9bef88e6d84ec65a4c40083/68747470733a2f2f7261772e6769746875622e636f6d2f61647269616e6f6c656b2f414f5472616e736c6174696f6e42756e646c652f6d61737465722f5265736f75726365732f646f632f696d672f70616e656c2e706e67)](https://camo.githubusercontent.com/0af5e30c1f7612b52b71dde17c83d2b8b25de6d2a9bef88e6d84ec65a4c40083/68747470733a2f2f7261772e6769746875622e636f6d2f61647269616e6f6c656b2f414f5472616e736c6174696f6e42756e646c652f6d61737465722f5265736f75726365732f646f632f696d672f70616e656c2e706e67)

Translations backend
--------------------

[](#translations-backend)

In order to use translations backend you need to install [SonataAdminBundle](http://sonata-project.org/bundles/admin/master/doc/index.html) and [SonataDoctrineORMAdminBundle](http://sonata-project.org/bundles/doctrine-orm-admin/master/doc/index.html). Please refer to their installation guide. After installation and configuration the backend will be available under `/admin/ao/translation/message/list`.

Additional features
===================

[](#additional-features)

Using separate database connection for storing translations
-----------------------------------------------------------

[](#using-separate-database-connection-for-storing-translations)

In case you need to share the translations database (eg. when multiple developers collaborate) you can [configure separate entity manager](http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html) for the bundle.

```
# app/config/config.yml
doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                ...
            # configure translations database connection
            translations:
                ...

orm:
    ...
    default_entity_manager: default
    entity_managers:
        default:
            connection: default
            mappings:
                ...
        translations:
            connection: translations
            mappings:
                AOTranslationBundle: ~

ao_translation:
    entity_manager: translations

stof_doctrine_extensions:
    orm:
        ...
        # enable timestampable behavior for translations entity manager
        translations:
            timestampable: true

```

To create translations schema add use `--em` parameter like:

```
app/console doctrine:schema:create --em=translations

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% 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 ~198 days

Total

5

Last Release

4024d ago

### Community

Maintainers

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

---

Top Contributors

[![adrianolek](https://avatars.githubusercontent.com/u/886304?v=4)](https://github.com/adrianolek "adrianolek (54 commits)")[![pinkeen](https://avatars.githubusercontent.com/u/2019132?v=4)](https://github.com/pinkeen "pinkeen (1 commits)")[![YagoQuinoy](https://avatars.githubusercontent.com/u/2685554?v=4)](https://github.com/YagoQuinoy "YagoQuinoy (1 commits)")

---

Tags

symfonyi18nuitranslationdoctrineguiinterfacemultilanguagewebinterfacewordings

### Embed Badge

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

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

###  Alternatives

[jms/translation-bundle

Puts the Symfony Translation Component on steroids

42510.8M63](/packages/jms-translation-bundle)[prezent/doctrine-translatable-bundle

Integrate the doctrine-translatable extension in Symfony

14698.4k5](/packages/prezent-doctrine-translatable-bundle)[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.

1022.4k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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