PHPackages                             decline/transformat-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. decline/transformat-bundle

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

decline/transformat-bundle
==========================

Symfony Bundle to format and sort translation files

1.0.4(9y ago)016[1 issues](https://github.com/decline/transformat-bundle/issues)MITPHPPHP &gt;=5.5.9

Since Apr 11Pushed 9y ago2 watchersCompare

[ Source](https://github.com/decline/transformat-bundle)[ Packagist](https://packagist.org/packages/decline/transformat-bundle)[ RSS](/packages/decline-transformat-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

transformat-bundle
==================

[](#transformat-bundle)

[![Build Status](https://camo.githubusercontent.com/e89f5c2050b502201b52626a0a3fe396b1ac5c6fc446e8a63497f2cbfd0135ef/68747470733a2f2f7472617669732d63692e6f72672f6465636c696e652f7472616e73666f726d61742d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/decline/transformat-bundle) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/7ff749a5c772e9955fafe4382bc45c762c6b05711b9d4023130b0263e7fc3c14/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465636c696e652f7472616e73666f726d61742d62756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/decline/transformat-bundle/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/237878d741760e2c4b3bff61ef4d47dbff96783c5ba952de461eee4e06477c40/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6465636c696e652f7472616e73666f726d61742d62756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/decline/transformat-bundle/?branch=master)

Symfony Bundle to format and sort translation files

Have you ever been fed up about keeping the content of your Symfony translation files organized, well structured and sorted? Yeah, me too. That's why I developed this little bundle to make things easier.

What it does:

- structures your translation files by a given template (which you can override of course)
- alphabetically sorts your entries by the *source* key
- checks for duplicate trans-unit id's in your xlf files
- optionally validates your xlf files against a xsd schema

Limitations:

- only works for xlf/xliff files at the moment

Get the bundle using composer
-----------------------------

[](#get-the-bundle-using-composer)

To install the bundle, require it using composer by running the following command at the root of your application:

```
composer require decline/transformat-bundle
```

Enable the bundle
-----------------

[](#enable-the-bundle)

Register the bundle in your application's kernel class:

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Decline\TransformatBundle\DeclineTransformatBundle(),
            // ...
        ];
    }
}
```

Configure the bundle
--------------------

[](#configure-the-bundle)

This could be a possible configuration for the bundle:

```
decline_transformat:
    directory: "%kernel.root_dir%/Resources/translations"   # The directory where the translation files are located.
    xliff:
        extension: xlf                                      # The extension of the translation files which should be formatted. Default value is 'xlf', can be one of ['xlf', 'xliff']
        sourceLanguage: en                                  # The source language of the translation files. Default value is 'en'
        namespace: urn:oasis:names:tc:xliff:document:1.2    # The xml namespace for translation files. Default value is 'urn:oasis:names:tc:xliff:document:1.2'
        validation: false                                   # If set, your xlf files will be validated against either a transitional or strict xsd schema. Default value is 'false', can be one of [false, 'transitional', 'strict']
```

Usage
-----

[](#usage)

Format all files in the directory which was configured in the settings:

```
bin/console transformat:format
```

Format a single file in the directory which was configured in the settings:

```
bin/console transformat:format foobar.en.xlf
```

Override template
-----------------

[](#override-template)

If you wish to override the twig template which is used for generating the formatted xlf-files, no problem! Just copy the twig template from

```
vendor/decline/transformat-bundle/Resources/views/format.xml.twig
```

to this location (for example) in your application

```
app/Resources/DeclineTransformatBundle/views/format.xml.twig
```

and make your desired adjustments.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.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 ~0 days

Total

3

Last Release

3367d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5609744?v=4)[Dom](/maintainers/decline)[@decline](https://github.com/decline)

---

Top Contributors

[![decline](https://avatars.githubusercontent.com/u/5609744?v=4)](https://github.com/decline "decline (22 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

formatformatterformattingsymfonysymfony-bundlesymfony-commandsymfony-consoletranslationxlifftranslationsformatting

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/decline-transformat-bundle/health.svg)

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

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.8M18](/packages/barryvdh-laravel-translation-manager)[gettext/languages

gettext languages with plural rules

7832.7M12](/packages/gettext-languages)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3301.5M17](/packages/kkomelin-laravel-translatable-string-exporter)[punic/punic

PHP-Unicode CLDR

1573.0M30](/packages/punic-punic)[outhebox/laravel-translations

Manage your Laravel translations with a beautiful UI. Add, edit, delete, import, and export translations with ease.

813100.4k](/packages/outhebox-laravel-translations)[outl1ne/nova-translations-loader

This Laravel Nova package helps developers load translations into their packages.

396.0M52](/packages/outl1ne-nova-translations-loader)

PHPackages © 2026

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