crowdin/crowdin-api-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crowdin/crowdin-api-client

最新稳定版本:1.19.0

Composer 安装命令:

composer require crowdin/crowdin-api-client

包简介

PHP client library for Crowdin API v2

README 文档

README

Crowdin PHP client

The Crowdin PHP client is a lightweight interface to the Crowdin API. It provides common services for making API requests.

Our API is a full-featured RESTful API that helps you to integrate localization into your development process. The endpoints that we use allow you to easily make calls to retrieve information and to execute actions needed.

API Client Docs  |  Examples  |  Crowdin API  |  Crowdin Enterprise API

Packagist Version Packagist Tests codecov GitHub contributors GitHub

Requirements

  • PHP >= 7.1

Installation

Install via Composer

composer require crowdin/crowdin-api-client

Quick Start

The API client must be instantiated and configured before calling any API method.

use CrowdinApiClient\Crowdin;

$crowdin = new Crowdin([
    'access_token' => '<access_token>',
    'organization' => '<organization_domain>', // optional
]);

<access_token> - Personal Access Token. You can generate Personal Access Token in your Crowdin Account Settings.

<organization_domain> - Organization domain name (for Crowdin Enterprise users only).

For more about Authorization see the documentation.

REST API Examples

  • Create directory

    $directory = $crowdin->directory->create(
        <project_id>,
        ['name'=> 'My Directory']
    );
  • Edit directory

    $directory->setTitle('My Title');
    
    $crowdin->directory->update($directory);
  • Delete directory

    $crowdin->directory->delete($directory->getProjectId(), $directory->getId());

GraphQL API Example

For more information about GraphQL API see the documentation.

$query = 'query($limit: Int) {
  viewer {
    projects(first: $limit) {
      edges {
        node {
          name
          files(first: $limit) {
            totalCount
            edges {
              node {
                name
                type
              }
            }
          }
        }
      }
    }
  }
}';

$response = $crowdin->graphql->query($query, null, ['limit' => 10]);

Seeking Assistance

If you find any problems or would like to suggest a feature, please read the How can I contribute section in our contributing guidelines.

Contributing

If you would like to contribute, please read the Contributing Guidelines.

License

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.

统计信息

  • 总下载量: 1.34M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 63
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 62
  • Watchers: 5
  • Forks: 35
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-22