2017 © Pedro Peláez
 

symfony-bundle symfony-translation-bundle

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle.

image

weprovide/symfony-translation-bundle

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle.

  • Tuesday, February 20, 2018
  • by timneutkens
  • Repository
  • 2 Watchers
  • 2 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

We Provide Translation Bundle

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle. Both bundles are awesome but do not work together out of the box. Using this bundle you'll be able to extract and manage your translations through the easy-to-use admin., (*1)

Dependencies

This bundle is developed with a Symfony Standard Edition on PHP 7.1 using We Provide's version of valet. Obviously it has dependencies to other projects and/or bundles. Below a list of dependencies, please use the installation guides of these bundles first. * Symfony Standard Edition 3.3 * Sonata Admin Bundle 3.18 (with SonataDoctrineORMAdminBundle) * JMS Translation Bundle 1.3 * Ivory CK Editor ^4.0, (*2)

Installation

Install this bundle into your project using Composer., (*3)

composer require weprovide/symfony-translation-bundle

Enable the bundle by inserting it in your Symfony's AppKernel.php., (*4)

// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new WeProvide\TranslationBundle\WeProvideTranslationBundle(),
        );

        // ...
    }

    // ...
}

Import the global config of this bundle in your project's config.yml., (*5)

imports:
    - { resource: "@WeProvideTranslationBundle/Resources/config/config.yml" }

Configure your locales and translation files folder in your config.yml., (*6)

we_provide_translation:
    # defaults to 'en' if not set, you can use strings like 'en' or a parameter
    default_locale: '%locale%'

    # required, array with locales you wish the manage
    locales: [en, nl_NL]

    # optional, array with (paths of) your bundles to extract translations from
    # if omitted, extracts from your complete project 
    translate_bundles: [YourAppBundle]

    # optional, location where translation files will be written
    # if omitted, '@WeProvidePortalBundle/Resources/translations' will be the target
    resource: '@YourAppBundle/Resources/translations'

Commands

In production or other non-debug environments the translations stored in YML are only updated when the cache is cleared. This bundle provides a command to clear cache when a translation has been changed. It's safe to execute or set this command as cron., (*7)

php bin/console weprovide:translation:recache --env=[prod,stag,dev]

You can schedule an extraction of translations from the admin interface. This will not extract the translations directly because this can take a long time. Instead set the command below as cron to do actually execute the scheduled extraction. This will also clear the cache after extraction., (*8)

php bin/console weprovide:translation:reextract

You can use the command below to extract the translations., (*9)

php bin/console weprovide:translation:extract

License

This bundle has been released under the MIT license and open for improvements, please share your thoughts which will be much appreciated., (*10)

Authors

The Versions

20/02 2018

dev-master

9999999-dev

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle.

  Sources   Download

MIT

by Mischa Braam

translation sonata i18n jms multilanguage weprovide

16/01 2018

0.1.1

0.1.1.0

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle.

  Sources   Download

MIT

by Mischa Braam

translation sonata i18n jms multilanguage weprovide

24/10 2017

0.1.0

0.1.0.0

The We Provide Translation Bundle for Symfony incorporates the JMS/TranslationBundle into the Sonata/AdminBundle.

  Sources   Download

MIT

by Mischa Braam

translation sonata i18n jms multilanguage weprovide