antongorodezkiy / po-translation
CLI 客户端用于翻译 .po 文件
dev-master
2016-05-27 16:11 UTC
Requires
- gettext/gettext: ^3.6
- wp-cli/php-cli-tools: ^0.11.1
- yandex/translate-api: ^1.5
This package is not auto-updated.
Last update: 2024-09-14 18:58:44 UTC
README
通过命令行界面(CLI)使用 Yandex 翻译 API 翻译 .po(gettext)文件
要求
- PHP 5.4+
Yandex 翻译器
此包使用 Yandex 翻译 API https://translate.yandex.com,您需要获取 Yandex 翻译 API 密钥(在开发此包时是免费的) - 获取 API 密钥
依赖关系
- gettext/gettext - 用于收集和操作 gettext (.po, .mo, .php, .json, 等) 的 PHP 库
- yandex/translate-api - Yandex.Translate API 的客户端
- wp-cli/php-cli-tools - 一组工具,有助于使用 PHP 命令行工具
使用方法
在包目录下通过 CLI 界面运行 php trans
帮助
php trans -h
选项
$ php trans -h
PO Translator (using Yandex Translator https://translate.yandex.com )
Flags
--help, -h Show this help screen
Options
--api-key Yandex API key
--src-po source .po-file path
--src-lang source language [default: en]
示例
php trans --api-key trnsl.1.1.20162d0a.34add747dc2e2e2f --src-po /home/user/public_html/wp-content/themes/some-theme/languages/uk_UA.po
版权
antongorodezkiy,2016
许可
MIT