antfroger/dont-translate-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

A bundle to disable the translation of your Symfony2 applications and only display the translation keys

v1.3.1 2016-10-27 14:48 UTC

This package is not auto-updated.

Last update: 2020-12-08 20:04:54 UTC


README

A bundle to disable the translation of your Symfony2 applications and only display the translation keys

Latest Stable Version SensioLabsInsight Scrutinizer Code Quality Code Coverage Build Status

Installation

1. Add the required package using composer.

composer require antfroger/dont-translate-bundle

2.Add the bundle to your AppKernel.

<?php
// in %kernel.root_dir%/AppKernel.php
$bundles[] = new Af\Bundle\DontTranslateBundle\AfDontTranslateBundle();

3. Optionally, define the configuration

  • mode: the mode you want to use to enable the feature (get, cookie)
  • param_name: the name of the parameter that you use to enable the feature
  • roles: the user should at least have one of these roles to be able to enable the feature if no role is defined the user doesn't need to be logged in to be able to enable the feature
# app/config/config.ym
af_dont_translate:
    mode: "get"
    param_name: "untrans"
    roles: ["ROLE_ADMIN", "ROLE_TRANSLATOR"]

Usage

To display your application without translation, add the GET parameter param_name to the URL

http://my-application.io/?untrans

or add a cookie param_name to only see the translation keys in your application

License

This library is under the MIT license. For the full copyright and license information, please view the LICENSE file that was distributed with this source code.