afe / translation-tool-bundle
Check for duplicated translations code, unused translations codes, ...
Installs: 115
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: >=2.3.0
This package is not auto-updated.
Last update: 2025-09-28 00:18:38 UTC
README
This bundle provide a set of tools to :
- Find unused translations code
- Find duplicated translations code
Installation :
composer require afe/translation-tool-bundle:dev-master
// AppKernel.php
public function registerBundles()
{
...
$bundles = array(
...
new Afe\TranslationToolBundle\AfeTranslationToolBundle(),
...
);
...
}
Configuration :
# config.yml
afe_translation_tool:
# translation files configuration
translation_files_dir_path: "%kernel.root_dir%/.." # translation files root directory
translation_files_locale: fr # locale of translations files to process
translation_files_format: yml # translation files format to process (only yml is currently supported)
excluded_translation_file_mask: ["dtc_*"] # excluded translations files from process
excluded_translation_directories: ["vendor"] # exclude translation files of this directory
# processed directory configuration
src_dir_path: "%kernel.root_dir%/.." # src root directory
format_to_look_into: ["twig", "html", "php", "js"] # look for unused translation in those given files
excluded_file_mask: ["fr.json", "fr.js"] # file to exclude from the process
excluded_directories: ["node_modules", "vendor", "data", "compiled", "bootstrap", "assets"] # file to exclude from the process
Usage :
# display duplicated translations code
php app/console afe:translation:check:codes
# display unused translations code
php app/console afe:translation:unused:codes