2017 © Pedro Peláez
 

symfony-bundle cool-sonata-translation-bundle

Integration of translation into sonata admin

image

coolshop/cool-sonata-translation-bundle

Integration of translation into sonata admin

  • Friday, November 4, 2016
  • by alberto-coolshop
  • Repository
  • 6 Watchers
  • 0 Stars
  • 59 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 28 Forks
  • 0 Open issues
  • 23 Versions
  • 0 % Grown

The README.md

CoolSonataTranslationBundle

The CoolSonataTranslationBundle is the bundle that manage to handle your Symfony Translations into Database. The integration with Sonata Admin is possible thanks to Ibrows, (*1)

image, (*2)

Installation

Add the following lines in your composer.json:, (*3)

{
    "require": {
        "coolshop/cool-sonata-translation-bundle" : "^2.0",
    }
}

To start using the bundle, register the CoolSonataTranslationBundle in your application's kernel class:, (*4)

<php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Coolshop\CoolSonataTranslationBundle\CoolSonataTranslationBundle(),
    );
)

Configuration

app/config/config.yml

cool_sonata_translation:
    defaultDomain: messages
    editable:
        mode: inline         # Mode of editable, can be popup or inline
        type: textarea       # Type of input. Can be text|textarea|select|date|checklist and more
        emptytext: Empty     # text to display on empty translations
        placement: top       # ingnored for inline mode
    localeManager: '@cool_sonata_translation.locale_manager.sonatapage' #service that handles the locale available. Could be an array of locale (eg. localeManager: ['en', 'fr', 'es', 'de'])
    driver: orm              # Only ORM available at the moment.
    database:
        entity_manager:      # if not specified will use default. This way you could handle translations with a separate EM.

Usage

Setup the translation table

./app/console doctrine:schema:update --force

In order to have some keys shown up in the admin panel, you have to import the translation files first. This is done through a command:, (*5)

./app/console cool:translations:import [-c] 

This command also has a "-c" so you can clear the database first. might be a bit faster for larger imports if your table is already filled., (*6)

Generate dummy translation files or using configuration, (*7)

./app/console asm:translations:dummy

Since the TranslationLoader bases on files, you'd have to create empty files like "messages.en_US.db" for each language you want to use with your translation database. The files will be placed in app/Resources/translations/*, (*8)

NOTE: each time you modify translations into DB you have to clear the cache in order to use the new one., (*9)

./app/console cache:clear

@TODO: make clear cache possible from admin panel., (*10)

Sonata Admin Integration

To include the bundle in the admin dashboard, add group "group.translation" to dashboard, (*11)

# app/config/config.yml
sonata_admin:
    dashboard:
        groups:
            group.translation:
                label: Translation
                items: ~ 

That's all folks! Come to say Hi at Coolshop, (*12)

The Versions

04/11 2016

dev-master

9999999-dev

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

04/11 2016

2.0.4

2.0.4.0

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

25/10 2016

2.0.3

2.0.3.0

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

25/10 2016

2.0.2

2.0.2.0

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

25/10 2016

2.0.1

2.0.1.0

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

25/10 2016

dev-fix-cache-clear

dev-fix-cache-clear

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

25/10 2016

2.0.0

2.0.0.0

Integration of translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata coolshop

03/07 2015

1.1.1

1.1.1.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

17/06 2015

1.1.0

1.1.0.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

17/03 2015

1.0.13

1.0.13.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

12/11 2014

1.0.12

1.0.12.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

09/07 2014

1.0.11

1.0.11.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

03/07 2014

1.0.10

1.0.10.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

03/07 2014

1.0.9

1.0.9.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

13/05 2014

1.0.8

1.0.8.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

30/04 2014

1.0.7

1.0.7.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

06/01 2014

1.0.6

1.0.6.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

06/01 2014

1.0.5

1.0.5.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

07/11 2013

1.0.4

1.0.4.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

19/09 2013

1.0.3

1.0.3.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

10/09 2013

1.0.2

1.0.2.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

23/07 2013

1.0.1

1.0.1.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik

16/07 2013

1.0.0

1.0.0.0

Integration of lexik translation into sonata admin

  Sources   Download

MIT

The Requires

 

translation sonata ibrows lexik