mdm / translator-checker-bundle
帮助您检查所有 twig 字符串是否已翻译 - 以及所有翻译键是否存在
2.6
2015-01-16 15:20 UTC
Requires
- sensio/framework-extra-bundle: ~3.0
- symfony/symfony: 2.6.*
- twig/extensions: ~1.0
This package is not auto-updated.
Last update: 2024-09-14 15:17:10 UTC
README
这是一个帮助您修复翻译文件的工具。
版本
请使用 2.1 分支为 Symfony 2.1.* 应用程序
composer require mdm/translator-checker-bundle 2.1@dev
使用 master 分支为 Symfony 2.2.* 应用程序
composer require mdm/translator-checker-bundle dev-master
并且使用 2.6 分支为 Symfony 2.6.* 应用程序
composer require mdm/translator-checker-bundle 2.6.*
用法
将此组件添加到您的 AppKernel
...
new MDM\TranslatorCheckerBundle\MDMTranslatorCheckerBundle(),
...
```
### Detect duplicate of translation values
Sometimes your files can contains to keys with same values, used the next command to detect them :
php app/console translation:check-duplicates [文化]
### Detect missing tanslations
You can sometime forget to add `{% trans %}` token or `{{ "thing"|trans }}` filter. Can also make typos in your translations keys.
php app/console translation:check-missings [文化]
If you want to output in a Junit file use :
php app/console translation:check-missings en -n --junit myjunit.xml
Or for multiple cultures at the same time :
php app/console translation:check-missings fr,en -n --junit myjunit.xml
### Detect unused translation keys
If you want to detect keys not used in your twig :
php app/console translation:check-missings [文化] --show-unused
Of course can also be outputed in junit :
php app/console translation:check-missings fr,en -n --junit myjunit.xml --show-unused