incenteev/translation-checker-bundle
Composer 安装命令:
composer require --dev incenteev/translation-checker-bundle
包简介
CLI tools to check translations in a Symfony project
README 文档
README
This bundle provides you a few CLI commands to check your translations. These commands are designed to be usable easily in CI jobs
Installation
Installation is a quick (I promise!) 2 step process:
- Download IncenteevTranslationCheckerBundle
- Enable the Bundle
Step 1: Install IncenteevTranslationCheckerBundle with composer
Run the following composer require command:
composer require incenteev/translation-checker-bundle
Step 2: Enable the bundle
Note: If you use Flex, you have nothing to do at this step, as Flex does it for you.
Finally, enable the bundle in the kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Incenteev\TranslationCheckerBundle\IncenteevTranslationCheckerBundle(), ); }
Warning: This bundle requires that the translator is enabled in FrameworkBundle.
Usage
The bundle provides a few CLI commands. To list them all, run:
bin/console list incenteev:translation
All commands display a summary only by default. Run then in verbose mode to get a detailed report.
Finding missing translations
The incenteev:translation:find-missing command extracts necessary translations
from our app source code, and then compare this list to the translation available
for the tested locale. It will exit with a failure exit code if any missing
translation is detected.
Warning: Translation extraction will not find all translations used by our app. So while a failure exit code means there is an issue, a success exit code does not guarantee that all translations are available. The recommended usage is to use this command for your reference locale only, and then test other locales by comparing them against the reference instead.
Comparing translations to a reference locale
The incenteev:translation:compare command compares available translations from
2 different locales and will exit with a failure exit code if catalogues are not
in sync.
Note: this command may not work well for country variants of a locale (
fr_FR). Use it for main locales.
Configuration
To use the commands comparing the catalogue to the extracted translations, you
need to configure the bundles in which the templates should be parsed for translations.
By default, only templates in templates (and app/Resources/views on Symfony 4 and older)
are registered in the extractor. You can register bundles that will be processed too.
# app/config/config.yml incenteev_translation_checker: extraction: bundles: - TwigBundle - AcmeDemoBundle
The bundle also supports extracting translations from JS files, for projects using willdurand/js-translation-bundle:
# app/config/config.yml incenteev_translation_checker: extraction: js: # Paths in which JS files should be checked for translations. # Path could be either for files, or for directories in which JS files should be looked for. # This configuration is required to enable this feature. paths: - '%kernel.project_dir%/web/js' - '%kernel.project_dir%/web/other.js' # The default domain used in your JS translations. Should match the js-translation-bundle configuration # Defaults to 'messages' default_domain: js
incenteev/translation-checker-bundle 适用场景与选型建议
incenteev/translation-checker-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 596.57k 次下载、GitHub Stars 达 36, 最近一次更新时间为 2013 年 06 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「translation」 「testing」 「translation check」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 incenteev/translation-checker-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 incenteev/translation-checker-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 incenteev/translation-checker-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
A Symfony bundle for chameleon-system/sanitycheck
A custom URL rule class for Yii 2 which allows to create translated URL rules
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
A Laravel Eloquent model trait for translatable resource
SoftWax Health Check Bundle for Symfony framework
统计信息
- 总下载量: 596.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 36
- 点击次数: 38
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-06-26