lordjancso/translation-bundle

Translation bundle for Symfony to manage your translations.

Maintainers

Package info

github.com/lordjancso/TranslationBundle

Type:symfony-bundle

pkg:composer/lordjancso/translation-bundle

Statistics

Installs: 9 899

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.6 2026-03-26 13:12 UTC

This package is auto-updated.

Last update: 2026-03-26 13:12:44 UTC


README

Translation bundle for Symfony to manage your translations in the database.

CI Latest Stable Version Total Downloads License

Requirements

  • PHP 8.2+
  • Symfony 6.4 / 7.4 / 8.0
  • Doctrine ORM

Installation

composer require lordjancso/translation-bundle

Configuration

# config/packages/lordjancso_translation.yaml

lordjancso_translation:
    managed_locales: ['en', 'fr', 'de']    # required
    extract:
        translations_dir: 'translations'    # default: 'translations'
        exclude_domains: []                 # default: []

Optionally you can add a route to check your translation progress.

# config/routes/dev/lordjancso_translation.yaml

lordjancso_translation:
    resource: "@LordjancsoTranslationBundle/Resources/config/routes.xml"
    prefix: /lordjancso-translation

Create the database tables with Doctrine:

php bin/console doctrine:schema:update --force

Usage

Extract

Extract translation keys from your source code into YAML files.

php bin/console lordjancso:extract-translations hu

Export

Export translations from the database to YAML files.

php bin/console lordjancso:export-translations

Import

Import YAML translation files into the database.

php bin/console lordjancso:import-translations

Translation stats UI

If you added the route, visit /lordjancso-translation to see a translation coverage overview per domain and locale.

Testing

./vendor/bin/simple-phpunit

Limitations

  • Only supports Doctrine ORM with MySQL