antfroger / dont-translate-bundle
A bundle to disable the translation of your Symfony2 applications and only display the translation keys
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=5.3.3
- symfony/framework-bundle: ~2.3
- symfony/translation: ~2.3
Replaces
- af/dont-translate-bundle: 1.3.*
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
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.