PHPackages                             devture/symfony-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. [Localization &amp; i18n](/categories/localization)
4. /
5. devture/symfony-translation-bundle

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

devture/symfony-translation-bundle
==================================

Symfony bundle that allows .json files to be translated between multiple languages.

2.4.2(2y ago)3818BSD-3-ClausePHPPHP &gt;=7.1

Since Jan 26Pushed 2y ago1 watchersCompare

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

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

Description
===========

[](#description)

Web UI for managing Symfony bundles' translation files inside the actual web application.

This is a port of the similarly named [Silex](https://silex.symfony.com/) bundle: [devture/silex-translation-bundle](https://github.com/devture/silex-translation-bundle)

Finds all source language files (example: `messages.en.json`, `another-domain.en.json`) in a given list of base directories and allows these files to be translated to all given languages.

A `{translationDomain}.{targetLanguage}.json` file is generated and saved next to `{translationDomain}{sourceLanguage}.json` for each locale, whenever the translations for it are saved.

A `{translationDomain}{targetLanguage}.hash.json` file is also saved in the same directory. It contains "hints" telling the translation system which source translation string a given translation is derived from. This is so that a translation can be considered outdated if the source translation string changes. At this moment, outdated translations are automatically marked as untranslated in the web UI (that is to say, they are not marked as "already translated, but outdated", but simply as "not translated").

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

[](#installation)

Install through composer (`composer require --dev devture/symfony-translation-bundle`).

Add to `config/bundles.php`:

```
Devture\Bundle\TranslationBundle\DevtureTranslationBundle::class => ['dev' => true],
```

Permissions
-----------

[](#permissions)

Since the translation system needs to save translation files in the project, we need to grant file-writing privileges to the web server user.

Example:

```
$ find /srv/http/my-project/src -type d -name translations | xargs chown :http
$ find /srv/http/my-project/src -type d -name translations | xargs chmod g+w
```

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

[](#configuration)

You most likely want this bundle active only for your development (`dev`) environment. Thus, you can drop the following routing config in `config/packages/dev/devture_translation.yaml`

```
devture_translation:
    source_language_locale_key: en
    paths_to_translate:
        - "%kernel.project_dir%/src"
        - "%kernel.project_dir%/translations"
    locales:
        - {"key": "en", "name": "English"}
        - {"key": "ja", "name": "Japanese"}
    twig_layout_path: "base.html.twig"
```

`locales` needs to contain all languages that the translation system should be active for (**including** the source language).

Multiple paths can be specified in `paths_to_translate`. Each is scanned for files matching the following pattern: `*/translations/..json`.

`twig_layout_path` is the path to your layout file, which would contain the translation system. The only requirement is that it defines a `content` block. The translation system would render within it.

Example layout file:

```

		Website
		{% block content %}{% endblock %}

```

Routing example
---------------

[](#routing-example)

You most likely want this bundle active only for your development (`dev`) environment. Thus, you can drop the following routing config in `config/routes/dev/DevtureTranslationBundle.yaml`:

```
DevtureTranslationBundleWebsite:
    prefix: /{_locale}/translation
    resource: "@DevtureTranslationBundle/Resources/config/routes/website.yaml"
    requirements:
        _locale: "en|ja"
```

The Web UI is available at the `devture_translation.manage` route.

Styling
-------

[](#styling)

This bundle relies on [Bootstrap](http://getbootstrap.com/) v4 for styling. Unless you install and include it (somewhere in your `twig_layout_path` template), things would look ugly.

Additionally, you can make the pages look prettier by including a flag icon for each language somewhere in your layout or CSS file.

```

	.devture-translation-flag {
		border: 1px solid #dbdbdb;
		width: 20px;
		height: 13px;
		display: inline-block;
		vertical-align: text-top;
	}
	.devture-translation-flag.en {
		background: url('/images/flag/en_US.png') no-repeat;
	}
	.devture-translation-flag..ja {
		background: url('/images/flag/ja_JP.png') no-repeat;
	}

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~98 days

Total

12

Last Release

850d ago

Major Versions

1.0.3 → 2.02020-02-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/9daf523f8e47ddeb8af23183c06721c4e89111eb4eb3f9ce264242b373e9dd80?d=identicon)[spantaleev](/maintainers/spantaleev)

---

Top Contributors

[![spantaleev](https://avatars.githubusercontent.com/u/388669?v=4)](https://github.com/spantaleev "spantaleev (18 commits)")

---

Tags

symfonybundleinternationalizationtranslation

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/devture-symfony-translation-bundle/health.svg)](https://phpackages.com/packages/devture-symfony-translation-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)[willdurand/js-translation-bundle

A pretty nice way to expose your translation messages to your JavaScript.

58917.1M55](/packages/willdurand-js-translation-bundle)

PHPackages © 2026

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