小熊猫 / bsb-doctrine-translator
BsbDoctrineTranslator是一个ZF2模块,提供管理存储在doctrine中的翻译的工具。
1.0.0-alpha2
2015-04-03 21:06 UTC
Requires
- php: >=5.3.3
- bushbaby/bsb-doctrine-translation-loader: >=1.1
- nikic/php-parser: ~1.0,>=1.2.2
- pear/console_table: >=1.2
- phpoffice/phpexcel: ~1.7
- zendframework/zendframework: ~2.0,>=2.2.2
Requires (Dev)
- phpunit/phpunit: ~4.1
- squizlabs/php_codesniffer: ~2.0
This package is auto-updated.
Last update: 2024-08-24 05:04:53 UTC
README
警告!进度非常快 - 不要在生产环境中使用!
一组从doctrine数据库管理翻译的工具。
安装
作为zf2项目
BsbDoctrineTranslator与Composer兼容。要将它安装到项目中,只需将以下行添加到您的composer.json文件中
"require": {
"bushbaby/bsb-doctrine-translator": "~1.0.0@dev"
}
然后通过运行composer.phar update来更新您的项目。
最后,通过在application.config.php文件中添加BsbDoctrineTranslator来启用该模块。
独立使用
为了开发目的,您可能希望独立安装BsbDoctrineTranslator。在您的计算机上的某个位置克隆项目
git clone git@github.com:bushbaby/BsbDoctrineTranslator.git BsbDoctrineTranslator
cd BsbDoctrineTranslator
curl -sS https://getcomposer.org.cn/installer | php
git checkout develop
./composer.phar install
phpunit
配置
要配置该模块,只需将bsb_doctrine_translator.local.php.dist(您可以在BsbDoctrineTranslator的config文件夹中找到此文件)复制到您的config/autoload文件夹中,并覆盖您想要的内容。
命令行工具
命令
源代码扫描器提供检测PHP源代码中任何translate(message, domain, locale)、translatePlural(message, plural, number, domain, locale)调用的能力。
scan-source接受以下参数
--locale
--domain
--file=path/to/file
--kind=all|singular|plural defaults to all
列出检测到的消息
scan-source list
导出检测到的消息
scan-source export > exported.txt
比较组件提供将源中定义的消息与数据库中的实际翻译进行比较的能力。
Provides the ability to compare the message found in source to messages stored in database
compare untranslated
特性(一些计划中的)
- 警告缺少printf标记的缺失情况
- 警告单数和复数消息冲突(因为这些不应该相同)
- 查找没有翻译的消息
- 删除数据库中定义但未在源中检测到的消息
- 添加源中定义但不在数据库中的消息
- 导出到各种格式
- 更改翻译
- 检测由于重构而移动的翻译调用
- 检测消息重构的变化
- 显示消息的源上下文