2017 © Pedro Peláez
 

symfony-bundle translation-bundle

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

image

astina/translation-bundle

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

  • Friday, July 1, 2016
  • by pkraeutli
  • Repository
  • 18 Watchers
  • 0 Stars
  • 444 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Astina Translation Bundle

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages., (*1)

Installation

Step 1: Add to composer.json

"require":  {
    "astina/translation-bundle":"dev-master",
}

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*2)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Astina\Bundle\TranslationBundle\AstinaTranslationBundle(),
    );
}

Step 3: Configure the bundle

Bundle configuration:, (*3)

# app/config/config.yml
astina_translation:
    domains: [ messages ]
    locales: [ de, fr, it, en ]
    admin:
        layout_template: ::translation_layout.html.twig
    filters:
        - { name: filter_common, domain: messages, filter: '!weather% AND !wispo% AND !booking%' }
        - { name: filter_weather, domain: messages, filter: 'weather% OR wispo%' }
        - { name: filter_booking, domain: messages, filter: 'booking%' }

Routing configuration (if admin UI is needed):, (*4)

# app/config/routing.yml
astina_translation:
    resource: "@AstinaTranslationBundle/Resources/config/routing.yml"
    prefix:   /admin/translations

Usage

You can add/update messages using the translation repository service:, (*5)

$repo = $container->get('astina_translation.repository.translation');
$repo->set('messages', 'foo', 'fr', 'foux');

Note: after adding/changing translations, the cache needs to be cleared., (*6)

If you have added the routing config, you can access /admin/translations to edit messages stored in the database. The cache is automatically cleared after saving., (*7)

Dumping Translations

You can dump all stored translations to PHP array or JSON string by using the dump command:, (*8)

php app/console astina:translation:dump

The Versions

01/07 2016

dev-master

9999999-dev http://astina.ch

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

  Sources   Download

MIT

The Requires

 

by Astina AG

database translations doctrine

01/07 2016

1.0.0

1.0.0.0 http://astina.ch

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

  Sources   Download

MIT

The Requires

 

by Astina AG

database translations doctrine

09/05 2014

0.2.0

0.2.0.0 http://astina.ch

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

  Sources   Download

MIT

The Requires

 

by Astina AG

database translations doctrine

06/05 2014

0.1.0

0.1.0.0 http://astina.ch

DoctrineLoader to store translations in the database plus simple admin UI to edit translation messages.

  Sources   Download

MIT

The Requires

 

by Astina AG

database translations doctrine