REST API: test translation by linter

When I use Crowdin UI to translate strings, then upon saving the translation, the UI warns me that there are several problems with the translation, reported by linter. I can read the list of issues and click “Save anyway” or “Cancel”.
However, if I submit translation via Crowdin API /projects/{projectId}/translations endpoint, then any text is happily accepted. I wanted to ask here, if there’s any way to get the linter analysis for the translations submitted via API.

Hi @Passiday!

Unfortunately, in the Activity section in Crowdin, it’s not written when Translations are uploaded by API.
However, it will show when translations got uploaded in general and you can compare the activity record time with the time when you did the API call.

You can also check the API calls history in the Tools tab:


Also, we would appreciate it if you send us the screenshot of the errors you see when trying to upload translations via UI

Looking forward to your reply!

1 Like

Here’s the screenshot of Crowdin UI when attempting to save a translation and it triggers linter errors.
image

Those all are good and expected errors, and I just would appreciate if there existed a way how to get this linter error list via API. I am developing a tool that allows users to submit translations, and currently have to to let the translations be accepted without this kind of validation. That is not optimal.

Hi there @Passiday!

You might find this API feature helpful:
https://developer.crowdin.com/api/v2/#operation/api.projects.qa-checks.getMany

With this endpoint, you will be able to List QA Check Issues

Hi @Tamara,

I am a bit confused, whether those QA checks you are referring to are the same checks that I get immediately when I am trying to save a translation using Crowdin UI. For example, the first error in that screenshot checks if there is equal amount of “\r” symbols. The qa-checks endpoint has quite many possible values for the “category” and “validation” parameters, so I don’t know, maybe one of those includes also counting the number of carriage returns.

Also, the qa-checks endpoint returns the list of issues over very wide scope — the whole project. Ok, it can be narrowed down by language id, but nevertheless, huge scope. No way to limit only to certain string or file.

Hi @Passiday!

The QA checks you encounter in the Crowdin UI when saving a translation are indeed part of the same system that the qa-checks endpoint uses. However, the endpoint provides a broader overview, which includes various categories and validations that can be specified.

Regarding the scope, it’s true that the endpoint returns issues for the entire project or a specific language. Currently, there isn’t a feature to limit the results to a particular string or file directly through the endpoint. For immediate feedback on specific strings, the UI’s real-time QA checks are the best tool.

Please let us know if you need further assistance with this or any other queries

Thanks @Tamara, just one more question regarding this: if this wide-scope QA checks list also available through normal Crowdin UI? Ie, filterable by category and type, pageable etc.

HI @Passiday ,

In Crowdin UI, you can set which issues you want to detect by going to the Project Settings → QA checks tab. Also, in The Editor, you can filter the existing translations by the specific QA issue they currently have. You are welcome to read more regarding the QA checks in the UI by following the link below:

1 Like