Skip to content
Symfony integration for Translations
Branch: master
Clone or download
damienalexandre and Nyholm [EditInPlace] Fix bad HTML generation when there is HTML in the trans…
…lation (#259)

* [EditInPlace] Do not replace HTML translation with <x-trans> tag

* Fix the Coding Style as suggested by StyleCi

(too bad phpcsfixer is not part of the project)

* Instead of disabling HTML translations, just generate valid HTML
Latest commit 99f88a7 Feb 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Catalogue
Command Add "up" to available direction in sync command (#251) Aug 9, 2018
Controller Using MessageInterface (#191) Apr 10, 2018
DependencyInjection Avoid deprecated notice when using symfony/config > 4.2 (#273) Dec 27, 2018
EditInPlace
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 [EditInPlace] Fix bad HTML generation when there is HTML in the trans… Feb 25, 2019
Translator [EditInPlace] Fix bad HTML generation when there is HTML in the trans… Feb 25, 2019
Twig
.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 add php 7.3 (#276) Dec 27, 2018
Changelog.md
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 Excluded tests from classmap (#274) Dec 27, 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.

You can’t perform that action at this time.