afe/translation-tool-bundle

检查重复的翻译代码,未使用的翻译代码,……

安装: 110

依赖: 0

建议者: 0

安全性: 0

星标: 2

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

0.1.0 2015-09-07 21:06 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:47:41 UTC


README

此捆绑包提供一组工具以

  • 查找未使用的翻译代码
  • 查找重复的翻译代码

安装

composer require afe/translation-tool-bundle:dev-master
// AppKernel.php
public function registerBundles()
{
    ...
    $bundles = array(
        ...
        new Afe\TranslationToolBundle\AfeTranslationToolBundle(),
        ...
    );
    ...
}

配置

# 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

使用

# display duplicated translations code
php app/console afe:translation:check:codes

# display unused translations code
php app/console afe:translation:unused:codes