Symfony integration for Translations
Clone or download
Latest commit fe29aef Oct 2, 2018
Permalink
Failed to load latest commit information.
Catalogue Better respect blacklist and whitelist (#220) Apr 12, 2018
Command Add "up" to available direction in sync command (#251) Aug 9, 2018
Controller Using MessageInterface (#191) Apr 10, 2018
DependencyInjection Fix the FileDumper::setBackup() method deprecation notice (#236) Jun 26, 2018
EditInPlace Removed feature folder (#69) Jan 5, 2017
EventListener depend on router interface instead of concrete implementation (#144) Jan 2, 2018
Exception Added validation for the ajax requests (#8) Dec 5, 2016
Model Add support for adding translation on SourceLocation (#219) Apr 11, 2018
Resources New Feature add Filters in webui (#250) Aug 8, 2018
Service Fixed wrong operand precedence (#258) Sep 5, 2018
Tests Ensure storage exists before using it in commands (#239) Jun 26, 2018
Translator Make sure we got a locale before we start to translate (#229) May 22, 2018
Twig Use "desc" as default translation when extracting (#218) Apr 11, 2018
.editorconfig Init Nov 28, 2016
.gitattributes Init Nov 28, 2016
.gitignore Init Nov 28, 2016
.php_cs Init Nov 28, 2016
.scrutinizer.yml Prepare for 0.3.1 (#84) Mar 12, 2017
.styleci.yml Init Nov 28, 2016
.travis.yml Only measure code coverage on Unit tests. (#242) Jun 26, 2018
Changelog.md Prepare for 0.8.1 (#266) Oct 2, 2018
Readme.md Fix for symfony 4 templates (#169) Dec 31, 2017
TranslationBundle.php Fix the FileDumper::setBackup() method deprecation notice (#236) Jun 26, 2018
composer.json Only measure code coverage on Unit tests. (#242) Jun 26, 2018
phpunit.xml.dist Add Symfony 4 support (#145) Dec 28, 2017

Readme.md

Translation Bundle

Latest Version Build Status Code Coverage Quality Score SensioLabsInsight Total Downloads Coding Style

Symfony integration for PHP Translation

Install

Via Composer

$ composer require php-translation/symfony-bundle
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Translation\Bundle\TranslationBundle(),
        }
    }
}

An example configuration looks like this:

# config.yml
translation:
    locales: ["en", "sv"]
    symfony_profiler: # must be placed in config_dev.yml
        enabled: true
    webui:
        enabled: true
    edit_in_place:
        enabled: true
        config_name: default # the first one or one of your configs
        activator: php_translation.edit_in_place.activator
    configs:
        app:
            dirs: ["%kernel.root_dir%/Resources/views", "%kernel.root_dir%/../src"]
            output_dir: "%kernel.root_dir%/Resources/translations"
            excluded_names: ["*TestCase.php", "*Test.php"]
            excluded_dirs: [cache, data, logs]
# routing_dev.yml
_translation_webui:
    resource: "@TranslationBundle/Resources/config/routing_webui.yml"
    prefix:  /admin
  
_translation_profiler:
    resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yml'
# routing.yml
_translation_edit_in_place:
    resource: '@TranslationBundle/Resources/config/routing_edit_in_place.yml'
    prefix:  /admin

Documentation

Read the full documentation at http://php-translation.readthedocs.io.