georgii-web / crowdin-api
PHP实现的Crowdin API
3.0.1
2021-05-07 14:13 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- phpunit/phpunit: ~6.0
- sami/sami: ~4.0
README
受https://github.com/akeneo/php-crowdin-api启发
安装
composer require georgii-web/crowdin-api
使用
use ElKuKu\Crowdin\Crowdin; use ElKuKu\Crowdin\Languagefile; $crowdin = new Crowdin('{project-id}', '{api-key}'); // Add new translation file $crowdin->file->add(new Languagefile('{local path}', '{crowdin path}')); // Export a translated file $crowdin->file->export('{crowdin path}', '{language}', '{local path}'); // Delete a translation file $crowdin->file->delete('{crowdin path}'); // Export (build) translation files on Crowdin $crowdin->translation->export(); // Download a zip file containing all language files $crowdin->translation->download('all.zip', '/local/path/to/package.zip');
注意: 包含流畅的自动完成和许多来自官方API文档的doc块。
... 以便在您的IDE中使用,使生活变得简单 😉
方法
项目
create()
https://crowdin.com/page/api/create-projectedit()
https://crowdin.com/page/api/edit-projectdelete()
https://crowdin.com/page/api/delete-projectgetInfo()
https://crowdin.com/page/api/infogetList()
https://crowdin.com/page/api/get-projects
目录
add()
https://crowdin.com/page/api/add-directoryupdate()
https://crowdin.com/page/api/change-directorydelete()
https://crowdin.com/page/api/delete-directory
文件
add()
https://crowdin.com/page/api/add-fileupdate()
https://crowdin.com/page/api/update-filedelete()
https://crowdin.com/page/api/delete-fileexport()
https://crowdin.com/page/api/export-file
翻译
upload()
https://crowdin.com/page/api/upload-translationexport()
https://crowdin.com/page/api/exportdownload()
https://crowdin.com/page/api/downloadgetStatus()
https://crowdin.com/page/api/status
语言
getSupported()
https://crowdin.com/page/api/supported-languagesgetStatus()
https://crowdin.com/page/api/language-status
内存
download()
https://crowdin.com/page/api/download-tmupload()
https://crowdin.com/page/api/upload-tm
术语库
download()
https://crowdin.com/page/api/download-glossaryupload()
https://crowdin.com/page/api/upload-glossary
hF
=;)