crowdin / crowdin-api-client-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby client library for Crowdin API
Home Page: https://rubygems.org/gems/crowdin-api
License: MIT License
Ruby client library for Crowdin API
Home Page: https://rubygems.org/gems/crowdin-api
License: MIT License
Crowdin has recently released new endpoints for the Applications API. We need to add support for them in the Crowdin API client as well.
API reference:
The method #build_project_file_translation
sends eTag
as a request parameter.
{
"errors": [
{
"error": {
"key": "eTag",
"errors": [
{
"code": "notFound",
"message": "Field 'eTag' Not Found"
}
]
}
}
]
}
After updating from v1.6.0
to v1.7.0
, JSON files began to upload corrupted.
#add_file
New JSON files are corrupted as their JSON data content has been replaced with the local file path string.Original file content | Uploaded file content |
---|---|
{"data": "Data"} | "/path/to/file.json" |
#update_or_restore_file
Returns error:{
"errors" => [
"error" => {
"key" => "storageId",
"errors" => [
"code" => "fileInvalid",
"message" => "Uploaded file \"file.json\" is invalid and cannot be processed"
]
}
]
}
New API endpoints:
Crowdin Enterprise endpoints are almost the same, but there is some difference in template config:
We were using version 1.6 of the AI, but when updating it to 1.8, we noticed a compatibility break in the response ( from the release notes, that's expected ). But since I could not find a confirmation of how to use the new response in the docs I am asking here.
Method: download_bundle
Responses
Version 1.6 / 1.7
BUNDLE bundle-XXXXXXX-XXX-XXXXX-XXX-XXXXXXXXX.zip
Version 1.8
{"data"=>{"url"=>"", "expireIn"=>"2024-04-12T13:17:41+00:00"}}
If I understood correctly, the downloaded local file name is the export it with a prefix and the .zip extensions. Something like
bundle-<EXPORT_ID>.zip
Is that correct?
Is there another way to get the local file name?
Recently, Crowdin introduced new AI features, including a new set of API endpoints to manage and interact with these AI resources.
The new AI API endpoints should be added to the Crowdin API clients to allow users to programmatically interact with these new features.
References:
Crowdin has recently introduced a new feature called Report Archives that allows you to see the history of your reports. This feature comes with a set of new API endpoints that you can use to interact with the report archives.
The new API endpoints should be added to the Crowdin API client.
References:
Seems like a JRuby bug
OpenSSL::X509::StoreError: No message available
Fixed on master (will be in 0.9.6)
Thank you for your understanding 🐱
Currently, the list of available methods for the fetch_all
feature is hardcoded.
It's a bad approach since we need to maintain this list and there is a risk to forget adding some new methods.
We need to refactor this feature and get rid of these hardcoded values. Also, it would be great to somehow validate the passed method (if it supports pagination), or add some graceful exception handling for that.
As a Crowdin Ruby API client user, I would like to have online docs to navigate and explore the client resources, methods, parameters, etc.
Examples:
These docs should be generated using GH Actions and deployed to GH Pages. Workflow example: docs.yml
The possible tool for that is rdoc.
Steps:
Crowdin Rest API now supports API methods that allow to manage screenshot labels.
New API methods:
It should be added to this API client as well as the corresponding unit tests.
Crowdin has recently added new endpoints for managing custom applications. Support for these endpoints is missing in this Crowdin API client.
We need to add support for the following endpoints:
The following parameters are required by API - name
, format
, sourcePatterns
, exportPattern
.
It should be marked as required in the code also and the corresponding error should be raised in case of some parameter absence. (raise_parameter_is_required_error
)
Adn
Crowdin Rest API now supports the API methods for TM (Translation Memory) segments management.
New API methods:
It should be added to this API client as well as the corresponding unit tests.
Crowdin has recently added a new feature called custom attributes for entities. This feature also has a set of API endpoints to manage custom attributes.
The API client should be updated to support these endpoints.
References:
Only for Crowdin Enterprise.
Crowdin added 3 new API endpoints that should be also added to the corresponding sections of this API Client.
New code should be covered by Unit tests in the same way as the rest of the code.
New API endpoints:
These new endpoints should be reflected in this API client and covered by Unit tests.
We've added a few new API endpoints to manage Bundles in Crowdin - https://developer.crowdin.com/api/v2/#tag/Bundles
It would be great to add the new methods to the corresponding module - api_resources/bundles.rb and include tests.
Crowdin recently added a bunch of new API methods to manage Strings Exporter settings for some file formats.
The new methods need to be added to this API Client.
API Reference:
The Autogenerated online documentation was added in #32. In this PR only the Bundles, Projects, Storage, and Source Files resources were documented.
Example of the method annotation:
We need to add annotations for the rest API resources:
API reference:
Each API resource documentation can be delivered in a separate PR. Also, it's a good idea to join some resources into one PR.
Crowdin API has a new Notifications API that allows sending notifications to the project and organization members. It would be great to add support for this API in this Crowdin API client.
API reference:
Crowdin Rest API now supports the qaChecksIgnorableCategories
field on the Projects API.
This field allows you to retrieve the list of QA Check categories that can be ignored for a Crowdin project.
Affected API methods:
It should be reflected in this API client and the corresponding unit tests should be updated.
hi
Hello @keshandrr !
I know that you're going to add pagination support to the API client.
What is a current state of it? Have you already started working on it?
We could help and contribute the development of pagination support, in case it can speed things up.
But in order to contribute we should coordinate what and how we build to get an acceptable result.
Crowdin Rest API now supports an API method that allows downloading file preview.
New API method:
It should be added to this API client as well as the corresponding unit tests.
Crowdin added new API endpoint - String Batch Operations.
It would be great to add the new method to this API client as well as the corresponding unit tests.
Currently, the request timeout is disabled (timeout: nil) and can't be configured which can lead to indefinite response waits.
crowdin-api-client-ruby/lib/crowdin-api/client/configuration.rb
Lines 18 to 24 in a383c3c
The response from Build Project File Translation contains important etag
data, which is not accessible through the #build_project_file_translation
method, as it returns only the downloaded file's path.
crowdin-api-client-ruby/lib/crowdin-api/core/send_request.rb
Lines 46 to 52 in a3110e9
Problem
There is a possibility to configure retry configuration for requests to handle some exceptions:
@crowdin.fetch_all(:list_projects, {}, { request_delay: 2, retries_count: 3, error_messages: ['401'] })
But this retry configuration applies only to the fetch_all
methods and not to all the API Client methods.
Narrative
We need to make the retry configuration global so in this case, we'll be able to configure retry options for any request to Crowdin.
Possible solution: move this configuration to the client configuration level and consider these options in each API request to Crowdin
Also, this feature should be better documented in the Readme.
Additional info
Good reference - Crowdin JS API Client Retry Configuration
When calling the build_project_file_translation
method, the resulting file is downloaded into the current working directory of the process. This is inconvenient for a few reasons:
download_*
methods).Dir.chdir
, which has global effects in the process.It would be really helpful to be able to pass a destination into the build_project_file_translation
method, and other similar methods.
Crowdin has recently released a new API methods to get information about security logs. It would be great to add support of these methods to the Crowdin API client.
References:
We've added a new API methods section - Organization-Webhooks. It's a webhooks that allow you to collect information about events that happen in your Crowdin account/organization.
It would be great to reflect these API changes in the API Client.
Note: the events
list is different for crowdin.com and Crowdin Enterprise APIs.
Crowdin has recently released a new type of projects - String-based.
In string-based projects, the focus is on managing translatable content as individual strings rather than source files. In this project type, after uploading source files, Crowdin parses them into source strings. Unlike file-based projects, source files aren’t stored, and the emphasis is on managing the content at the string level. This approach is beneficial when dealing with projects that involve continuous content updates, dynamic content, or where a string-oriented structure is preferred.
As a result, the API differs a bit from the file-based projects. Most of the endpoints are the same, but some endpoints have different parameters or return different responses, some endpoints are not available at all, and some new endpoints are available only for string-based projects.
We should update the API clients to support string-based projects as well.
References:
It has been implemented for the following clients:
REST API v2 has a method to build translations. Is this feature planning to add in a gem?
We're happy to announce a significant update for Crowdin Glossaries that allows managing the terminology in a more advanced way.
There are a lot of new things and some changes in the Crowdin API.
New APIs:
Updates:
format
and exportFields
scheme
The translationOfTermId
is deprecated and the conceptId
added in:
status
, type
, gender
, note
, url
)Edit Term - new path options
All of these changes should be reflected in this API Client.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.