crowdin / crowdin-api-client
适用于Crowdin API v2的PHP客户端库
1.13.1
2024-07-05 09:53 UTC
Requires
- php: >=7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.2 || ^7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3.0
- phpunit/phpunit: ^7.5 || ^8.5 || ^9.6
This package is auto-updated.
Last update: 2024-09-05 10:12:59 UTC
README
Crowdin PHP客户端
Crowdin PHP客户端是对Crowdin API的轻量级接口。它提供了进行API请求的常用服务。
我们的API是一个功能齐全的RESTful API,可以帮助您将本地化集成到开发过程中。我们使用的端点允许您轻松地调用以检索信息和执行所需操作。
API客户端文档
| Crowdin API
| Crowdin企业API
要求
- PHP >= 7.1
安装
通过Composer安装
composer require crowdin/crowdin-api-client
快速开始
在调用任何API方法之前,必须实例化和配置API客户端。
use CrowdinApiClient\Crowdin; $crowdin = new Crowdin([ 'access_token' => '<access_token>', 'organization' => '<organization_domain>', // optional ]);
<access_token>
- 个人访问令牌。您可以在Crowdin账户设置中生成个人访问令牌。
<organization_domain>
- 组织域名(仅适用于Crowdin企业用户)。
有关授权的更多信息,请参阅文档。
运行方法
-
创建
$directory = $crowdin->directory->create( <project_id>, ['name'=> 'My Directory'] );
-
编辑
$directory->setTitle('My Title'); $crowdin->directory->update($directory);
-
删除
$crowdin->directory->delete($directory->getProjectId(), $directory->getId());
寻求帮助
如果您发现任何问题或想建议一个功能,请阅读我们贡献指南中的如何贡献部分。
贡献
如果您想贡献,请阅读贡献指南。
许可证
The Crowdin PHP client is licensed under the MIT License. See the LICENSE file distributed with this work for additional information regarding copyright ownership. Except as contained in the LICENSE file, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.