The Crowdin PHP client is a lightweight interface to the Crowdin API v2. 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.
For more about Crowdin API v2 please see the documentation.
- PHP >= 7.1
-
Install via Composer
composer require crowdin/crowdin-api-client
-
Download this library to your project's 3rd party libraries path
git clone https://github.com/crowdin/crowdin-api-client-php.git </your-project/libs/crowdin>
and include the library in your project:
require_once 'path/to/Crowdin.php';
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.
-
Create
$directory = $crowdin->directory->create( <project_id>, ['name'=> 'My Directory'] );
-
Edit
$directory->setTitle('My Title'); $crowdin->directory->update($directory);
-
Delete
$crowdin->directory->delete($directory->getProjectId(), $directory->getId());
We are happy to accept contributions to the Crowdin PHP client. To contribute please do the following:
- Fork the repository on GitHub.
- Decide which code you want to submit. Commit your changes and push to the new branch.
- Ensure that your code adheres to standard conventions, as used in the rest of the library.
- Ensure that there are unit tests for your code.
- Submit a pull request with your patch on Github.
If you find any problems or would like to suggest a feature, please feel free to file an issue on Github at Issues Page.
Need help working with Crowdin PHP client or have any questions? Contact Customer Success Service.
Copyright © 2020 Crowdin 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.