georgii-web / crowdin-api
A crowdin API implementation in PHP
Installs: 2 133
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 5
pkg:composer/georgii-web/crowdin-api
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- phpunit/phpunit: ~6.0
- sami/sami: ~4.0
README
Inspired by https://github.com/akeneo/php-crowdin-api
Installation
composer require georgii-web/crowdin-api
Usage
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');
Note: There is fluent auto complete and lots of doc blocks, taken from the official API documentation.
... to make life easy in your IDE 😉
Methods
Project
- create()https://crowdin.com/page/api/create-project
- edit()https://crowdin.com/page/api/edit-project
- delete()https://crowdin.com/page/api/delete-project
- getInfo()https://crowdin.com/page/api/info
- getList()https://crowdin.com/page/api/get-projects
Directory
- add()https://crowdin.com/page/api/add-directory
- update()https://crowdin.com/page/api/change-directory
- delete()https://crowdin.com/page/api/delete-directory
File
- add()https://crowdin.com/page/api/add-file
- update()https://crowdin.com/page/api/update-file
- delete()https://crowdin.com/page/api/delete-file
- export()https://crowdin.com/page/api/export-file
Translation
- upload()https://crowdin.com/page/api/upload-translation
- export()https://crowdin.com/page/api/export
- download()https://crowdin.com/page/api/download
- getStatus()https://crowdin.com/page/api/status
Language
- getSupported()https://crowdin.com/page/api/supported-languages
- getStatus()https://crowdin.com/page/api/language-status
Memory
- download()https://crowdin.com/page/api/download-tm
- upload()https://crowdin.com/page/api/upload-tm
Glossary
- download()https://crowdin.com/page/api/download-glossary
- upload()https://crowdin.com/page/api/upload-glossary
hF
=;)

