2017 © Pedro Peláez
 

symfony-bundle transformat-bundle

Symfony Bundle to format and sort translation files

image

decline/transformat-bundle

Symfony Bundle to format and sort translation files

  • Wednesday, April 12, 2017
  • by decline
  • Repository
  • 2 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

transformat-bundle

Build Status Scrutinizer Code Quality Code Coverage, (*1)

Symfony Bundle to format and sort translation files, (*2)

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., (*3)

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, (*4)

Limitations: * only works for xlf/xliff files at the moment, (*5)

Get the bundle using composer

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

composer require decline/transformat-bundle

Enable the bundle

Register the bundle in your application's kernel class:, (*7)

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

Configure the bundle

This could be a possible configuration for the bundle:, (*8)

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

Format all files in the directory which was configured in the settings:, (*9)

bin/console transformat:format

Format a single file in the directory which was configured in the settings:, (*10)

bin/console transformat:format foobar.en.xlf

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, (*11)

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

to this location (for example) in your application, (*12)

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

and make your desired adjustments., (*13)

The Versions

12/04 2017

dev-master

9999999-dev

Symfony Bundle to format and sort translation files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Huppmann

translations formatting

12/04 2017

1.0.4

1.0.4.0

Symfony Bundle to format and sort translation files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Huppmann

translations formatting

11/04 2017

1.0.3

1.0.3.0

Symfony Bundle to format and sort translation files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Huppmann

translations formatting

11/04 2017

1.0.2

1.0.2.0

Symfony Bundle to format and sort translation files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Huppmann

translations formatting